rusackas opened a new pull request, #40967:
URL: https://github.com/apache/superset/pull/40967

   ### SUMMARY
   Adds two long-requested capabilities to the ECharts Scatter chart 
(`echarts_timeseries_scatter`):
   
   **1. Chart orientation (categorical y-axis support)**
   A new Vertical/Horizontal orientation control, reusing the shared Timeseries 
horizontal-orientation plumbing that the Bar chart already uses. Horizontal 
orientation places the dimension (x-axis column) on the y-axis and the metric 
on the x-axis — so a categorical (or temporal/numeric) y-axis is one click 
away, and combined with the existing "Force categorical" control even numeric 
columns can be treated as categories. Axis controls (formats, label rotation, 
log axis, bounds, titles) swap between the X Axis and Y Axis panel sections 
based on orientation, mirroring the Bar chart's control panel behavior.
   
   **2. Dot size metric with area-based scaling**
   An optional "Dot size metric" control in the Query section, plus "Minimum 
dot size" / "Maximum dot size" sliders (defaults 5/30) that appear when the 
metric is set. Design notes:
   - The size metric flows into the query through the existing `size → metrics` 
query-field alias, so no `buildQuery` change was needed; it is deduped when it 
matches a value metric (in which case each point's own value doubles as its 
size value).
   - The size metric's series are excluded from rendering and the legend; their 
values feed per-point `symbolSize` callbacks, matched to value series by 
dimension key for grouped charts.
   - Scaling is **area-based** (`getAreaScaledSymbolSize` in 
`utils/series.ts`): marker *area* scales linearly with the metric between the 
configured bounds, i.e. radius ∝ √value. This avoids the perceptual 
exaggeration of diameter-linear scaling (where a 2× value reads as a 4× area) — 
notably the existing Bubble chart scales linearly on radius.
   - Points lacking a size value (e.g. nulls, time-shift series) fall back to 
the fixed marker size.
   
   Both features compose (horizontal orientation + sized dots) and are covered 
by unit tests.
   
   Possible follow-ups (intentionally out of scope): showing the size value in 
the tooltip, and adopting area-based scaling in the Bubble chart.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: the Scatter chart only offered a fixed marker-size slider and a 
vertical layout.
   After: orientation radio control under "Chart Orientation", "Dot size 
metric" in the Query section, and min/max dot size sliders under Chart Options.
   
   ### TESTING INSTRUCTIONS
   1. Create a Scatter Plot chart with a categorical X-axis column and a metric.
   2. In **Customize → Chart Orientation** (Data tab → "Chart Orientation" 
section), switch to **Horizontal** — the categories move to the y-axis and the 
metric to the x-axis; axis format/title controls follow their axes.
   3. Back in the Query section, set a **Dot size metric** (e.g. `COUNT(*)`); 
dots resize so their areas are proportional to the metric, scaled between the 
**Minimum/Maximum dot size** sliders that appear under Chart Options.
   4. Add a "Dimensions" (group by) column and confirm each series' dots size 
independently against a shared global scale.
   5. Unit tests: `npx jest plugins/plugin-chart-echarts/test/Timeseries 
plugins/plugin-chart-echarts/test/utils/series.test.ts`
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to