Code Monkey home page Code Monkey logo

Comments (5)

aa1011372655 avatar aa1011372655 commented on May 14, 2024

个人感觉

  1. rener负责绑定的方案很赞
  2. 关于多实例,render后返回实例更容易拓展和操作(大多数库都是这样),如果统一维护map实例表还需要管理所有的更新和销毁,比较麻烦,也容易产生耦合,感觉不如抛给用户自行处理

from g2plot.

elaine1234 avatar elaine1234 commented on May 14, 2024

如果考虑 render 后返回实例,不如进一步考虑一下:

const options = {
  geom: {
      type: 'bar',                             // bar, line,pie etc...
      someUniqueOptions,           //  某种图表才支持的选项
  },          
  data,
  ...options,
};
plot.render(options);

第一,不会先有一个某种图表的实例,再有一个 render 的实例,导致用户认知上的问题;
第二,好扩展。举个例子:

屏幕快照 2019-10-08 下午4 30 29

这种图如果按照现在的 API, 可能需要搞一个新的 chart 类型?option 形式的话将 geom 定义成数组,里面分别定义 bar 和 line。相应 yAxis 也支持数组,以 index 或者 alias 形式指定这个定义的是哪个 geom 的 y 轴。

from g2plot.

Leannechn avatar Leannechn commented on May 14, 2024

对于目前将柱状图分为Column,GroupColumn,StackColumn。个人建议应该合并成一个Column。Column 实际上是单柱状图与重叠柱状图的实现途径。而实际需求上还有,重叠分组柱状图,分组堆叠柱状图。实际上他们不过是通一份数据的不同展示

from g2plot.

paleface001 avatar paleface001 commented on May 14, 2024

这种图如果按照现在的 API, 可能需要搞一个新的 chart 类型?option 形式的话将 geom 定义成数组,里面分别定义 bar 和 line。相应 yAxis 也支持数组,以 index 或者 alias 形式指定这个定义的是哪个 geom 的 y 轴。

这种feature会在混合图表支持,现在已经单独把layer(图层)抽出来了~

from g2plot.

aa1011372655 avatar aa1011372655 commented on May 14, 2024

长远来看,区分的细致一点更容易解耦,如果以后能够提供动态打包的功能也能够在一些图形上做一些代码的取舍,或者做成不同图形从cdn直接异步获取的形式,能够更好地缩减主体入口的文件体积

from g2plot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.