diff --git a/src/components/grid.ts b/src/components/grid.ts index a9bdd49..6171618 100644 --- a/src/components/grid.ts +++ b/src/components/grid.ts @@ -78,7 +78,7 @@ export class Grid { .call( this._d3.axisLeft(this._svgElParams.yScale) .ticks(this.gridOptions.y.ticksCount) - .tickSize(-this._svgElParams) + .tickSize(-this._svgElParams.width) .tickFormat(() => '') ); } diff --git a/src/index.ts b/src/index.ts index d269a73..6672999 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,10 +194,19 @@ abstract class ChartwerkPod { this.updateSeries(series); this.updateOptions(options); if(shouldRerender) { - this.render(); + this.forceRerender(); } } + public forceRerender(): void { + // TODO: it is a hack. It is not nessesary to recreate svg. + // the only purpose for this action, to clear d3.zoom.transform (see https://gitlab.com/chartwerk/core/-/issues/10) + this.createSvg(); + this.initPodState(); + this.initComponents(); + this.render(); + } + protected updateOptions(newOptions: O): void { if(newOptions === undefined) { return;