cytoscape
Advanced tools
Comparing version 2.7.15 to 2.7.16
/*! | ||
Cytoscape.js 2.7.15 (MIT licensed) | ||
Cytoscape.js 2.7.16 (MIT licensed) | ||
@@ -6,0 +6,0 @@ Copyright (c) The Cytoscape Consortium |
{ | ||
"name": "cytoscape", | ||
"version": "2.7.15", | ||
"version": "2.7.16", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -368,61 +368,65 @@ 'use strict'; | ||
var res = {}; | ||
do { | ||
// Case: Vertical direction (up) | ||
if( 0 === dX && 0 < dY ){ | ||
res.x = X; | ||
// s += "\nUp direction"; | ||
res.y = Y + H / 2; | ||
break; | ||
} | ||
// Case: Vertical direction (down) | ||
if( 0 === dX && 0 > dY ){ | ||
res.x = X; | ||
res.y = Y + H / 2; | ||
// s += "\nDown direction"; | ||
break; | ||
} | ||
// Case: Vertical direction (up) | ||
if( 0 === dX && 0 < dY ){ | ||
res.x = X; | ||
// s += "\nUp direction"; | ||
res.y = Y + H / 2; | ||
// Case: Intersects the right border | ||
if( 0 < dX && | ||
-1 * nodeSlope <= dirSlope && | ||
dirSlope <= nodeSlope ){ | ||
res.x = X + W / 2; | ||
res.y = Y + (W * dY / 2 / dX); | ||
// s += "\nRightborder"; | ||
break; | ||
} | ||
return res; | ||
} | ||
// Case: Intersects the left border | ||
if( 0 > dX && | ||
-1 * nodeSlope <= dirSlope && | ||
dirSlope <= nodeSlope ){ | ||
res.x = X - W / 2; | ||
res.y = Y - (W * dY / 2 / dX); | ||
// s += "\nLeftborder"; | ||
break; | ||
} | ||
// Case: Vertical direction (down) | ||
if( 0 === dX && 0 > dY ){ | ||
res.x = X; | ||
res.y = Y + H / 2; | ||
// s += "\nDown direction"; | ||
// Case: Intersects the top border | ||
if( 0 < dY && | ||
( dirSlope <= -1 * nodeSlope || | ||
dirSlope >= nodeSlope ) ){ | ||
res.x = X + (H * dX / 2 / dY); | ||
res.y = Y + H / 2; | ||
// s += "\nTop border"; | ||
break; | ||
} | ||
return res; | ||
} | ||
// Case: Intersects the bottom border | ||
if( 0 > dY && | ||
( dirSlope <= -1 * nodeSlope || | ||
dirSlope >= nodeSlope ) ){ | ||
res.x = X - (H * dX / 2 / dY); | ||
res.y = Y - H / 2; | ||
// s += "\nBottom border"; | ||
break; | ||
} | ||
// Case: Intersects the right border | ||
if( 0 < dX && | ||
-1 * nodeSlope <= dirSlope && | ||
dirSlope <= nodeSlope ){ | ||
res.x = X + W / 2; | ||
res.y = Y + (W * dY / 2 / dX); | ||
// s += "\nRightborder"; | ||
} while( false); | ||
return res; | ||
} | ||
// Case: Intersects the left border | ||
if( 0 > dX && | ||
-1 * nodeSlope <= dirSlope && | ||
dirSlope <= nodeSlope ){ | ||
res.x = X - W / 2; | ||
res.y = Y - (W * dY / 2 / dX); | ||
// s += "\nLeftborder"; | ||
return res; | ||
} | ||
// Case: Intersects the top border | ||
if( 0 < dY && | ||
( dirSlope <= -1 * nodeSlope || | ||
dirSlope >= nodeSlope ) ){ | ||
res.x = X + (H * dX / 2 / dY); | ||
res.y = Y + H / 2; | ||
// s += "\nTop border"; | ||
return res; | ||
} | ||
// Case: Intersects the bottom border | ||
if( 0 > dY && | ||
( dirSlope <= -1 * nodeSlope || | ||
dirSlope >= nodeSlope ) ){ | ||
res.x = X - (H * dX / 2 / dY); | ||
res.y = Y - H / 2; | ||
// s += "\nBottom border"; | ||
return res; | ||
} | ||
// s += "\nClipping point found at " + res.x + ", " + res.y; | ||
@@ -429,0 +433,0 @@ // logDebug(s); |
@@ -1355,2 +1355,6 @@ 'use strict'; | ||
var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; | ||
var edgeDistances = edge.pstyle('edge-distances').value; | ||
var segmentWs = edge.pstyle( 'segment-weights' ); | ||
var segmentDs = edge.pstyle( 'segment-distances' ); | ||
var segmentsN = Math.min( segmentWs.pfValue.length, segmentDs.pfValue.length ); | ||
@@ -1375,7 +1379,23 @@ var srcX1 = rs.lastSrcCtlPtX; | ||
var width1 = rs.lastW; | ||
var width2 = edge.pstyle( 'control-point-step-size' ).pfValue; | ||
var curveStyle1 = rs.lastCurveStyle; | ||
var curveStyle2 = curveStyle; | ||
var edgeDistances = edge.pstyle('edge-distances').value; | ||
var ctrlptDists1 = rs.lastCtrlptDists; | ||
var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; | ||
var ctrlptWs1 = rs.lastCtrlptWs; | ||
var ctrlptWs2 = ctrlptWs.strValue; | ||
var segmentWs1 = rs.lastSegmentWs; | ||
var segmentWs2 = segmentWs.strValue; | ||
var segmentDs1 = rs.lastSegmentDs; | ||
var segmentDs2 = segmentDs.strValue; | ||
var stepSize1 = rs.lastStepSize; | ||
var stepSize2 = stepSize; | ||
var edgeDistances1 = rs.lastEdgeDistances; | ||
var edgeDistances2 = edgeDistances; | ||
if( badBezier ){ | ||
@@ -1389,5 +1409,10 @@ rs.badBezier = true; | ||
&& tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 | ||
&& width1 === width2 | ||
&& curveStyle1 === curveStyle2 | ||
&& ctrlptDists1 === ctrlptDists2 | ||
&& ctrlptWs1 === ctrlptWs2 | ||
&& segmentWs1 === segmentWs2 | ||
&& segmentDs1 === segmentDs2 | ||
&& stepSize1 === stepSize2 | ||
&& edgeDistances1 === edgeDistances2 | ||
&& ((edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2) || edgeIsUnbundled) ){ | ||
// console.log('edge ctrl pt cache HIT') | ||
continue; // then the control points haven't changed and we can skip calculating them | ||
@@ -1405,4 +1430,9 @@ } else { | ||
rs.lastNumEdges = numEdges2; | ||
rs.lastWidth = width2; | ||
// console.log('edge ctrl pt cache MISS') | ||
rs.lastCurveStyle = curveStyle2; | ||
rs.lastCtrlptDists = ctrlptDists2; | ||
rs.lastCtrlptWs = ctrlptWs2; | ||
rs.lastSegmentDs = segmentDs2; | ||
rs.lastSegmentWs = segmentWs2; | ||
rs.lastStepSize = stepSize2; | ||
rs.lastEdgeDistances = edgeDistances2; | ||
} | ||
@@ -1488,9 +1518,5 @@ | ||
var segmentWs = edge.pstyle( 'segment-weights' ).pfValue; | ||
var segmentDs = edge.pstyle( 'segment-distances' ).pfValue; | ||
var segmentsN = Math.min( segmentWs.length, segmentDs.length ); | ||
for( var s = 0; s < segmentsN; s++ ){ | ||
var w = segmentWs[ s ]; | ||
var d = segmentDs[ s ]; | ||
var w = segmentWs.pfValue[ s ]; | ||
var d = segmentDs.pfValue[ s ]; | ||
@@ -1497,0 +1523,0 @@ var w1 = 1 - w; |
@@ -137,27 +137,19 @@ 'use strict'; | ||
for( var i = 0; i < r.CANVAS_LAYERS; i++ ){ | ||
canvas = data.canvases[ i ]; | ||
if( canvas.width !== canvasWidth || canvas.height !== canvasHeight ){ | ||
canvas.width = canvasWidth; | ||
canvas.height = canvasHeight; | ||
canvas.width = canvasWidth; | ||
canvas.height = canvasHeight; | ||
canvas.style.width = width + 'px'; | ||
canvas.style.height = height + 'px'; | ||
} | ||
canvas.style.width = width + 'px'; | ||
canvas.style.height = height + 'px'; | ||
} | ||
for( var i = 0; i < r.BUFFER_COUNT; i++ ){ | ||
canvas = data.bufferCanvases[ i ]; | ||
if( canvas.width !== canvasWidth || canvas.height !== canvasHeight ){ | ||
canvas.width = canvasWidth; | ||
canvas.height = canvasHeight; | ||
canvas.width = canvasWidth; | ||
canvas.height = canvasHeight; | ||
canvas.style.width = width + 'px'; | ||
canvas.style.height = height + 'px'; | ||
} | ||
canvas.style.width = width + 'px'; | ||
canvas.style.height = height + 'px'; | ||
} | ||
@@ -164,0 +156,0 @@ |
@@ -84,3 +84,3 @@ 'use strict'; | ||
boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) | ||
string: '"(?:\\\\"|[^"])+"' + '|' + "'(?:\\\\'|[^'])+'", // string literals (used in data selectors) -- doublequotes | singlequotes | ||
string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes | ||
number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 | ||
@@ -87,0 +87,0 @@ meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) |
@@ -1,1 +0,1 @@ | ||
module.exports = "2.7.15"; | ||
module.exports = "2.7.16"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4324741
43738