Skip to content

Commit

Permalink
Preparing to publish 3.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Dec 5, 2017
1 parent a1c6b66 commit 933af57
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 79 deletions.
83 changes: 48 additions & 35 deletions dist/cytoscape.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4718,7 +4718,7 @@ module.exports = Stylesheet;
"use strict";


module.exports = "3.2.6";
module.exports = "3.2.7";

/***/ }),
/* 23 */
Expand Down Expand Up @@ -18472,24 +18472,26 @@ BRp.registerCalculationListeners = function () {
var elesToUpdate = cy.collection();
var r = this;

var enqueue = function enqueue(eles, e, dirtyStyleCaches) {
var enqueue = function enqueue(eles, e) {
var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

elesToUpdate.merge(eles);

if (dirtyStyleCaches === true || dirtyStyleCaches === undefined) {
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
var _p = ele._private;
var rstyle = _p.rstyle;
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
var _p = ele._private;
var rstyle = _p.rstyle;

if (dirtyStyleCaches) {
rstyle.clean = false;
_p.bbCache = null;
}

var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 };
var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 };

if (!evts[e.type]) {
evts[e.type] = true;
evts.length++;
}
if (!evts[e.type]) {
evts[e.type] = true;
evts.length++;
}
}
};
Expand Down Expand Up @@ -24005,7 +24007,7 @@ ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {

downscale();
} else {
self.queueElement(ele, bb, higherCache.level - 1);
self.queueElement(ele, higherCache.level - 1);

return higherCache;
}
Expand All @@ -24025,7 +24027,7 @@ ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {
if (scalableFrom(lowerCache)) {
// then use the lower quality cache for now and queue the better one for later

self.queueElement(ele, bb, lvl);
self.queueElement(ele, lvl);

return lowerCache;
}
Expand Down Expand Up @@ -24077,6 +24079,9 @@ ETCp.invalidateElement = function (ele) {
caches[lvl] = null;
util.removeFromArray(txr.eleCaches, cache);

// remove from queue since the old req was for the old state
self.removeFromQueue(ele);

// might have to remove the entire texture if it's not efficiently using its space
self.checkTextureUtility(txr);
}
Expand Down Expand Up @@ -24192,7 +24197,7 @@ ETCp.recycleTexture = function (txrH, minW) {
}
};

