|
@ -82,13 +82,15 @@ Graph3d.DEFAULTS = { |
|
|
line : { |
|
|
line : { |
|
|
height : '40px', |
|
|
height : '40px', |
|
|
width : '0', |
|
|
width : '0', |
|
|
borderLeft : '1px solid #4d4d4d' |
|
|
|
|
|
|
|
|
borderLeft : '1px solid #4d4d4d', |
|
|
|
|
|
pointerEvents : 'none' |
|
|
}, |
|
|
}, |
|
|
dot : { |
|
|
dot : { |
|
|
height : '0', |
|
|
height : '0', |
|
|
width : '0', |
|
|
width : '0', |
|
|
border : '5px solid #4d4d4d', |
|
|
border : '5px solid #4d4d4d', |
|
|
borderRadius : '5px' |
|
|
|
|
|
|
|
|
borderRadius : '5px', |
|
|
|
|
|
pointerEvents : 'none' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -103,6 +105,9 @@ Graph3d.DEFAULTS = { |
|
|
vertical : 0.5, |
|
|
vertical : 0.5, |
|
|
distance : 1.7 |
|
|
distance : 1.7 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
zoomable : true, |
|
|
|
|
|
ctrlToZoom: false, |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
The following fields are 'auto by default', see above. |
|
|
The following fields are 'auto by default', see above. |
|
@ -2093,38 +2098,40 @@ Graph3d.prototype._onTouchEnd = function(event) { |
|
|
Graph3d.prototype._onWheel = function(event) { |
|
|
Graph3d.prototype._onWheel = function(event) { |
|
|
if (!event) /* For IE. */ |
|
|
if (!event) /* For IE. */ |
|
|
event = window.event; |
|
|
event = window.event; |
|
|
|
|
|
if (this.zoomable && (!this.ctrlToZoom || event.ctrlKey)) { |
|
|
|
|
|
|
|
|
|
|
|
// retrieve delta
|
|
|
|
|
|
var delta = 0; |
|
|
|
|
|
if (event.wheelDelta) { /* IE/Opera. */ |
|
|
|
|
|
delta = event.wheelDelta/120; |
|
|
|
|
|
} else if (event.detail) { /* Mozilla case. */ |
|
|
|
|
|
// In Mozilla, sign of delta is different than in IE.
|
|
|
|
|
|
// Also, delta is multiple of 3.
|
|
|
|
|
|
delta = -event.detail/3; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// retrieve delta
|
|
|
|
|
|
var delta = 0; |
|
|
|
|
|
if (event.wheelDelta) { /* IE/Opera. */ |
|
|
|
|
|
delta = event.wheelDelta/120; |
|
|
|
|
|
} else if (event.detail) { /* Mozilla case. */ |
|
|
|
|
|
// In Mozilla, sign of delta is different than in IE.
|
|
|
|
|
|
// Also, delta is multiple of 3.
|
|
|
|
|
|
delta = -event.detail/3; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If delta is nonzero, handle it.
|
|
|
|
|
|
// Basically, delta is now positive if wheel was scrolled up,
|
|
|
|
|
|
// and negative, if wheel was scrolled down.
|
|
|
|
|
|
if (delta) { |
|
|
|
|
|
var oldLength = this.camera.getArmLength(); |
|
|
|
|
|
var newLength = oldLength * (1 - delta / 10); |
|
|
|
|
|
|
|
|
// If delta is nonzero, handle it.
|
|
|
|
|
|
// Basically, delta is now positive if wheel was scrolled up,
|
|
|
|
|
|
// and negative, if wheel was scrolled down.
|
|
|
|
|
|
if (delta) { |
|
|
|
|
|
var oldLength = this.camera.getArmLength(); |
|
|
|
|
|
var newLength = oldLength * (1 - delta / 10); |
|
|
|
|
|
|
|
|
this.camera.setArmLength(newLength); |
|
|
|
|
|
this.redraw(); |
|
|
|
|
|
|
|
|
this.camera.setArmLength(newLength); |
|
|
|
|
|
this.redraw(); |
|
|
|
|
|
|
|
|
this._hideTooltip(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this._hideTooltip(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// fire a cameraPositionChange event
|
|
|
|
|
|
var parameters = this.getCameraPosition(); |
|
|
|
|
|
this.emit('cameraPositionChange', parameters); |
|
|
|
|
|
|
|
|
// fire a cameraPositionChange event
|
|
|
|
|
|
var parameters = this.getCameraPosition(); |
|
|
|
|
|
this.emit('cameraPositionChange', parameters); |
|
|
|
|
|
|
|
|
// Prevent default actions caused by mouse wheel.
|
|
|
|
|
|
// That might be ugly, but we handle scrolls somehow
|
|
|
|
|
|
// anyway, so don't bother here..
|
|
|
|
|
|
util.preventDefault(event); |
|
|
|
|
|
|
|
|
// Prevent default actions caused by mouse wheel.
|
|
|
|
|
|
// That might be ugly, but we handle scrolls somehow
|
|
|
|
|
|
// anyway, so don't bother here..
|
|
|
|
|
|
util.preventDefault(event); |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|