Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghsc/nshmp/disagg-d3
1 result
Show changes
Commits on Source (2)
......@@ -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;
}