From 87d2372850b5b0c76bd8d1b09f06078b0a649865 Mon Sep 17 00:00:00 2001 From: tradingcage <143196169+tradingcage@users.noreply.github.com> Date: Fri, 22 Dec 2023 02:46:49 -0800 Subject: [PATCH] feat: Re-export zoom.scaleExtent and add translateExtent and add source event to zoom dispatcher * Re-export zoom.scaleExtent * add translateExtent and add source event to zoom dispatcher --------- Co-authored-by: Lincoln Bergeson --- packages/d3fc-zoom/src/zoom.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/d3fc-zoom/src/zoom.js b/packages/d3fc-zoom/src/zoom.js index 23dca0687..762fe0780 100644 --- a/packages/d3fc-zoom/src/zoom.js +++ b/packages/d3fc-zoom/src/zoom.js @@ -23,7 +23,8 @@ const symbol = Symbol('d3fc-domain-zoom'); export default () => { const dispatcher = dispatch('zoom'); - const zoomer = zoom().on('zoom', function({ transform }) { + const zoomer = zoom().on('zoom', function (e) { + const { transform } = e; const node = this; let updatedTransform = transform; let { @@ -68,7 +69,7 @@ export default () => { if (updatedTransform !== transform) { zoomer.transform(select(node), updatedTransform); } - dispatcher.call('zoom'); + dispatcher.call('zoom', this, e); }); const instance = (selection, xScale = null, yScale = null) => { @@ -115,7 +116,9 @@ export default () => { 'clickDistance', 'tapDistance', 'duration', - 'interpolate' + 'interpolate', + 'scaleExtent', + 'translateExtent' ); return instance;