Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持 @antv/f2 5.x ? #15

Closed
zicjin opened this issue Dec 25, 2023 · 2 comments
Closed

支持 @antv/f2 5.x ? #15

zicjin opened this issue Dec 25, 2023 · 2 comments

Comments

@zicjin
Copy link

zicjin commented Dec 25, 2023

实测想要输出雷达图不可行。
相同环境 getting-started 里简单的柱状图是没有问题的。

update:
已确定是因为升级 @antv/f2 至 5.x 才出现的问题,退回4.x即可

<F2Canvas id="myChart">
  {/* <Chart
    data={[
      { genre: "Sports", sold: 275 },
      { genre: "Strategy", sold: 115 },
      { genre: "Action", sold: 120 },
      { genre: "Shooter", sold: 350 },
      { genre: "Other", sold: 150 },
    ]}>
    <Interval x="genre" y="sold" />
  </Chart> */}
  <Chart
    data={[
      {
        item: "Design",
        user: "用户 A",
        score: 70,
      },
      {
        item: "Design",
        user: "用户 B",
        score: 30,
      },
      {
        item: "Development",
        user: "用户 A",
        score: 60,
      },
      {
        item: "Development",
        user: "用户 B",
        score: 70,
      },
      {
        item: "Marketing",
        user: "用户 A",
        score: 50,
      },
    ]}
    coord="polar"
    scale={{
      score: {
        min: 0,
        max: 120,
        nice: false,
        tickCount: 4,
      },
    }}>
    <Axis field="item" />
    <Axis field="score" />
    <Line x="item" y="score" color="user" />
    <Point x="item" y="score" color="user" />
    <Legend />
  </Chart>
</F2Canvas>
TypeError: canvas.canvas.get is not a function
    at Object.<anonymous> (._node_modules_.pnpm_taro-f2-react@1.1.2_node_modules_taro-f2-react_es_index.js:51)
    at Function.<anonymous> (WAServiceMainContext.js?t=wechat&s=1703467546811&v=3.1.5:1)
    at :59047/appservice/<SelectorQuery callback function>
    at WAServiceMainContext.js?t=wechat&s=1703467546811&v=3.1.5:1
    at WAServiceMainContext.js?t=wechat&s=1703467546811&v=3.1.5:1
    at Array.forEach (<anonymous>)
    at WAServiceMainContext.js?t=wechat&s=1703467546811&v=3.1.5:1(env: macOS,mp,1.06.2310080; lib: 3.1.5)
TypeError: this.canvas.getContext is not a function
    at OffscreenCanvasCreator.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.OffscreenCanvasCreator.getOrCreateCanvas (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:9947)
    at TextService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextService.measureFont (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:11224)
    at TextService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextService.measureText (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:11298)
    at TextUpdater.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextUpdater.update (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:8262)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.updateGeometry (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6939)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.processProperties (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6747)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.recalc (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6919)
    at Canvas.handleMounted (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:14774)
    at EventService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.EventService.notifyListeners (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:9877)
    at EventService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.EventService.dispatchEvent (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:9574)(env: macOS,mp,1.06.2310080; lib: 3.1.5)
TypeError: Cannot set property 'font' of undefined
    at TextService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextService.measureFont (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:11228)
    at TextService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextService.measureText (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:11298)
    at TextUpdater.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.TextUpdater.update (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:8262)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.updateGeometry (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6939)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.processProperties (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6747)
    at DefaultStyleValueRegistry.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.DefaultStyleValueRegistry.recalc (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:6919)
    at RenderingService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.RenderingService.renderDisplayObject (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:10124)
    at ._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:10157
    at Array.forEach (<anonymous>)
    at RenderingService.define.push../node_modules/.pnpm/@antv+g-lite@1.2.20/node_modules/@antv/g-lite/dist/index.esm.js.RenderingService.renderDisplayObject (._node_modules_.pnpm_@antv+g-lite@1.2.20_node_modules_@antv_g-lite_dist_index.esm.js:10156)(env: macOS,mp,1.06.2310080; lib: 3.1.5)
  "dependencies": {
    "@antv/f2": "^5.0.39",
    "@tarojs/components": "3.6.21",
    "@tarojs/helper": "3.6.21",
    "@tarojs/plugin-framework-react": "3.6.21",
    "@tarojs/plugin-html": "3.6.21",
    "@tarojs/plugin-platform-alipay": "3.6.21",
    "@tarojs/plugin-platform-h5": "3.6.21",
    "@tarojs/plugin-platform-jd": "3.6.21",
    "@tarojs/plugin-platform-qq": "3.6.21",
    "@tarojs/plugin-platform-swan": "3.6.21",
    "@tarojs/plugin-platform-tt": "3.6.21",
    "@tarojs/plugin-platform-weapp": "3.6.21",
    "@tarojs/react": "3.6.21",
    "@tarojs/runtime": "3.6.21",
    "@tarojs/shared": "3.6.21",
    "@tarojs/taro": "3.6.21",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-refresh": "^0.14.0",
    "taro-f2-react": "^1.1.2",
    ...
  }

简单柱状图TypeError: canvas.canvas.get is not a function错误同样存在,但不影响显示效果。TypeError: this.canvas.getContext is not a function 应该是主要原因。

@zicjin zicjin changed the title 是否支持 <Timeline>? 是否支持 <Timeline>作为主节点? Dec 25, 2023
@zicjin zicjin changed the title 是否支持 <Timeline>作为主节点? 是否支持 雷达图? Dec 25, 2023
@zicjin zicjin changed the title 是否支持 雷达图? 支持 @antv/f2 5.x ? Dec 25, 2023
@domisooo
Copy link
Owner

已收到你的 issues ,从错误信息上看猜测应该是 5.0 修改了 API 导致的,找时间我验证下看如何做下兼容,感谢。

@domisooo
Copy link
Owner

已发布 1.2.0 版本,兼容 @antv/f2 v5.x 版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants