diff --git a/src/disagg/DisaggGraphView.js b/src/disagg/DisaggGraphView.js index afea7632dff9938731b6e6f7f20533b48957e24c..07f6dbd9e31d5eb3d47cb03a546cd554e3fa23da 100644 --- a/src/disagg/DisaggGraphView.js +++ b/src/disagg/DisaggGraphView.js @@ -15,6 +15,8 @@ var _DEFAULTS; _DEFAULTS = { allowDrag: true, + dragXScale: 3.5, + dragZScale: 3.0 }; var __calculateBounds; @@ -153,8 +155,8 @@ var DisaggGraphView = function (options) { }) .on('mousemove', event => { if (dragging) { - var dx = event.clientX - origin.x; - var dz = event.clientY - origin.y; + var dx = (event.clientX - origin.x) * options.dragXScale; + var dz = (event.clientY - origin.y) * options.dragZScale; var [x, y ,z] = _this.d33d.model.get('origin'); _this.setOrigin(x - dx, y, z + dz) origin.x = event.clientX; diff --git a/types/disagg/DisaggGraphViewOptions.d.ts b/types/disagg/DisaggGraphViewOptions.d.ts index 3d9e2364c78985730f1103b9ddff4972d2e2aca5..e4981951956333bc7f1345c019017f912d608fcb 100644 --- a/types/disagg/DisaggGraphViewOptions.d.ts +++ b/types/disagg/DisaggGraphViewOptions.d.ts @@ -3,6 +3,12 @@ import {Disaggregation} from './Disaggregation'; export interface DisaggGraphViewOptions extends SelectedCollectionViewOptions<Disaggregation> { + /** + * Collection with data to display. + * Selected Disaggregation object is displayed. + */ + collection: Collection<Disaggregation>; + /** * Whether to allow drag and rotate of graph. */ @@ -14,9 +20,9 @@ export interface DisaggGraphViewOptions */ bounds?: number[][]; - /** - * Collection with data to display. - * Selected Disaggregation object is displayed. - */ - collection: Collection<Disaggregation>; + /** Scale factor for mouse movement to plot movement in X axis of plot */ + dragXScale?: number; + + /** Scale factor for mouse movement to plot movement in Z axis of plot */ + dragZScale?: number; }