From 884fed6582b1c36f0e79cc725be5f36dc50ec127 Mon Sep 17 00:00:00 2001 From: glitch4347 Date: Fri, 15 Mar 2024 09:55:26 +0100 Subject: [PATCH] use events instead of eventsCallbacks --- examples/zoom_out.html | 2 +- package.json | 2 +- src/index.ts | 6 +++--- src/types.ts | 2 +- yarn.lock | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/zoom_out.html b/examples/zoom_out.html index 8c601fe..ff70add 100644 --- a/examples/zoom_out.html +++ b/examples/zoom_out.html @@ -20,7 +20,7 @@ zoom: { isActive: true, orientation: "horizontal" }, pan: { isActive: false }, }}, - eventsCallbacks: { + events: { zoomOut: function(centers, ranges) { console.log('zoomOut', centers, ranges); } diff --git a/package.json b/package.json index f20760b..13bcf53 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "author": "CorpGlory", "license": "ISC", "dependencies": { - "@chartwerk/core": "^0.6.21" + "@chartwerk/core": "^0.6.23" }, "devDependencies": { "copy-webpack-plugin": "^11.0.0", diff --git a/src/index.ts b/src/index.ts index 168b37a..5a26d95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -446,10 +446,10 @@ class LinePod extends ChartwerkPod { // TODO: refactor core not to take _options explicitly if( - this.options._options.eventsCallbacks !== undefined && - this.options._options.eventsCallbacks.zoomOut !== undefined + this.options._options.events !== undefined && + this.options._options.events.zoomOut !== undefined ) { - this.options._options.eventsCallbacks.zoomOut( + this.options._options.events.zoomOut( centers, [this.state.xValueRange, this.state.yValueRange] ); diff --git a/src/types.ts b/src/types.ts index d094767..5e172ea 100644 --- a/src/types.ts +++ b/src/types.ts @@ -12,7 +12,7 @@ type LineTimeSerieParams = { export type LineTimeSerie = Serie & Partial; export type LineOptions = Options & { - eventsCallbacks? : { + events? : { zoomOut?: (centers: { x: number; y: number; diff --git a/yarn.lock b/yarn.lock index 6cc5528..fd4c3b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,13 +5,13 @@ __metadata: version: 6 cacheKey: 8 -"@chartwerk/core@npm:^0.6.21": - version: 0.6.21 - resolution: "@chartwerk/core@npm:0.6.21" +"@chartwerk/core@npm:^0.6.23": + version: 0.6.23 + resolution: "@chartwerk/core@npm:0.6.23" dependencies: d3: ^5.16.0 lodash: ^4.17.21 - checksum: c536eca30241e775d4d4cfed4d54fd64c2f0299e792056166c90e50e11d9b698b1736b9c0dbf6ec6ea30fecd676f0012c774ff91a1d184eaee00c71b5d9e3925 + checksum: 629b0438e8cea02914e12956069d318caa98e6b3e2dd2514aab267474fa87e0aa92c190c4ca0fe95ca8091f83be1e1897801f5632c3f11d9cb3be39fa89cca84 languageName: node linkType: hard @@ -19,7 +19,7 @@ __metadata: version: 0.0.0-use.local resolution: "@chartwerk/line-pod@workspace:." dependencies: - "@chartwerk/core": ^0.6.21 + "@chartwerk/core": ^0.6.23 copy-webpack-plugin: ^11.0.0 css-loader: ^6.8.1 style-loader: ^3.3.3 -- 2.34.1