Closed borntofrappe closed 1 year ago
Create a component function to annotate a visualization with a legend.
As with previous component-based projects the function should add SVG elements on the current selection with the call method, group.call(legend).
call
group.call(legend)
From the component dispatch an event with d3.dispatch, for instance to highlight the visuals with the matching color.
d3.dispatch
Small visualization with a side legend.
Highlight label and matching path element on hover.
The challenge is to repurpose the code for the legend into a component function.
Create a component function to annotate a visualization with a legend.
As with previous component-based projects the function should add SVG elements on the current selection with the
call
method,group.call(legend)
.From the component dispatch an event with
d3.dispatch
, for instance to highlight the visuals with the matching color.