From 0293b8bfb73147c47b95a5466e40b75d7a02584e Mon Sep 17 00:00:00 2001 From: jbicker Date: Wed, 19 Dec 2018 17:48:24 +0100 Subject: [PATCH] Added possibility to add custom classnames to canvas --- timeline-chart/src/layer/time-graph-axis.ts | 1 + timeline-chart/src/time-graph-container.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/timeline-chart/src/layer/time-graph-axis.ts b/timeline-chart/src/layer/time-graph-axis.ts index 246637b..cc121e5 100644 --- a/timeline-chart/src/layer/time-graph-axis.ts +++ b/timeline-chart/src/layer/time-graph-axis.ts @@ -41,6 +41,7 @@ export class TimeGraphAxis extends TimeGraphLayer { return false; }); this.onCanvasEvent('mousewheel', mw); + this.onCanvasEvent('wheel', mw); this.scaleComponent = new TimeGraphAxisScale( this.id + '_scale', this.getOptions(), diff --git a/timeline-chart/src/time-graph-container.ts b/timeline-chart/src/time-graph-container.ts index 2584f54..e64df59 100644 --- a/timeline-chart/src/time-graph-container.ts +++ b/timeline-chart/src/time-graph-container.ts @@ -9,6 +9,7 @@ export interface TimeGraphContainerOptions { height: number backgroundColor?: number transparent?: boolean + classNames?: string } export class TimeGraphContainer { @@ -32,7 +33,7 @@ export class TimeGraphContainer { canvas.width = config.width; canvas.height = config.height; canvas.id = config.id; - canvas.className = 'time-graph-canvas'; + canvas.className = `time-graph-canvas ${this.config.classNames || ''}`; const ratio = window.devicePixelRatio; const application = new PIXI.Application({ width: canvas.width,