ETCp.queueElement = function (ele, bb, lvl) {
ETCp.queueElement = function (ele, lvl) {
var self = this;
var q = self.getElementQueue();
var id2q = self.getElementIdToQueue();
Expand All @@ -24208,19 +24213,10 @@ ETCp.queueElement = function (ele, bb, lvl) {
} else {
var req = {
ele: ele,
bb: bb,
position: math.copyPosition(ele.position()),
level: lvl,
reqs: 1
};

if (ele.isEdge()) {
req.positions = {
source: math.copyPosition(ele.source().position()),
target: math.copyPosition(ele.target().position())
};
}

q.push(req);

id2q[id] = req;
Expand All @@ -24236,21 +24232,21 @@ ETCp.dequeue = function (pxRatio /*, extent*/) {
for (var i = 0; i < maxDeqSize; i++) {
if (q.size() > 0) {
var req = q.pop();
var ele = req.ele;
var caches = ele._private.rscratch.imgCaches;

// dequeueing isn't necessary when an existing cache exists
if (caches[req.level] != null) {
continue;
}

id2q[req.ele.id()] = null;
id2q[ele.id()] = null;

dequeued.push(req);

var ele = req.ele;
var bb;

if (ele.isEdge() && (!math.arePositionsSame(ele.source().position(), req.positions.source) || !math.arePositionsSame(ele.target().position(), req.positions.target)) || !math.arePositionsSame(ele.position(), req.position)) {
bb = ele.boundingBox();
} else {
bb = req.bb;
}
var bb = ele.boundingBox();

self.getElement(req.ele, bb, pxRatio, req.level, getTxrReasons.dequeue);
self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue);
} else {
break;
}
Expand All @@ -24259,6 +24255,23 @@ ETCp.dequeue = function (pxRatio /*, extent*/) {
return dequeued;
};

ETCp.removeFromQueue = function (ele) {
var self = this;
var q = self.getElementQueue();
var id2q = self.getElementIdToQueue();
var req = id2q[ele.id()];

if (req != null) {
// bring to front of queue
req.reqs = util.MAX_INT;
q.updateItem(req);

q.pop(); // remove from queue

id2q[ele.id()] = null; // remove from lookup map
}
};

ETCp.onDequeue = function (fn) {
this.onDequeues.push(fn);
};
Expand All @@ -24284,7 +24297,7 @@ ETCp.setupDequeueing = defs.setupDequeueing({
},
shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) {
for (var i = 0; i < deqd.length; i++) {
var bb = deqd[i].bb;
var bb = deqd[i].ele.boundingBox();

if (math.boundingBoxesIntersect(bb, extent)) {
return true;
Expand Down
83 changes: 48 additions & 35 deletions dist/cytoscape.js
Original file line number Diff line number Diff line change
Expand Up @@ -4745,7 +4745,7 @@ module.exports = Stylesheet;
"use strict";


module.exports = "3.2.6";
module.exports = "3.2.7";

/***/ }),
/* 24 */
Expand Down Expand Up @@ -18499,24 +18499,26 @@ BRp.registerCalculationListeners = function () {
var elesToUpdate = cy.collection();
var r = this;

var enqueue = function enqueue(eles, e, dirtyStyleCaches) {
var enqueue = function enqueue(eles, e) {
var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

elesToUpdate.merge(eles);

if (dirtyStyleCaches === true || dirtyStyleCaches === undefined) {
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
var _p = ele._private;
var rstyle = _p.rstyle;
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
var _p = ele._private;
var rstyle = _p.rstyle;

if (dirtyStyleCaches) {
rstyle.clean = false;
_p.bbCache = null;
}

var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 };
var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 };

if (!evts[e.type]) {
evts[e.type] = true;
evts.length++;
}
if (!evts[e.type]) {
evts[e.type] = true;
evts.length++;
}
}
};
Expand Down Expand Up @@ -24032,7 +24034,7 @@ ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {

downscale();
} else {
self.queueElement(ele, bb, higherCache.level - 1);
self.queueElement(ele, higherCache.level - 1);

return higherCache;
}
Expand All @@ -24052,7 +24054,7 @@ ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {
if (scalableFrom(lowerCache)) {
// then use the lower quality cache for now and queue the better one for later

self.queueElement(ele, bb, lvl);
self.queueElement(ele, lvl);

return lowerCache;
}
Expand Down Expand Up @@ -24104,6 +24106,9 @@ ETCp.invalidateElement = function (ele) {
caches[lvl] = null;
util.removeFromArray(txr.eleCaches, cache);

// remove from queue since the old req was for the old state
self.removeFromQueue(ele);

// might have to remove the entire texture if it's not efficiently using its space
self.checkTextureUtility(txr);
}
Expand Down Expand Up @@ -24219,7 +24224,7 @@ ETCp.recycleTexture = function (txrH, minW) {
}
};

ETCp.queueElement = function (ele, bb, lvl) {
ETCp.queueElement = function (ele, lvl) {
var self = this;
var q = self.getElementQueue();
var id2q = self.getElementIdToQueue();
Expand All @@ -24235,19 +24240,10 @@ ETCp.queueElement = function (ele, bb, lvl) {
} else {
var req = {
ele: ele,
bb: bb,
position: math.copyPosition(ele.position()),
level: lvl,
reqs: 1
};

if (ele.isEdge()) {
req.positions = {
source: math.copyPosition(ele.source().position()),
target: math.copyPosition(ele.target().position())
};
}

q.push(req);

id2q[id] = req;
Expand All @@ -24263,21 +24259,21 @@ ETCp.dequeue = function (pxRatio /*, extent*/) {
for (var i = 0; i < maxDeqSize; i++) {
if (q.size() > 0) {
var req = q.pop();
var ele = req.ele;
var caches = ele._private.rscratch.imgCaches;

// dequeueing isn't necessary when an existing cache exists
if (caches[req.level] != null) {
continue;
}

id2q[req.ele.id()] = null;
id2q[ele.id()] = null;

dequeued.push(req);

var ele = req.ele;
var bb;

if (ele.isEdge() && (!math.arePositionsSame(ele.source().position(), req.positions.source) || !math.arePositionsSame(ele.target().position(), req.positions.target)) || !math.arePositionsSame(ele.position(), req.position)) {
bb = ele.boundingBox();
} else {
bb = req.bb;
}
var bb = ele.boundingBox();

self.getElement(req.ele, bb, pxRatio, req.level, getTxrReasons.dequeue);
self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue);
} else {
break;
}
Expand All @@ -24286,6 +24282,23 @@ ETCp.dequeue = function (pxRatio /*, extent*/) {
return dequeued;
};

ETCp.removeFromQueue = function (ele) {
var self = this;
var q = self.getElementQueue();
var id2q = self.getElementIdToQueue();
var req = id2q[ele.id()];

if (req != null) {
// bring to front of queue
req.reqs = util.MAX_INT;
q.updateItem(req);

q.pop(); // remove from queue

id2q[ele.id()] = null; // remove from lookup map
}
};

ETCp.onDequeue = function (fn) {
this.onDequeues.push(fn);
};
Expand All @@ -24311,7 +24324,7 @@ ETCp.setupDequeueing = defs.setupDequeueing({
},
shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) {
for (var i = 0; i < deqd.length; i++) {
var bb = deqd[i].bb;
var bb = deqd[i].ele.boundingBox();

if (math.boundingBoxesIntersect(bb, extent)) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions dist/cytoscape.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion documentation/docmaker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.2.6",
"version": "3.2.7",

"fnArgLinks": {
"selector": "#selectors",
Expand Down
4 changes: 2 additions & 2 deletions documentation/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions documentation/js/cytoscape.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cytoscape",
"version": "3.2.6",
"version": "3.2.7",
"license": "MIT",
"description": "Graph theory (a.k.a. network) library for analysis and visualisation",
"homepage": "http://js.cytoscape.org",
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = "3.2.6";
module.exports = "3.2.7";

0 comments on commit 933af57

Please sign in to comment.