constructor()

in src/visualComponent/rootComponent.ts [66:116]


    constructor(options: IVisualComponentConstructorOptions) {
        super();

        this.initElement(options.element, this.className);
        this.bindPrintEvents();

        this.constructorOptions = {
            ...options,
            element: this.element,
        };

        this.mainChartComponent = new MainChartComponent(this.constructorOptions);
        this.sparklineGroupComponent = new SparklineGroupComponent(this.constructorOptions);
        this.subtitleComponent = new SubtitleWarningComponent(this.constructorOptions);

        this.components = [
            this.mainChartComponent,
            this.sparklineGroupComponent,
            this.subtitleComponent,
        ];

        this.constructorOptions.eventDispatcher.on(
            `${EventName.onChartChangeClick}.${this.className}`,
            this.onChartChangeClickHandler.bind(this),
        );

        this.constructorOptions.eventDispatcher.on(
            `${EventName.onChartChangeHover}.${this.className}`,
            this.onChartChangeHoverHandler.bind(this),
        );

        this.constructorOptions.eventDispatcher.on(
            `${EventName.onChartChangeStop}.${this.className}`,
            this.clearHoverValues.bind(this),
        );

        this.element.on("mousemove", this.mousemoveHandler.bind(this));

        this.element.on(
            "mouseout",
            this.onChartViewReset.bind(this),
        );
        this.element.on(
            "mouseleave",
            this.onChartViewReset.bind(this),
        );
        this.element.on(
            "touchleave",
            this.onChartViewReset.bind(this),
        );
    }