feat(scatter): add --visualmap for 2D scatter gradient coloring#169
Merged
Conversation
Introduce opt-in --visualmap on vizb scatter (default off), separate from --3d-visualmap. Wires CLI/config, settings toggle, URL param scatter.vm, value-mode and grouped ECharts visualMap rendering, and transform support for off-chart z / metric as the color dimension.
ECharts tree-shaking requires VisualMapComponent to be registered before visualMap options take effect. ChartHeatmap and Chart3D already did this; ChartScatter did not, so --visualmap produced options with no visible gradient. Also map --visualmap onto 3D scatter coloring when auto-value enables continuous 3D, and use dimension 1 for grouped scatter values.
Drop the extra 12% grid right margin and delegate 2D visualMap config to create3DVisualMap so the gradient sits flush on the right like 3D charts.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
SettingsPanel.test.ts stubs .vue control imports because vitest runs without the Vue plugin. Add the missing VisualMapControl mock and a 2D scatter field-selection case.
Value-mode charts hide the legend but still reserved 15% grid top for legend space. Use a minimal 8px top band (same as heatmap) so 2D scatter gets a taller plot area.
Merge origin/main (PR #166: --symbol / --symbol-size for line and scatter) into feat/scatter-2d-visualmap, keeping both feature sets. - Scatter CLI/config/chart_spec now support visualmap and symbol flags - UI composables wire visualMap coloring alongside resolveSeriesSymbol - Regenerated pkg/template/vizb-ui.gen.go after merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds opt-in gradient coloring for 2D scatter charts via
--visualmap/visualMapconfig — separate from the existing--3d-visualmappath used by 3D charts.vizb scatter data.csv --visualmap(off by default; scatter-only)VisualMapControltoggle in settings (2D scatter only), URL paramscatter.vmvisualMapwhenthreeDVisualMapis falseChanges
--visualmapflag,ScatterConfig.visualMap,scatter:visualmapchart specresolve2DScatterVisualMap, sharedcreate3DVisualMaplayout, value/grouped scatter wiringVisualMapComponentinChartScatter.vue(tree-shaking)right: 0%, no extra grid padding)Example
Test plan
config/charts/scatter,cmd/charts/scatter,sharedchart_spec tests