echarts-gl 有对应的 ts 版本吗?

echarts-gl 可以允许 echarts 使用 3d 的图表, 在使用 2d 图表时,只引入 echarts, 因为 echarts 使用的是 ts 编写的,所以使用时有比较好的代码提示,特别是配置的提示。但是 echarts-gl 不是由 ts 编写的,请问一下 echarts-gl 有对应的 ts 编写的版本吗?

阅读 3.4k
2 个回答

https://github.com/ecomfe/echarts-gl
官方没有的话自定义:

// echarts-gl.d.ts
declare module 'echarts-gl' {
  import * as echarts from 'echarts/core';

  export interface GLChartOptions {
    // ...
  }

  export function GLChart(options: GLChartOptions): echarts.ECharts;
}

ECharts 在3年前更新V5版本的时候用TS重写了,但是 ECharts GL 并没有用TS重写。

TypeScript社区也没有提供 EChartsGL 的类型声明文件,我只找到了 @type/echarts
不知道里面有没有包含 echart-gl 相关的声明。如果没有的话,确实和1楼说的一样,你得自己写了。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题