Skip to content
Source
Sign inSign up
TanStack/charts

Support `states` on polar marks (`radialArc`, `radialArea`, `radialDot`) and `geoShape` #126

Closedtoomingos(GitHub profile, opens in a new tab) opened this issue 1 comment

Version: @tanstack/charts 0.16.0.

Cartesian marks accept states (when: { focus } + style + transition) so a focused or unmatched datum can change fillOpacity, stroke, r, etc. natively. The polar marks and geoShape do not declare states in their option types (RadialArcOptions, RadialAreaOptions, RadialDotOptions, PolarOptions, GeoShapeOptions), although the scene layer already resolves states for any initialized mark that carries the field: a wrapper that sets states: { data, definitions } on initialize works in 0.15.0 and 0.16.0.

Without it, legend hover dim and focus lift on pie, donut, gauge, radar and choropleth have to be baked into the colour channel (color-mix alpha per datum), which loses the transition and cannot dim url(#…) pattern paints at all.

Would it be possible to expose states on RadialArcOptions, RadialAreaOptions, RadialDotOptions, PolarOptions and GeoShapeOptions, using the same ChartMarkState type the Cartesian marks take? Hover dim from a legend or focus is a standard affordance in Recharts, ECharts and Nivo for pie, radar and map series.

  1. Closing as done in 1.1.0 (57774e1): polar and geographic marks accept states.

    The remaining part, angle and radius keys in arc state styles, is tracked in #213.

Sign in to join this conversation.