public bindEvents()

in src/behavior.ts [70:98]


    public bindEvents(
        options: BehaviorOptions,
        selectionHandler: ISelectionHandler
    ): void {
        this.options = options;

        const {
            selection,
            clearCatcher,
            onSelect
        } = options;

        selection.on("click", (event:MouseEvent, d:HierarchyRectangularNode<SunburstDataPoint>) => {
            selectionHandler.handleSelection(d.data, event.ctrlKey);
            event.stopPropagation();

            if (onSelect) {
                onSelect(d.data);
            }

        });
        clearCatcher.on("click", () => {
            selectionHandler.handleClearSelection();

            if (onSelect) {
                onSelect(null);
            }
        });
    }