{"id":20461411,"url":"https://github.com/antvis/my-f2","last_synced_at":"2025-04-07T06:05:09.639Z","repository":{"id":39310196,"uuid":"113407583","full_name":"antvis/my-f2","owner":"antvis","description":"F2 的支付宝小程序版本","archived":false,"fork":false,"pushed_at":"2024-06-05T11:22:32.000Z","size":505,"stargazers_count":146,"open_issues_count":55,"forks_count":23,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-29T12:33:28.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-07T05:37:57.000Z","updated_at":"2024-09-14T08:21:51.000Z","dependencies_parsed_at":"2024-11-09T00:11:51.104Z","dependency_job_id":null,"html_url":"https://github.com/antvis/my-f2","commit_stats":{"total_commits":60,"total_committers":5,"mean_commits":12.0,"dds":0.5,"last_synced_commit":"cf196e9402a7188523833283b4e37a81891f1d5d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fmy-f2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/my-f2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247452771,"owners_count":20941167,"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:25:21.785Z","updated_at":"2025-04-07T06:05:09.616Z","avatar_url":"https://github.com/antvis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F2 支付宝小程序\n\nF2 的支付宝小程序版本，支持原生 [F2](https://f2.antv.vision/) 的所有功能，欢迎使用反馈。\n\n## 说明\n为了方便使用，我们封装了小程序的自定义组件，故需要支付宝小程序基础库支持自定义组件\n\n**重要：版本要求**\n\n1. 小程序基础库版本 **1.7.0** 或以上\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 --save\n```\n\n### 2. 使用自定义组件\n\n#### 1. 打开json文件，引入组件\n\n```json\n{\n  \"usingComponents\": {\n    \"f2\": \"@antv/my-f2\"\n  }\n}\n```\n\n#### 2. axml 使用组件\n\n```xml\n\u003cview class=\"f2-chart\"\u003e\n  \u003cf2 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/issues) 看看有没有类似的 bug 或者建议。\n\n## License\n\n[MIT license](https://github.com/antvis/my-f2/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fmy-f2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fmy-f2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fmy-f2/lists"}