Skip to content
Snippets Groups Projects
Commit 32b5f9f6 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Merge branch 'drag' into 'main'

add scaling factor for dragging

See merge request !33
parents 8cd673e6 56c0f260
No related branches found
Tags 2.6.1
1 merge request!33add scaling factor for dragging
Pipeline #486193 passed with warnings
......@@ -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;
......
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment