Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public dragStart(): void {
this.dragging = true;
this.dragMousePosition = { x: d3event.x, y: d3event.y };
this.dialogPosition = this.topLevel.getBoundingClientRect();
this.topLevel.style.transform = "";
this.topLevel.style.cursor = "move";
this.dragMove(); // put it in the right place; changing the transform may move it.
}
function drag(d, i){
let y = null;
let data = that.props.dragBarData;
if(i === 0){
if (d3Event.y >=0 && d3Event.y< data[1]){
y = d3Event.y;
} else if(d3Event.y >= data[1]){
y = data[1] - 1;
} else {
y = 0;
}
} else{
if (d3Event.y >data[0] && d3Event.y <= that.props.height - 2*r){
y = d3Event.y;
} else if(d3Event.y <= data[0]){
y = data[0] -1;
} else {
y = that.props.height - 2*r;
}
}
const dragBadge = () => {
subjectData.x =
event.x < -radius * 2
? "left"
: event.x > radius * 2 ? "right" : undefined
subjectData.y =
event.y < -radius * 2
? "top"
: event.y > radius * 2 ? "bottom" : undefined
type.redrawSubject()
}
.on('drag', (d, i) => {
this._dragging = true;
if (!isDragged) {
isDragged = true;
this._geometry.insertNode(
i + 1,
this._projectionUtility.svgPointToLatLng([event.x, event.y]));
this._updateLine();
if (this._options.showSegmentLength) {
this._updateSegmentText();
}
if (this._options.showAccumulativeLength) {
this._updateNodeText();
}
}
this._updateHoverCirclePosition(event.x, event.y);
this._updateLinePosition(this._linesBase, i + 1);
this._updateLinePosition(this._linesAux, i + 1);
if (this._options.showSegmentLength) {
this._updateSegmentTextPosition(i + 1);
}
if (this._options.showAccumulativeLength) {
this._updateNodeTextPosition(i + 1);
function dragged(d) {
d.fx = event.x;
d.fy = event.y;
}
.on('start', function() {
dragOrigin = {
x: d3_event.x,
y: d3_event.y
};
targetIndex = null;
})
.on('drag', function(d, index) {
function dragEnded(d) {
if (!event.active) {
simulation
.restart();
}
d.fx = event.x;
d.fy = event.y;
}
.on('drag', node => {
node.fx = d3event.x;
node.fy = d3event.y;
})
.on('end', node => {
.on('drag', d => {
if (event.isDrag && event.isDrag(d) || !event.isDrag) {
d.fx = d.x = d3_event.x;
d.fy = d.y = d3_event.y;
event.drag && event.drag(d);
}
})
.on('end', d => {