fix(slider): index scale by scaleKey #5291
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Slider
加入 text annotation 的时候,slider 失效。
问题原因
之前是通过 channel name 去索引 scale 的。这存在一个问题:当一个 channel 有多个 scale 的时候,后面的 scale 会覆盖前面的 scale。
point x 和 y 通道的 Linear scale 被 text 的 Identity scale 覆盖了。
解决办法
通过 scaleKey 去索引 scale。如果没有显示的指定 scaleKey,将
${channelName}${maxIndex}
作为该 scale 的 key。这样存储 scale 之后应该可以解决 #5242 提到的问题。
效果