{"id":20461355,"url":"https://github.com/antvis/my-f2-pc","last_synced_at":"2025-04-13T06:17:14.698Z","repository":{"id":55365564,"uuid":"250816830","full_name":"antvis/my-f2-pc","owner":"antvis","description":"淘宝PC小程序","archived":false,"fork":false,"pushed_at":"2021-01-05T05:37:19.000Z","size":7,"stargazers_count":8,"open_issues_count":5,"forks_count":4,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-29T21:05:31.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antvis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-28T14:34:28.000Z","updated_at":"2021-06-28T02:11:01.000Z","dependencies_parsed_at":"2022-08-14T22:22:45.149Z","dependency_job_id":null,"html_url":"https://github.com/antvis/my-f2-pc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2-pc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2-pc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2-pc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2-pc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/my-f2-pc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247447287,"owners_count":20940296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T12:24:58.790Z","updated_at":"2025-04-13T06:17:14.678Z","avatar_url":"https://github.com/antvis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F2 淘宝PC小程序\n\nF2 的淘宝PC小程序，支持原生 [F2](https://f2.antv.vision/) 的所有功能，欢迎使用反馈。\n\n## 说明\n使用方式同[my-f2](https://github.com/antvis/my-f2) 完全一致\n\n## 如何使用\n\n### 1. 安装依赖\n项目默认初始化出来的是没有`package.json`的，需要新增`package.json`后再安装\n\n```bash\n## 没有package.json时执行下面这段\n## echo \"{}\" \u003e package.json\n\nnpm install @antv/my-f2-pc --save\n```\n\n### 2. 使用自定义组件\n\n#### 1. 打开json文件，引入组件\n\n```json\n{\n  \"usingComponents\": {\n    \"f2\": \"@antv/my-f2-pc\"\n  }\n}\n```\n\n#### 2. axml 使用组件\n\n```xml\n\u003cview class=\"container\"\u003e\n  \u003cf2 class=\"f2-chart\" onInit=\"onInitChart\"\u003e\u003c/f2\u003e\n\u003c/view\u003e\n```\n\n#### 3. acss 设置宽高\n```css\n.f2-chart {\n  width: 100%;\n  height: 500rpx;\n}\n```\n\n#### 4. 实例化图表\n\n```js\nPage({\n  data: {},\n  onInitChart(F2, config) {\n    const chart = new F2.Chart(config);\n    const data = [\n      { value: 63.4, city: 'New York', date: '2011-10-01' },\n      { value: 62.7, city: 'Alaska', date: '2011-10-01' },\n      { value: 72.2, city: 'Austin', date: '2011-10-01' },\n      { value: 58, city: 'New York', date: '2011-10-02' },\n      { value: 59.9, city: 'Alaska', date: '2011-10-02' },\n      { value: 67.7, city: 'Austin', date: '2011-10-02' },\n      { value: 53.3, city: 'New York', date: '2011-10-03' },\n      { value: 59.1, city: 'Alaska', date: '2011-10-03' },\n      { value: 69.4, city: 'Austin', date: '2011-10-03' },\n    ];\n    chart.source(data, {\n      date: {\n        range: [0, 1],\n        type: 'timeCat',\n        mask: 'MM-DD'\n      },\n      value: {\n        max: 300,\n        tickCount: 4\n      }\n    });\n    chart.area().position('date*value').color('city').adjust('stack');\n    chart.line().position('date*value').color('city').adjust('stack');\n    chart.render();\n    // 注意：需要把chart return 出来\n    return chart;\n  }\n});\n```\n\n## API\n\n- F2 API 参见：[https://f2.antv.vision/zh/docs/api/f2](https://f2.antv.vision/zh/docs/api/f2)\n\n## 如何贡献\n\n如果您在使用的过程中碰到问题，可以先通过 [issues](https://github.com/antvis/my-f2-pc/issues) 看看有没有类似的 bug 或者建议。\n\n## License\n\n[MIT license](https://github.com/antvis/my-f2-pc/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fmy-f2-pc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fmy-f2-pc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fmy-f2-pc/lists"}