Skip to content

Commit

Permalink
Build 3.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Jul 8, 2019
1 parent 6e8639b commit fda33c4
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 378 deletions.
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"build/cytoscape.umd.js": {
"bundled": 905843,
"minified": 334844,
"gzipped": 103924
"bundled": 906789,
"minified": 335087,
"gzipped": 103968
},
"build/cytoscape.cjs.js": {
"bundled": 834218,
"minified": 355594,
"gzipped": 106847
"bundled": 835136,
"minified": 355837,
"gzipped": 106891
},
"build/cytoscape.esm.js": {
"bundled": 834045,
"minified": 355451,
"gzipped": 106810,
"bundled": 834963,
"minified": 355694,
"gzipped": 106855,
"treeshaked": {
"rollup": {
"code": 329350,
"code": 329593,
"import_statements": 51
},
"webpack": {
"code": 331358
"code": 331601
}
}
}
Expand Down
258 changes: 136 additions & 122 deletions dist/cytoscape.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24539,6 +24539,7 @@ BRp$c.load = function () {


if (e.touches[1]) {
r.touchData.singleTouchMoved = true;
freeDraggedElements(r.dragData.touchDragEles);
var offsets = r.findContainerClientCoords();
offsetLeft = offsets[0];
Expand Down Expand Up @@ -24607,7 +24608,13 @@ BRp$c.load = function () {
}
}

if (e.touches[2]) ; else if (e.touches[1]) ; else if (e.touches[0]) {
if (e.touches[2]) {
// ignore
// safari on ios pans the page otherwise (normally you should be able to preventdefault on touchmove...)
if (cy.boxSelectionEnabled()) {
e.preventDefault();
}
} else if (e.touches[1]) ; else if (e.touches[0]) {
var nears = r.findNearestElements(now[0], now[1], true, true);
var near = nears[0];

Expand Down Expand Up @@ -24860,7 +24867,8 @@ BRp$c.load = function () {
}

r.touchData.selecting = true;
r.redrawHint('select', true);
r.touchData.didSelect = true;
select[4] = 1;

if (!select || select.length === 0 || select[0] === undefined) {
select[0] = (now[0] + now[2] + now[4]) / 3;
Expand All @@ -24872,10 +24880,10 @@ BRp$c.load = function () {
select[3] = (now[1] + now[3] + now[5]) / 3;
}

select[4] = 1;
r.touchData.selecting = true;
r.redrawHint('select', true);
r.redraw(); // pinch to zoom
} else if (capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) {
} else if (capture && e.touches[1] && !r.touchData.didSelect // don't allow box selection to degrade to pinch-to-zoom
&& cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) {
// two fingers => pinch to zoom
e.preventDefault();
r.data.bgActivePosistion = undefined;
Expand Down Expand Up @@ -24974,156 +24982,156 @@ BRp$c.load = function () {
now[4] = pos[0];
now[5] = pos[1];
}
} else if (e.touches[0]) {
var start = r.touchData.start;
var last = r.touchData.last;
var near;
} else if (e.touches[0] && !r.touchData.didSelect // don't allow box selection to degrade to single finger events like panning
) {
var start = r.touchData.start;
var last = r.touchData.last;
var near;

if (!r.hoverData.draggingEles && !r.swipePanning) {
near = r.findNearestElement(now[0], now[1], true, true);
}
if (!r.hoverData.draggingEles && !r.swipePanning) {
near = r.findNearestElement(now[0], now[1], true, true);
}

if (capture && start != null) {
e.preventDefault();
} // dragging nodes
if (capture && start != null) {
e.preventDefault();
} // dragging nodes


if (capture && start != null && r.nodeIsDraggable(start)) {
if (isOverThresholdDrag) {
// then dragging can happen
var draggedEles = r.dragData.touchDragEles;
var justStartedDrag = !r.dragData.didDrag;
if (capture && start != null && r.nodeIsDraggable(start)) {
if (isOverThresholdDrag) {
// then dragging can happen
var draggedEles = r.dragData.touchDragEles;
var justStartedDrag = !r.dragData.didDrag;

if (justStartedDrag) {
addNodesToDrag(draggedEles, {
inDragLayer: true
});
}
if (justStartedDrag) {
addNodesToDrag(draggedEles, {
inDragLayer: true
});
}

r.dragData.didDrag = true;
var totalShift = {
x: 0,
y: 0
};
r.dragData.didDrag = true;
var totalShift = {
x: 0,
y: 0
};

if (number(disp[0]) && number(disp[1])) {
totalShift.x += disp[0];
totalShift.y += disp[1];
if (number(disp[0]) && number(disp[1])) {
totalShift.x += disp[0];
totalShift.y += disp[1];

if (justStartedDrag) {
r.redrawHint('eles', true);
var dragDelta = r.touchData.dragDelta;
if (justStartedDrag) {
r.redrawHint('eles', true);
var dragDelta = r.touchData.dragDelta;

if (dragDelta && number(dragDelta[0]) && number(dragDelta[1])) {
totalShift.x += dragDelta[0];
totalShift.y += dragDelta[1];
if (dragDelta && number(dragDelta[0]) && number(dragDelta[1])) {
totalShift.x += dragDelta[0];
totalShift.y += dragDelta[1];
}
}
}
}

r.hoverData.draggingEles = true;
draggedEles.silentShift(totalShift).emit('position drag');
r.redrawHint('drag', true);

if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) {
r.redrawHint('eles', true);
}
r.hoverData.draggingEles = true;
draggedEles.silentShift(totalShift).emit('position drag');
r.redrawHint('drag', true);

r.redraw();
} else {
// otherise keep track of drag delta for later
var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || [];
if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) {
r.redrawHint('eles', true);
}

if (dragDelta.length === 0) {
dragDelta.push(disp[0]);
dragDelta.push(disp[1]);
r.redraw();
} else {
dragDelta[0] += disp[0];
dragDelta[1] += disp[1];
// otherise keep track of drag delta for later
var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || [];

if (dragDelta.length === 0) {
dragDelta.push(disp[0]);
dragDelta.push(disp[1]);
} else {
dragDelta[0] += disp[0];
dragDelta[1] += disp[1];
}
}
}
} // touchmove
} // touchmove


{
triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, {
x: now[0],
y: now[1]
});
{
triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, {
x: now[0],
y: now[1]
});

if ((!start || !start.grabbed()) && near != last) {
if (last) {
last.emit({
originalEvent: e,
type: 'tapdragout',
position: {
x: now[0],
y: now[1]
}
});
}
if ((!start || !start.grabbed()) && near != last) {
if (last) {
last.emit({
originalEvent: e,
type: 'tapdragout',
position: {
x: now[0],
y: now[1]
}
});
}

if (near) {
near.emit({
originalEvent: e,
type: 'tapdragover',
position: {
x: now[0],
y: now[1]
}
});
if (near) {
near.emit({
originalEvent: e,
type: 'tapdragover',
position: {
x: now[0],
y: now[1]
}
});
}
}
}

r.touchData.last = near;
} // check to cancel taphold
r.touchData.last = near;
} // check to cancel taphold

if (capture) {
for (var i = 0; i < now.length; i++) {
if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) {
r.touchData.singleTouchMoved = true;
if (capture) {
for (var i = 0; i < now.length; i++) {
if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) {
r.touchData.singleTouchMoved = true;
}
}
}
} // panning
} // panning


if (capture && (start == null || start.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) {
var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts);
if (capture && (start == null || start.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) {
var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts);

if (allowPassthrough) {
e.preventDefault();
if (allowPassthrough) {
e.preventDefault();

if (r.swipePanning) {
cy.panBy({
x: disp[0] * zoom,
y: disp[1] * zoom
});
} else if (isOverThresholdDrag) {
r.swipePanning = true;
cy.panBy({
x: dx * zoom,
y: dy * zoom
});
if (!r.data.bgActivePosistion) {
r.data.bgActivePosistion = array2point(r.touchData.startPosition);
}

if (start) {
start.unactivate();
if (r.swipePanning) {
cy.panBy({
x: disp[0] * zoom,
y: disp[1] * zoom
});
} else if (isOverThresholdDrag) {
r.swipePanning = true;
cy.panBy({
x: dx * zoom,
y: dy * zoom
});

if (!r.data.bgActivePosistion) {
r.data.bgActivePosistion = array2point(r.touchData.startPosition);
if (start) {
start.unactivate();
r.redrawHint('select', true);
r.touchData.start = null;
}

r.redrawHint('select', true);
r.touchData.start = null;
}
}
} // Re-project
} // Re-project


var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);
now[0] = pos[0];
now[1] = pos[1];
var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);
now[0] = pos[0];
now[1] = pos[1];
}
}
}

for (var j = 0; j < now.length; j++) {
earlier[j] = now[j];
Expand Down Expand Up @@ -25354,15 +25362,21 @@ BRp$c.load = function () {
earlier[j] = now[j];
}

r.dragData.didDrag = false; // reset for next mousedown
r.dragData.didDrag = false; // reset for next touchstart

if (e.touches.length === 0) {
r.touchData.dragDelta = [];
r.touchData.startPosition = null;
r.touchData.startGPosition = null;
r.touchData.didSelect = false;
}

if (e.touches.length < 2) {
if (e.touches.length === 1) {
// the old start global pos'n may not be the same finger that remains
r.touchData.startGPosition = [e.touches[0].clientX, e.touches[0].clientY];
}

r.pinching = false;
r.redrawHint('eles', true);
r.redraw();
Expand Down Expand Up @@ -30744,7 +30758,7 @@ sheetfn.appendToStyle = function (style) {
return style;
};

var version = "3.7.3";
var version = "3.7.4";

var cytoscape = function cytoscape(options) {
// if no options specified, use default
Expand Down
Loading

0 comments on commit fda33c4

Please sign in to comment.