If we want to hook events on the legend items, the interaction functionality becomes are disabled and we would have to manually keep state for each item's visibility in our code. Since billboard maintains this state, it would be much simpler if billboard just passed that state with each event callback:
/**
* Set click event handler to the legend item.
* - **NOTE:**
* - When set, default `click` interaction will be disabled.
* - When `interaction.dblclick=true` is set, will be called on double click.
*/
onclick?(this: Chart, id: string, visible: boolean): void;
/**
* Set mouseover event handler to the legend item.
* - **NOTE:** When set, default `mouseover` interaction will be disabled.
*/
onover?(this: Chart, id: string, visible: boolean): void;
/**
* Set mouseout event handler to the legend item.
* - **NOTE:** When set, default `mouseout` interaction will be disabled.
*/
onout?(this: Chart, id: string, visible: boolean): void;
If we want to hook events on the legend items, the interaction functionality becomes are disabled and we would have to manually keep state for each item's visibility in our code. Since billboard maintains this state, it would be much simpler if billboard just passed that state with each event callback: