Skip to content

Commit

Permalink
Added possibility to add custom classnames to canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
jbicker committed Dec 19, 2018
1 parent 3edcf06 commit 0293b8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions timeline-chart/src/layer/time-graph-axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion timeline-chart/src/time-graph-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface TimeGraphContainerOptions {
height: number
backgroundColor?: number
transparent?: boolean
classNames?: string
}

export class TimeGraphContainer {
Expand All @@ -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,
Expand Down

0 comments on commit 0293b8b

Please sign in to comment.