Skip to content

Add EffectScatter chart support#102

Merged
PeiyangYu merged 2 commits into
masterfrom
feat/effect-scatter-series
May 14, 2026
Merged

Add EffectScatter chart support#102
PeiyangYu merged 2 commits into
masterfrom
feat/effect-scatter-series

Conversation

@PeiyangYu

@PeiyangYu PeiyangYu commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the effectScatter series — scatter points that pulse with a configurable ripple animation. Most common use: highlight hotspots on a map or any 2D plot.
  • Mirrors the existing Scatter structure (same CartesianCoordChart base, same coordinate-system mixins: cartesian / polar / geo / calendar / single).
  • Adds the chart-specific extras: RippleEffect (period, scale, brushType, color, number), plus showEffectOn ("render" / "emphasis") and effectType on the series.

Public API added

  • EffectScatter
  • charts.effectScatter.EffectScatterSeries, EffectScatterDataItem, EffectScatterEmphasis, RippleEffect
  • origin.chart.effectScatter.EffectScatterSeriesOption, EffectScatterStateOption, EffectScatterEmphasisOption, EffectScatterDataItemOption, RippleEffectOption

How to use

EffectScatter chart = new EffectScatter()
    .setTitle("Active hotspots")
    .addXAxis().addYAxis()
    .addSeries(new EffectScatterSeries()
        .setSymbolSize(20)
        .setShowEffectOn("render")
        .setRippleEffect(new RippleEffect().setScale(2.5).setBrushType("stroke"))
        .setData(new Number[][] { {10, 80}, {20, 50}, {30, 70}, {40, 30}, {50, 90} }));

String json = new EChartsSerializer().toJson(chart.getOption());

For a richer example with named data items, tooltip, and dark background, see src/test/java/org/icepear/echarts/demo/EffectScatterDemo.java — run mvn test -Dtest=EffectScatterDemo then open /tmp/effect-scatter-demo.html.

Tests added (22 new, all passing locally)

  • simple/effectScatter/BasicEffectScatterTest — snapshot test
  • charts/effectScatter/EffectScatterSeriesTest — 18 unit tests covering every setter overload (symbolSize/symbolOffset Number/String, all data-shape overloads), ripple nesting, null-omission semantics, axis-index/coord-system fields, emphasis flags
  • render/simple/RenderEffectScatterByChartTest — Engine smoke test (json + html paths)
  • demo/EffectScatterDemo — opt-in HTML writer for visual inspection

Test plan

  • mvn test -Dtest=BasicEffectScatterTest — 1/1 pass
  • mvn test -Dtest=EffectScatterSeriesTest — 18/18 pass
  • mvn test -Dtest=RenderEffectScatterByChartTest — 2/2 pass
  • mvn test -Dtest=EffectScatterDemo then open /tmp/effect-scatter-demo.html — pulses render correctly in browser
  • mvn test (full suite) — all 21 new default-suite tests pass; only the 3 pre-existing polar/float-precision failures remain on master
CleanShot.2026-05-10.at.20.05.47.mp4

Adds the effectScatter series (type: "effectScatter") — a scatter chart
where each data point pulses with a configurable ripple animation. The
canonical use case is highlighting hotspots on a map or any 2D plot.

The new public API:
- EffectScatter (top-level CartesianCoordChart wrapper)
- EffectScatterSeries, EffectScatterDataItem, EffectScatterEmphasis
- RippleEffect (period, scale, brushType, color, number)

Mirrors the existing Scatter structure so all coordinate systems work
(cartesian2d, polar, geo, calendar, single). Adds the effectScatter-
specific fields on top: rippleEffect, showEffectOn ("render"|"emphasis"),
effectType.

Tests (22 new, all passing):
- BasicEffectScatterTest (snapshot)
- EffectScatterSeriesTest (18 unit tests covering every setter overload,
  ripple nesting, null-omission, axis indices, geo/polar coord systems)
- RenderEffectScatterByChartTest (Engine smoke test)
- EffectScatterDemo (writes /tmp/effect-scatter-demo.html for visual
  inspection — opt-in via mvn test -Dtest=EffectScatterDemo)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@PeiyangYu PeiyangYu mentioned this pull request May 10, 2026
5 tasks
Adds scripts/config JSON definitions for the EffectScatter series
following the established pattern, so EffectScatterSeries, RippleEffect,
EffectScatterDataItem, EffectScatterEmphasis and the corresponding
origin interfaces are produced by scripts/config-to-java.py rather than
hand-written. Regenerated output matches the previous hand-written code;
only field/method order shifts to put inherited members ahead of own
members, matching what the generator emits for every other chart.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@PeiyangYu PeiyangYu merged commit b0c6c01 into master May 14, 2026
1 check passed
@PeiyangYu PeiyangYu mentioned this pull request May 14, 2026
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