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

feat(v2/column): support grouped and stacked bar #1357

Merged
merged 5 commits into from Jul 30, 2020
Merged

feat(v2/column): support grouped and stacked bar #1357

merged 5 commits into from Jul 30, 2020

Conversation

BBSQQ
Copy link
Member

@BBSQQ BBSQQ commented Jul 29, 2020

紧跟刀哥的步伐

TODO:

  • 添加 isGroup 属性,帮助用户理解是分组还是堆叠;

@BBSQQ BBSQQ requested review from lessmost, hustcc and visiky July 29, 2020 03:45
@auto-add-label auto-add-label bot added the enhancement New feature or request label Jul 29, 2020
Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@lgtm-com
Copy link

lgtm-com bot commented Jul 29, 2020

This pull request fixes 1 alert when merging 0310e1c into 3d760b6 - view on LGTM.com

fixed alerts:

  • 1 for Unused variable, import, function or class

@hustcc
Copy link
Member

hustcc commented Jul 29, 2020

之前 v1 中 x y 轴分别是横向的、纵向的。感觉不一定是合理的。需要做一个调研。

highcharts 是不交换的,amcharts 是和 v1 一样交换的。

image
image

@BBSQQ
Copy link
Member Author

BBSQQ commented Jul 29, 2020

之前 v1 中 x y 轴分别是横向的、纵向的。感觉不一定是合理的。需要做一个调研。

highcharts 是不交换的,amcharts 是和 v1 一样交换的。

image
image

支持维持 v1 设计,x y 分别表示物理意义上的横向和纵向,有以下 3 个原因:

  1. plot 层面处理需要尽量通俗易懂,从事数据分析 or 一个可视化小白,就认为横向的是 x,纵向的是 y,例如在 ECharts、matplotlib 中也是这么处理的;
  2. 具有可视化专业知识的用户可以非常明白条形图无非是柱形图的 transpose,但是 G2Plot 的定位是想要开箱即用,而非需要用户再加一层可视化认知;
  3. 对 v1 的设计推翻需要慎重,否则容易使现有用户弃坑;

@hustcc
Copy link
Member

hustcc commented Jul 30, 2020

之前 v1 中 x y 轴分别是横向的、纵向的。感觉不一定是合理的。需要做一个调研。

highcharts 是不交换的,amcharts 是和 v1 一样交换的。
image
image

支持维持 v1 设计,x y 分别表示物理意义上的横向和纵向,有以下 3 个原因:

  1. plot 层面处理需要尽量通俗易懂,从事数据分析 or 一个可视化小白,就认为横向的是 x,纵向的是 y,例如在 ECharts、matplotlib 中也是这么处理的;
  2. 具有可视化专业知识的用户可以非常明白条形图无非是柱形图的 transpose,但是 G2Plot 的定位是想要开箱即用,而非需要用户再加一层可视化认知;
  3. 对 v1 的设计推翻需要慎重,否则容易使现有用户弃坑;

ok,你说的是对的。我昨天发起了一个投票,看看外部开发者对这个是什么意见。然后再做决定可以嘛?

@hustcc
Copy link
Member

hustcc commented Jul 30, 2020

另外,对于 bar 和 column 代码重复比较多的问题,是否可以:

  1. 还是分开入口
  2. adaptor 代码片段使用高阶函数的形式进行区分。
function getTooltip(type: string) {

  return (params) => {
     // do your things
  }
}

@hustcc
Copy link
Member

hustcc commented Jul 30, 2020

之前 v1 中 x y 轴分别是横向的、纵向的。感觉不一定是合理的。需要做一个调研。

highcharts 是不交换的,amcharts 是和 v1 一样交换的。
image
image

支持维持 v1 设计,x y 分别表示物理意义上的横向和纵向,有以下 3 个原因:

  1. plot 层面处理需要尽量通俗易懂,从事数据分析 or 一个可视化小白,就认为横向的是 x,纵向的是 y,例如在 ECharts、matplotlib 中也是这么处理的;
  2. 具有可视化专业知识的用户可以非常明白条形图无非是柱形图的 transpose,但是 G2Plot 的定位是想要开箱即用,而非需要用户再加一层可视化认知;
  3. 对 v1 的设计推翻需要慎重,否则容易使现有用户弃坑;

ok,你说的是对的。我昨天发起了一个投票,看看外部开发者对这个是什么意见。然后再做决定可以嘛?

在外部开发群投票,参入人不多,总共 17 人。

image

结果相差不大,那就还是保留现状。

@hustcc hustcc merged commit a8900ec into v2 Jul 30, 2020
@hustcc hustcc deleted the v2-bar branch July 30, 2020 02:45
@BBSQQ
Copy link
Member Author

BBSQQ commented Jul 30, 2020

另外,对于 bar 和 column 代码重复比较多的问题,是否可以:

  1. 还是分开入口
  2. adaptor 代码片段使用高阶函数的形式进行区分。
function getTooltip(type: string) {

  return (params) => {
     // do your things
  }
}

如果维持原设计的话,代码重复度就还好,还是有很多地方需要做特殊配置的,先维持现状吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR: merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants