in src/visual.ts [249:290]
private init(options: VisualConstructorOptions): void {
this.target = options.element;
this.size = DualKpiSize.small;
this.sizeCssClass = "small";
this.valueFormatter = d3.format(".3s");
this.axisNumberFormatter = d3.format(".2s");
this.commaNumberFormatter = d3.format(",");
this.timeFormatter = d3.timeFormat("%m/%d/%y");
this.dataBisector = d3.bisector((d: IDualKpiDataPoint) => { return d.date; }).left;
this.dispatch = d3.dispatch("onDualKpiMouseMove", "onDualKpiMouseOut");
this.localizationManager = options.host.createLocalizationManager();
this.colorPalette = options.host.colorPalette;
this.colorHelper = new ColorHelper(this.colorPalette);
this.host = options.host;
this.initContainer();
this.initMouseEvents();
this.tooltipServiceWrapper = new TooltipServiceWrapper(
{
tooltipService: this.host.tooltipService,
rootElement: options.element,
handleTouchDelay: 0
});
this.selectionManager = this.host.createSelectionManager();
const visualSelection = d3.select(this.target);
visualSelection.on("contextmenu", () => {
const mouseEvent: MouseEvent = d3.event as MouseEvent;
const eventTarget: EventTarget = mouseEvent.target;
let dataPoint: any = d3.select(<any>eventTarget).datum();
this.selectionManager.showContextMenu(dataPoint ? dataPoint.selectionId : {}, {
x: mouseEvent.clientX,
y: mouseEvent.clientY
});
mouseEvent.preventDefault();
});
}