Skip to content

Commit b746091

Browse files
authored
Expose zoomFunctions and panFunctions (#481)
1 parent ca62548 commit b746091

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/plugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Hammer from 'hammerjs';
22
import {addListeners, computeDragRect, removeListeners} from './handlers';
33
import {startHammer, stopHammer} from './hammer';
44
import {doPan, doZoom, resetZoom} from './core';
5+
import {panFunctions, zoomFunctions} from './scale.types';
56
import {getState, removeState} from './state';
67
import {version} from '../package.json';
78

@@ -83,5 +84,9 @@ export default {
8384
stopHammer(chart);
8485
}
8586
removeState(chart);
86-
}
87+
},
88+
89+
panFunctions,
90+
91+
zoomFunctions
8792
};

test/specs/module.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ describe('module', function() {
77
expect(window.ChartZoom.id).toBe('zoom');
88
});
99

10+
it ('should expose zoomFunctions and panFunctions', function() {
11+
expect(window.ChartZoom.zoomFunctions instanceof Object).toBe(true);
12+
expect(window.ChartZoom.panFunctions instanceof Object).toBe(true);
13+
});
14+
1015
it ('should be globally registered', function() {
1116
const plugin = Chart.registry.getPlugin('zoom');
1217
expect(plugin).toBe(window.ChartZoom);

0 commit comments

Comments
 (0)