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(scale): add constant #4664

Merged
merged 1 commit into from
Feb 18, 2023
Merged

feat(scale): add constant #4664

merged 1 commit into from
Feb 18, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Feb 18, 2023

Constant

增加 constant 比例尺。

解决问题

当某一个通道的值为固定值的时候,比如:

const mark = {
  encode: {
    color: 'steelblue',
  }
}

这个通道对应的比例尺可以是 constant,也可以是 identity。区别在于 constant 比例尺的 range 会把这个值存下来,但是 identity 不会,这样就会出现下图中的问题:没有办法给图例加颜色。所以把非位置通道的常量通道设置成 constant 比例尺。

image

这个 PR 为解决 #4603 提到的一个问题提供了基础。@Aarebecca

@pearmini pearmini changed the title feat(scale): add constant [WIP] feat(scale): add constant Feb 18, 2023
@pearmini pearmini force-pushed the feat/constant-scale branch 2 times, most recently from e1b4ec1 to f3005a7 Compare February 18, 2023 04:49
@pearmini pearmini changed the title [WIP] feat(scale): add constant feat(scale): add constant Feb 18, 2023
@pearmini pearmini merged commit 0d53ae5 into v5 Feb 18, 2023
@pearmini pearmini deleted the feat/constant-scale branch February 18, 2023 14:24
Aarebecca pushed a commit that referenced this pull request Feb 20, 2023
hustcc pushed a commit that referenced this pull request May 16, 2023
hustcc pushed a commit that referenced this pull request May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants