Skip to content

LegendOptions event handlers should pass the item's boolean state #3897

@d13

Description

@d13

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions