For example, using a stacked AreaChart, it would be nice if there was a way to set the highlighted points/configurations on a per-series basis (without needing to override the whole highlight snippet), simply via props.
Currently, the AreaChartgetHighlightProps function looks like this:
functiongetHighlightProps(s: SeriesData<TData,typeofArea>,i: number): ComponentProps<typeofHighlight>{if(!context)return{};constseriesTooltipData=s.data&&context.tooltip.data
? findRelatedData(s.data,context.tooltip.data,context.x)
: null;consthighlightPointsProps=typeofprops.highlight?.points==='object' ? props.highlight.points : null;return{data: seriesTooltipData,y: stackSeries ? (d)=>getStackData(s,d,i)[1] : (s.value??(s.data ? undefined : s.key)),lines: i==0,onPointClick: onPointClick
? (e,detail)=>onPointClick(e,{ ...detail,series: s})
: undefined,onPointEnter: ()=>(seriesState.highlightKey.current=s.key),onPointLeave: ()=>(seriesState.highlightKey.current=null),
...props.highlight,points:
props.highlight?.points==false
? false
: {
...highlightPointsProps,fill: s.color,class: cls('transition-opacity',seriesState.highlightKey.current&&seriesState.highlightKey.current!==s.key&&'opacity-10',highlightPointsProps?.class),},};}Perhaps we could add ...s.props.highlight and ...s.highlight.points into the mix here. This pattern would probably be useful across all the simplified component parts. I can take a shot at implementing this later this week/end!
An example use case for this would be something like having different sizes highlighted points for different series.
For example, using a stacked
AreaChart, it would be nice if there was a way to set the highlighted points/configurations on a per-series basis (without needing to override the whole highlight snippet), simply via props.Currently, the
AreaChartgetHighlightPropsfunction looks like this:Perhaps we could add
...s.props.highlightand...s.highlight.pointsinto the mix here. This pattern would probably be useful across all the simplified component parts. I can take a shot at implementing this later this week/end!An example use case for this would be something like having different sizes highlighted points for different series.