From 5d75ccb39f8e401a116eca23262c419ba4fc613d Mon Sep 17 00:00:00 2001 From: glitch4347 Date: Wed, 13 Mar 2024 09:58:18 +0100 Subject: [PATCH 1/3] zoomin protected method --- src/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4e75d45..5a309e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,6 +31,7 @@ import { palette } from './colors'; import * as d3 from 'd3'; import debounce from 'lodash/debounce'; +import { AxisRange } from './types'; const DEFAULT_TICK_SIZE = 2; @@ -798,8 +799,7 @@ abstract class ChartwerkPod { this.state.yValueRange = yRange; this.brushStartSelection = null; } - - this.options.callbackZoomIn([xRange, yRange]); + this.zoomIn([xRange, yRange]); } protected zoomOut(): void { @@ -812,6 +812,13 @@ abstract class ChartwerkPod { this.options.callbackZoomOut(centers); } + protected zoomIn(ranges: AxisRange[]): void { + if(ranges === undefined) { + return; + } + this.options.callbackZoomIn(ranges); + } + getAxisTicksFormatter(axisOptions: AxisOption): (d: any, i: number) => any { // TODO: ticksCount === 0 -> suspicious option if(axisOptions.ticksCount === 0) { -- 2.34.1 From 29c73517d6305ab3a5bab649b1cabf95abea4d07 Mon Sep 17 00:00:00 2001 From: glitch4347 Date: Wed, 13 Mar 2024 10:00:11 +0100 Subject: [PATCH 2/3] rm rnages undefined check --- src/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 5a309e7..b370392 100644 --- a/src/index.ts +++ b/src/index.ts @@ -813,9 +813,6 @@ abstract class ChartwerkPod { } protected zoomIn(ranges: AxisRange[]): void { - if(ranges === undefined) { - return; - } this.options.callbackZoomIn(ranges); } -- 2.34.1 From c1a2124d139108da2b9bae819e8e0fc583451411 Mon Sep 17 00:00:00 2001 From: glitch4347 Date: Wed, 13 Mar 2024 12:05:05 +0100 Subject: [PATCH 3/3] AxisRange to top --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b370392..5bd7be2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import { AxisRange } from './types'; import VueChartwerkPodMixin from './VueChartwerkPodMixin'; import { Grid } from './components/grid'; @@ -31,7 +32,7 @@ import { palette } from './colors'; import * as d3 from 'd3'; import debounce from 'lodash/debounce'; -import { AxisRange } from './types'; + const DEFAULT_TICK_SIZE = 2; -- 2.34.1