You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/07/17 06:27:25 UTC

[GitHub] [incubator-echarts] xuanhun opened a new issue #10882: 是否可以在 echarts对象上 上公开更多内部接口或者提供获取内部接口的方法,方便扩展图表

xuanhun opened a new issue #10882: 是否可以在 echarts对象上 上公开更多内部接口或者提供获取内部接口的方法,方便扩展图表
URL: https://github.com/apache/incubator-echarts/issues/10882
 
 
   ### What problem does this feature solve?
   在基于Echarts做自定义扩展图表的时候,通常需要自定义SeriesModel、Layout、View等,内部对Echarts的依赖需要通过import引入。
   1. 作为单独的组件发布,我们希望尽可能排除对Echarts模块的重复打包。因为Echarts对象提供的接口有限,我们只能排除对echarts/lib/echarts 的代码依赖,其他路径的导入最后会被打包进入扩展图表代码中。
   2. 重复打包代码会引入bug,比如我引入了(获取是间接引入)‘echarts/lib/data/Source’文件会生成一个Source对象,使用echarts.extendSeriesModel方法自定义SeriesModel的时候使用的Source对象是echarts.js依赖生成的。其实代码运行时是希望依赖的是同一个Source对象,不然在判断对象的继承关系时候会出现问题。
   这在自定义图表的时候是最大的困扰,有些问题甚至无法绕过。
   
   ### What does the proposed API look like?
   类似 echarts.getModule(''echarts/lib/data/Source"),保证同样的模块只会被初始化一次
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org