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: new theme and set padding to auto #5342

Merged
merged 1 commit into from
Aug 25, 2023
Merged

feat: new theme and set padding to auto #5342

merged 1 commit into from
Aug 25, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Jul 25, 2023

Theme

所有的测试案例都已经过了一次

升级新的主题(除了色板以外),这个 PR 目前之包含了代码的 diff,没有包含截图更新和官网案例的 diff(会有别的 PR)。

主要内容

  • padding 默认为 auto
  • 修复平行坐标系 BUG
  • 添加 scrollbar 的 auto size
  • 添加了主题 key
    • padding
    • inset
    • margin

主题更新包含

去掉 next 标签需要做的更新

  • 组件之间的间距
  • 信息层级:title,legend,axis 的文字和 tick 的颜色
  • 离散图例默认没有 title,连续图例默认有 title

image

export function stateAgesIntervalGrouped(): G2Spec {
  return {
    type: 'interval',
    title: {
      title: 'Population by age and state',
      subtitle: 'It shows the population of U.S. by age and state.',
    },
    data: {
      type: 'fetch',
      value: 'data/stateages.csv',
    },
    transform: [
      { type: 'sortX', by: 'y', reverse: true, reducer: 'sum', slice: 6 },
      { type: 'dodgeX' },
    ],
    scale: { y: { nice: true } },
    axis: { y: { labelFormatter: '~s' } },
    encode: {
      x: 'state',
      y: 'population',
      color: 'age',
    },
  };
}

不包含

这些不在去掉 next 计划以内,后续会安排上

  • 图例 title 的位置调整:从上面调整到左边
  • axis line 颜色的更新
  • 连续图例的 UI 调整
  • 字体大小的变化

@hustcc
Copy link
Member

hustcc commented Aug 4, 2023

图例 title 的位置调整:从上面调整到左边
axis line 颜色的更新
连续图例的 UI 调整
字体大小的变化

这些也需要在 next 的时候更新吧?

@pearmini
Copy link
Member Author

图例 title 的位置调整:从上面调整到左边
axis line 颜色的更新
连续图例的 UI 调整
字体大小的变化

这些也需要在 next 的时候更新吧?

这些都是弱变化,可以后面更新。同时这些点还需要进一步讨论。

@pearmini pearmini changed the title [WIP] feat: new theme and set padding to auto feat: new theme and set padding to auto Aug 25, 2023
@hustcc hustcc merged commit ffc8096 into v5 Aug 25, 2023
1 of 2 checks passed
@hustcc hustcc deleted the feat/new-theme branch August 25, 2023 06:16
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

Successfully merging this pull request may close these issues.

2 participants