code
stringlengths 24
2.07M
| docstring
stringlengths 25
85.3k
| func_name
stringlengths 1
92
| language
stringclasses 1
value | repo
stringlengths 5
64
| path
stringlengths 4
172
| url
stringlengths 44
218
| license
stringclasses 7
values |
---|---|---|---|---|---|---|---|
updateDragDelta = function updateDragDelta() {
var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || [];
if (dragDelta.length === 0) {
dragDelta.push(disp[0]);
dragDelta.push(disp[1]);
} else {
dragDelta[0] += disp[0];
dragDelta[1] += disp[1];
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
updateDragDelta
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
goIntoBoxMode = function goIntoBoxMode() {
r.data.bgActivePosistion = undefined;
if (!r.hoverData.selecting) {
cy.emit({
originalEvent: e,
type: 'boxstart',
position: {
x: pos[0],
y: pos[1]
}
});
}
select[4] = 1;
r.hoverData.selecting = true;
r.redrawHint('select', true);
r.redraw();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
goIntoBoxMode
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
eleWouldBeSelected = function eleWouldBeSelected(ele) {
return ele.selectable() && !ele.selected();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
eleWouldBeSelected
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
wheelHandler = function wheelHandler(e) {
if (r.scrollingPage) {
return;
} // while scrolling, ignore wheel-to-zoom
var cy = r.cy;
var zoom = cy.zoom();
var pan = cy.pan();
var pos = r.projectIntoViewport(e.clientX, e.clientY);
var rpos = [pos[0] * zoom + pan.x, pos[1] * zoom + pan.y];
if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) {
// if pan dragging or cxt dragging, wheel movements make no zoom
e.preventDefault();
return;
}
if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) {
e.preventDefault();
r.data.wheelZooming = true;
clearTimeout(r.data.wheelTimeout);
r.data.wheelTimeout = setTimeout(function () {
r.data.wheelZooming = false;
r.redrawHint('eles', true);
r.redraw();
}, 150);
var diff;
if (e.deltaY != null) {
diff = e.deltaY / -250;
} else if (e.wheelDeltaY != null) {
diff = e.wheelDeltaY / 1000;
} else {
diff = e.wheelDelta / 1000;
}
diff = diff * r.wheelSensitivity;
var needsWheelFix = e.deltaMode === 1;
if (needsWheelFix) {
// fixes slow wheel events on ff/linux and ff/windows
diff *= 33;
}
var newZoom = cy.zoom() * Math.pow(10, diff);
if (e.type === 'gesturechange') {
newZoom = r.gestureStartZoom * e.scale;
}
cy.zoom({
level: newZoom,
renderedPosition: {
x: rpos[0],
y: rpos[1]
}
});
cy.emit(e.type === 'gesturechange' ? 'pinchzoom' : 'scrollzoom');
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
wheelHandler
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
distance = function distance(x1, y1, x2, y2) {
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
distance
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
distanceSq = function distanceSq(x1, y1, x2, y2) {
return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
distanceSq
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
makeEvent = function makeEvent(type) {
return {
originalEvent: e,
type: type,
position: {
x: now[0],
y: now[1]
}
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
makeEvent
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
eleWouldBeSelected = function eleWouldBeSelected(ele) {
return ele.selectable() && !ele.selected();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
eleWouldBeSelected
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
makeTouch = function makeTouch(e) {
return {
clientX: e.clientX,
clientY: e.clientY,
force: 1,
identifier: e.pointerId,
pageX: e.pageX,
pageY: e.pageY,
radiusX: e.width / 2,
radiusY: e.height / 2,
screenX: e.screenX,
screenY: e.screenY,
target: e.target
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
makeTouch
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
makePointer = function makePointer(e) {
return {
event: e,
touch: makeTouch(e)
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
makePointer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
removePointer = function removePointer(e) {
for (var i = 0; i < pointers.length; i++) {
var p = pointers[i];
if (p.event.pointerId === e.pointerId) {
pointers.splice(i, 1);
return;
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
removePointer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
updatePointer = function updatePointer(e) {
var p = pointers.filter(function (p) {
return p.event.pointerId === e.pointerId;
})[0];
p.event = e;
p.touch = makeTouch(e);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
updatePointer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
addTouchesToEvent = function addTouchesToEvent(e) {
e.touches = pointers.map(function (p) {
return p.touch;
});
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
addTouchesToEvent
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
pointerIsMouse = function pointerIsMouse(e) {
return e.pointerType === 'mouse' || e.pointerType === 4;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
pointerIsMouse
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) {
// approximate curve pts based on the two t values
var m0 = qbezierPtAt({
x: pts[0],
y: pts[1]
}, {
x: pts[2],
y: pts[3]
}, {
x: pts[4],
y: pts[5]
}, t0);
var m1 = qbezierPtAt({
x: pts[0],
y: pts[1]
}, {
x: pts[2],
y: pts[3]
}, {
x: pts[4],
y: pts[5]
}, t1);
var m2 = qbezierPtAt({
x: pts[0],
y: pts[1]
}, {
x: pts[2],
y: pts[3]
}, {
x: pts[4],
y: pts[5]
}, t2);
return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]];
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
approximateBarrelCurvePts
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getCurveT = function getCurveT(x, y, curvePts) {
var x0 = curvePts[4];
var x1 = curvePts[2];
var x2 = curvePts[0];
var y0 = curvePts[5]; // var y1 = curvePts[ 3 ];
var y2 = curvePts[1];
var xMin = Math.min(x0, x2);
var xMax = Math.max(x0, x2);
var yMin = Math.min(y0, y2);
var yMax = Math.max(y0, y2);
if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) {
var coeff = bezierPtsToQuadCoeff(x0, x1, x2);
var roots = solveQuadratic(coeff[0], coeff[1], coeff[2], x);
var validRoots = roots.filter(function (r) {
return 0 <= r && r <= 1;
});
if (validRoots.length > 0) {
return validRoots[0];
}
}
return null;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getCurveT
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) {
var cbs = r.beforeRenderCallbacks;
for (var i = 0; i < cbs.length; i++) {
cbs[i].fn(willDraw, startTime);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
beforeRenderCallbacks
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
renderFn = function renderFn(requestTime) {
if (r.destroyed) {
return;
}
if (cy.batching()) ; else if (r.requestedFrame && !r.skipFrame) {
beforeRenderCallbacks(r, true, requestTime);
var startTime = performanceNow();
r.render(r.renderOptions);
var endTime = r.lastDrawTime = performanceNow();
if (r.averageRedrawTime === undefined) {
r.averageRedrawTime = endTime - startTime;
}
if (r.redrawCount === undefined) {
r.redrawCount = 0;
}
r.redrawCount++;
if (r.redrawTotalTime === undefined) {
r.redrawTotalTime = 0;
}
var duration = endTime - startTime;
r.redrawTotalTime += duration;
r.lastRedrawTime = duration; // use a weighted average with a bias from the previous average so we don't spike so easily
r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2;
r.requestedFrame = false;
} else {
beforeRenderCallbacks(r, false, requestTime);
}
r.skipFrame = false;
requestAnimationFrame(renderFn);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
renderFn
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
dequeue = function dequeue(willDraw, frameStartTime) {
var startTime = performanceNow();
var avgRenderTime = r.averageRedrawTime;
var renderTime = r.lastRedrawTime;
var deqd = [];
var extent = r.cy.extent();
var pixelRatio = r.getPixelRatio(); // if we aren't in a tick that causes a draw, then the rendered style
// queue won't automatically be flushed before dequeueing starts
if (!willDraw) {
r.flushRenderedStyleQueue();
}
while (true) {
// eslint-disable-line no-constant-condition
var now = performanceNow();
var duration = now - startTime;
var frameDuration = now - frameStartTime;
if (renderTime < fullFpsTime) {
// if we're rendering faster than the ideal fps, then do dequeueing
// during all of the remaining frame time
var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0);
if (frameDuration >= opts.deqFastCost * timeAvailable) {
break;
}
} else {
if (willDraw) {
if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) {
break;
}
} else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) {
break;
}
}
var thisDeqd = opts.deq(self, pixelRatio, extent);
if (thisDeqd.length > 0) {
for (var i = 0; i < thisDeqd.length; i++) {
deqd.push(thisDeqd[i]);
}
} else {
break;
}
} // callbacks on dequeue
if (deqd.length > 0) {
opts.onDeqd(self, deqd);
if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) {
queueRedraw();
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
dequeue
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function ElementTextureCacheLookup(getKey) {
var doesEleInvalidateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : falsify;
_classCallCheck(this, ElementTextureCacheLookup);
this.idsByKey = new Map$1();
this.keyForId = new Map$1();
this.cachesByLvl = new Map$1();
this.lvls = [];
this.getKey = getKey;
this.doesEleInvalidateKey = doesEleInvalidateKey;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
ElementTextureCacheLookup
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
ElementTextureCache = function ElementTextureCache(renderer, initOptions) {
var self = this;
self.renderer = renderer;
self.onDequeues = [];
var opts = initDefaults(initOptions);
extend(self, opts);
self.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey);
self.setupDequeueing();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
ElementTextureCache
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
addNewTxr = function addNewTxr() {
return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
addNewTxr
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
scalableFrom = function scalableFrom(otherCache) {
return otherCache && otherCache.scaledLabelShown === scaledLabelShown;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
scalableFrom
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
downscale = function downscale() {
txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
downscale
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
LayeredTextureCache = function LayeredTextureCache(renderer) {
var self = this;
var r = self.renderer = renderer;
var cy = r.cy;
self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ]
self.firstGet = true;
self.lastInvalidationTime = performanceNow() - 2 * invalidThreshold;
self.skipping = false;
self.eleTxrDeqs = cy.collection();
self.scheduleElementRefinement = util(function () {
self.refineElementTextures(self.eleTxrDeqs);
self.eleTxrDeqs.unmerge(self.eleTxrDeqs);
}, refineEleDebounceTime);
r.beforeRender(function (willDraw, now) {
if (now - self.lastInvalidationTime <= invalidThreshold) {
self.skipping = true;
} else {
self.skipping = false;
}
}, r.beforeRenderPriorities.lyrTxrSkip);
var qSort = function qSort(a, b) {
return b.reqs - a.reqs;
};
self.layersQueue = new Heap(qSort);
self.setupDequeueing();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
LayeredTextureCache
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
qSort = function qSort(a, b) {
return b.reqs - a.reqs;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
qSort
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
checkTempLevels = function checkTempLevels() {
var canUseAsTmpLvl = function canUseAsTmpLvl(l) {
self.validateLayersElesOrdering(l, eles);
if (self.levelIsComplete(l, eles)) {
tmpLayers = layersByLvl[l];
return true;
}
};
var checkLvls = function checkLvls(dir) {
if (tmpLayers) {
return;
}
for (var l = lvl + dir; minLvl$1 <= l && l <= maxLvl$1; l += dir) {
if (canUseAsTmpLvl(l)) {
break;
}
}
};
checkLvls(+1);
checkLvls(-1); // remove the invalid layers; they will be replaced as needed later in this function
for (var i = layers.length - 1; i >= 0; i--) {
var layer = layers[i];
if (layer.invalid) {
removeFromArray(layers, layer);
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
checkTempLevels
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
canUseAsTmpLvl = function canUseAsTmpLvl(l) {
self.validateLayersElesOrdering(l, eles);
if (self.levelIsComplete(l, eles)) {
tmpLayers = layersByLvl[l];
return true;
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
canUseAsTmpLvl
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
checkLvls = function checkLvls(dir) {
if (tmpLayers) {
return;
}
for (var l = lvl + dir; minLvl$1 <= l && l <= maxLvl$1; l += dir) {
if (canUseAsTmpLvl(l)) {
break;
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
checkLvls
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getBb = function getBb() {
if (!bb) {
bb = makeBoundingBox();
for (var i = 0; i < eles.length; i++) {
updateBoundingBox(bb, eles[i].boundingBox());
}
}
return bb;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getBb
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
makeLayer = function makeLayer(opts) {
opts = opts || {};
var after = opts.after;
getBb();
var area = bb.w * scale * (bb.h * scale);
if (area > maxLayerArea) {
return null;
}
var layer = self.makeLayer(bb, lvl);
if (after != null) {
var index = layers.indexOf(after) + 1;
layers.splice(index, 0, layer);
} else if (opts.insert === undefined || opts.insert) {
// no after specified => first layer made so put at start
layers.unshift(layer);
} // if( tmpLayers ){
//self.queueLayer( layer );
// }
return layer;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
makeLayer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function polygon(context, points) {
for (var i = 0; i < points.length; i++) {
var pt = points[i];
context.lineTo(pt.x, pt.y);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
polygon
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function triangleBackcurve(context, points, controlPoint) {
var firstPt;
for (var i = 0; i < points.length; i++) {
var pt = points[i];
if (i === 0) {
firstPt = pt;
}
context.lineTo(pt.x, pt.y);
}
context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
triangleBackcurve
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function triangleTee(context, trianglePoints, teePoints) {
if (context.beginPath) {
context.beginPath();
}
var triPts = trianglePoints;
for (var i = 0; i < triPts.length; i++) {
var pt = triPts[i];
context.lineTo(pt.x, pt.y);
}
var teePts = teePoints;
var firstTeePt = teePoints[0];
context.moveTo(firstTeePt.x, firstTeePt.y);
for (var i = 1; i < teePts.length; i++) {
var pt = teePts[i];
context.lineTo(pt.x, pt.y);
}
if (context.closePath) {
context.closePath();
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
triangleTee
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function circleTriangle(context, trianglePoints, rx, ry, r) {
if (context.beginPath) {
context.beginPath();
}
context.arc(rx, ry, r, 0, Math.PI * 2, false);
var triPts = trianglePoints;
var firstTrPt = triPts[0];
context.moveTo(firstTrPt.x, firstTrPt.y);
for (var i = 0; i < triPts.length; i++) {
var pt = triPts[i];
context.lineTo(pt.x, pt.y);
}
if (context.closePath) {
context.closePath();
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
circleTriangle
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function circle(context, rx, ry, r) {
context.arc(rx, ry, r, 0, Math.PI * 2, false);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
circle
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getZeroRotation = function getZeroRotation() {
return 0;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getZeroRotation
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getLabelRotation = function getLabelRotation(r, ele) {
return r.getTextAngle(ele, null);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getLabelRotation
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getSourceLabelRotation = function getSourceLabelRotation(r, ele) {
return r.getTextAngle(ele, 'source');
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getSourceLabelRotation
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTargetLabelRotation = function getTargetLabelRotation(r, ele) {
return r.getTextAngle(ele, 'target');
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTargetLabelRotation
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getOpacity = function getOpacity(r, ele) {
return ele.effectiveOpacity();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getOpacity
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTextOpacity = function getTextOpacity(e, ele) {
return ele.pstyle('text-opacity').pfValue * ele.effectiveOpacity();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTextOpacity
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawLine = function drawLine() {
var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveLineOpacity;
if (curveStyle === 'straight-triangle') {
r.eleStrokeStyle(context, edge, strokeOpacity);
r.drawEdgeTrianglePath(edge, context, rs.allpts);
} else {
context.lineWidth = edgeWidth;
context.lineCap = lineCap;
r.eleStrokeStyle(context, edge, strokeOpacity);
r.drawEdgePath(edge, context, rs.allpts, lineStyle);
context.lineCap = 'butt'; // reset for other drawing functions
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawLine
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawOverlay = function drawOverlay() {
if (!shouldDrawOverlay) {
return;
}
r.drawEdgeOverlay(context, edge);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawOverlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawUnderlay = function drawUnderlay() {
if (!shouldDrawOverlay) {
return;
}
r.drawEdgeUnderlay(context, edge);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawUnderlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawArrows = function drawArrows() {
var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveArrowOpacity;
r.drawArrowheads(context, edge, arrowOpacity);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawArrows
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawText = function drawText() {
r.drawElementText(context, edge, null, drawLabel);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawText
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawEdgeOverlayUnderlay = function drawEdgeOverlayUnderlay(overlayOrUnderlay) {
if (!['overlay', 'underlay'].includes(overlayOrUnderlay)) {
throw new Error('Invalid state');
}
return function (context, edge) {
if (!edge.visible()) {
return;
}
var opacity = edge.pstyle("".concat(overlayOrUnderlay, "-opacity")).value;
if (opacity === 0) {
return;
}
var r = this;
var usePaths = r.usePaths();
var rs = edge._private.rscratch;
var padding = edge.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
var width = 2 * padding;
var color = edge.pstyle("".concat(overlayOrUnderlay, "-color")).value;
context.lineWidth = width;
if (rs.edgeType === 'self' && !usePaths) {
context.lineCap = 'butt';
} else {
context.lineCap = 'round';
}
r.colorStrokeStyle(context, color[0], color[1], color[2], opacity);
r.drawEdgePath(edge, context, rs.allpts, 'solid');
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawEdgeOverlayUnderlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function roundRect(ctx, x, y, width, height) {
var radius = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 5;
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.lineTo(x + width - radius, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
ctx.lineTo(x + width, y + height - radius);
ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
ctx.lineTo(x + radius, y + height);
ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
ctx.lineTo(x, y + radius);
ctx.quadraticCurveTo(x, y, x + radius, y);
ctx.closePath();
ctx.fill();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
roundRect
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
setupShapeColor = function setupShapeColor() {
var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity;
r.eleFillStyle(context, node, bgOpy);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
setupShapeColor
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
setupBorderColor = function setupBorderColor() {
var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity;
r.colorStrokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
setupBorderColor
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawShape = function drawShape() {
if (!pathCacheHit) {
var npos = pos;
if (usePaths) {
npos = {
x: 0,
y: 0
};
}
r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight);
}
if (usePaths) {
context.fill(path);
} else {
context.fill();
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawShape
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawImages = function drawImages() {
var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;
var inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var prevBging = _p.backgrounding;
var totalCompleted = 0;
for (var _i = 0; _i < image.length; _i++) {
var bgContainment = node.cy().style().getIndexedStyle(node, 'background-image-containment', 'value', _i);
if (inside && bgContainment === 'over' || !inside && bgContainment === 'inside') {
totalCompleted++;
continue;
}
if (urlDefined[_i] && image[_i].complete && !image[_i].error) {
totalCompleted++;
r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity);
}
}
_p.backgrounding = !(totalCompleted === numImages);
if (prevBging !== _p.backgrounding) {
// update style b/c :backgrounding state changed
node.updateStyle(false);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawImages
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawPie = function drawPie() {
var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eleOpacity;
if (r.hasPie(node)) {
r.drawPie(context, node, pieOpacity); // redraw/restore path if steps after pie need it
if (redrawShape) {
if (!usePaths) {
r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight);
}
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawPie
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
darken = function darken() {
var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;
var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity;
var c = darkness > 0 ? 0 : 255;
if (darkness !== 0) {
r.colorFillStyle(context, c, c, c, opacity);
if (usePaths) {
context.fill(path);
} else {
context.fill();
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
darken
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawBorder = function drawBorder() {
if (borderWidth > 0) {
context.lineWidth = borderWidth;
context.lineCap = 'butt';
if (context.setLineDash) {
// for very outofdate browsers
switch (borderStyle) {
case 'dotted':
context.setLineDash([1, 1]);
break;
case 'dashed':
context.setLineDash([4, 2]);
break;
case 'solid':
case 'double':
context.setLineDash([]);
break;
}
}
if (usePaths) {
context.stroke(path);
} else {
context.stroke();
}
if (borderStyle === 'double') {
context.lineWidth = borderWidth / 3;
var gco = context.globalCompositeOperation;
context.globalCompositeOperation = 'destination-out';
if (usePaths) {
context.stroke(path);
} else {
context.stroke();
}
context.globalCompositeOperation = gco;
} // reset in case we changed the border style
if (context.setLineDash) {
// for very outofdate browsers
context.setLineDash([]);
}
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawBorder
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawOverlay = function drawOverlay() {
if (shouldDrawOverlay) {
r.drawNodeOverlay(context, node, pos, nodeWidth, nodeHeight);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawOverlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawUnderlay = function drawUnderlay() {
if (shouldDrawOverlay) {
r.drawNodeUnderlay(context, node, pos, nodeWidth, nodeHeight);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawUnderlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawText = function drawText() {
r.drawElementText(context, node, null, drawLabel);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawText
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawNodeOverlayUnderlay = function drawNodeOverlayUnderlay(overlayOrUnderlay) {
if (!['overlay', 'underlay'].includes(overlayOrUnderlay)) {
throw new Error('Invalid state');
}
return function (context, node, pos, nodeWidth, nodeHeight) {
var r = this;
if (!node.visible()) {
return;
}
var padding = node.pstyle("".concat(overlayOrUnderlay, "-padding")).pfValue;
var opacity = node.pstyle("".concat(overlayOrUnderlay, "-opacity")).value;
var color = node.pstyle("".concat(overlayOrUnderlay, "-color")).value;
var shape = node.pstyle("".concat(overlayOrUnderlay, "-shape")).value;
if (opacity > 0) {
pos = pos || node.position();
if (nodeWidth == null || nodeHeight == null) {
var _padding = node.padding();
nodeWidth = node.width() + 2 * _padding;
nodeHeight = node.height() + 2 * _padding;
}
r.colorFillStyle(context, color[0], color[1], color[2], opacity);
r.nodeShapes[shape].draw(context, pos.x, pos.y, nodeWidth + padding * 2, nodeHeight + padding * 2);
context.fill();
}
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawNodeOverlayUnderlay
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function mbclear(context, x, y, w, h) {
var gco = context.globalCompositeOperation;
context.globalCompositeOperation = 'destination-out';
r.colorFillStyle(context, 255, 255, 255, r.motionBlurTransparency);
context.fillRect(x, y, w, h);
context.globalCompositeOperation = gco;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
mbclear
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function setContextTransform(context, clear) {
var ePan, eZoom, w, h;
if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) {
ePan = {
x: pan.x * mbPxRatio,
y: pan.y * mbPxRatio
};
eZoom = zoom * mbPxRatio;
w = r.canvasWidth * mbPxRatio;
h = r.canvasHeight * mbPxRatio;
} else {
ePan = effectivePan;
eZoom = effectiveZoom;
w = r.canvasWidth;
h = r.canvasHeight;
}
context.setTransform(1, 0, 0, 1, 0, 0);
if (clear === 'motionBlur') {
mbclear(context, 0, 0, w, h);
} else if (!forcedContext && (clear === undefined || clear)) {
context.clearRect(0, 0, w, h);
}
if (!drawAllLayers) {
context.translate(ePan.x, ePan.y);
context.scale(eZoom, eZoom);
}
if (forcedPan) {
context.translate(forcedPan.x, forcedPan.y);
}
if (forcedZoom) {
context.scale(forcedZoom, forcedZoom);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
setContextTransform
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) {
cxt.setTransform(1, 0, 0, 1, 0, 0);
if (needClear || !motionBlurFadeEffect) {
cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight);
} else {
mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight);
}
var pxr = mbPxRatio;
cxt.drawImage(txt, // img
0, 0, // sx, sy
r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh
0, 0, // x, y
r.canvasWidth, r.canvasHeight // w, h
);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawMotionBlur
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function b64ToBlob(b64, mimeType) {
var bytes = atob(b64);
var buff = new ArrayBuffer(bytes.length);
var buffUint8 = new Uint8Array(buff);
for (var i = 0; i < bytes.length; i++) {
buffUint8[i] = bytes.charCodeAt(i);
}
return new Blob([buff], {
type: mimeType
});
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
b64ToBlob
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function b64UriToB64(b64uri) {
var i = b64uri.indexOf(',');
return b64uri.substr(i + 1);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
b64UriToB64
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function output(options, canvas, mimeType) {
var getB64Uri = function getB64Uri() {
return canvas.toDataURL(mimeType, options.quality);
};
switch (options.output) {
case 'blob-promise':
return new Promise$1(function (resolve, reject) {
try {
canvas.toBlob(function (blob) {
if (blob != null) {
resolve(blob);
} else {
reject(new Error('`canvas.toBlob()` sent a null value in its callback'));
}
}, mimeType, options.quality);
} catch (err) {
reject(err);
}
});
case 'blob':
return b64ToBlob(b64UriToB64(getB64Uri()), mimeType);
case 'base64':
return b64UriToB64(getB64Uri());
case 'base64uri':
default:
return getB64Uri();
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
output
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getB64Uri = function getB64Uri() {
return canvas.toDataURL(mimeType, options.quality);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getB64Uri
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function CanvasRenderer(options) {
var r = this;
r.data = {
canvases: new Array(CRp$a.CANVAS_LAYERS),
contexts: new Array(CRp$a.CANVAS_LAYERS),
canvasNeedsRedraw: new Array(CRp$a.CANVAS_LAYERS),
bufferCanvases: new Array(CRp$a.BUFFER_COUNT),
bufferContexts: new Array(CRp$a.CANVAS_LAYERS)
};
var tapHlOffAttr = '-webkit-tap-highlight-color';
var tapHlOffStyle = 'rgba(0,0,0,0)';
r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef
var containerStyle = r.data.canvasContainer.style;
r.data.canvasContainer.style[tapHlOffAttr] = tapHlOffStyle;
containerStyle.position = 'relative';
containerStyle.zIndex = '0';
containerStyle.overflow = 'hidden';
var container = options.cy.container();
container.appendChild(r.data.canvasContainer);
container.style[tapHlOffAttr] = tapHlOffStyle;
var styleMap = {
'-webkit-user-select': 'none',
'-moz-user-select': '-moz-none',
'user-select': 'none',
'-webkit-tap-highlight-color': 'rgba(0,0,0,0)',
'outline-style': 'none'
};
if (ms()) {
styleMap['-ms-touch-action'] = 'none';
styleMap['touch-action'] = 'none';
}
for (var i = 0; i < CRp$a.CANVAS_LAYERS; i++) {
var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef
r.data.contexts[i] = canvas.getContext('2d');
Object.keys(styleMap).forEach(function (k) {
canvas.style[k] = styleMap[k];
});
canvas.style.position = 'absolute';
canvas.setAttribute('data-id', 'layer' + i);
canvas.style.zIndex = String(CRp$a.CANVAS_LAYERS - i);
r.data.canvasContainer.appendChild(canvas);
r.data.canvasNeedsRedraw[i] = false;
}
r.data.topCanvas = r.data.canvases[0];
r.data.canvases[CRp$a.NODE].setAttribute('data-id', 'layer' + CRp$a.NODE + '-node');
r.data.canvases[CRp$a.SELECT_BOX].setAttribute('data-id', 'layer' + CRp$a.SELECT_BOX + '-selectbox');
r.data.canvases[CRp$a.DRAG].setAttribute('data-id', 'layer' + CRp$a.DRAG + '-drag');
for (var i = 0; i < CRp$a.BUFFER_COUNT; i++) {
r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef
r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d');
r.data.bufferCanvases[i].style.position = 'absolute';
r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i);
r.data.bufferCanvases[i].style.zIndex = String(-i - 1);
r.data.bufferCanvases[i].style.visibility = 'hidden'; //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]);
}
r.pathsEnabled = true;
var emptyBb = makeBoundingBox();
var getBoxCenter = function getBoxCenter(bb) {
return {
x: (bb.x1 + bb.x2) / 2,
y: (bb.y1 + bb.y2) / 2
};
};
var getCenterOffset = function getCenterOffset(bb) {
return {
x: -bb.w / 2,
y: -bb.h / 2
};
};
var backgroundTimestampHasChanged = function backgroundTimestampHasChanged(ele) {
var _p = ele[0]._private;
var same = _p.oldBackgroundTimestamp === _p.backgroundTimestamp;
return !same;
};
var getStyleKey = function getStyleKey(ele) {
return ele[0]._private.nodeKey;
};
var getLabelKey = function getLabelKey(ele) {
return ele[0]._private.labelStyleKey;
};
var getSourceLabelKey = function getSourceLabelKey(ele) {
return ele[0]._private.sourceLabelStyleKey;
};
var getTargetLabelKey = function getTargetLabelKey(ele) {
return ele[0]._private.targetLabelStyleKey;
};
var drawElement = function drawElement(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElement(context, ele, bb, false, false, useEleOpacity);
};
var drawLabel = function drawLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'main', useEleOpacity);
};
var drawSourceLabel = function drawSourceLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'source', useEleOpacity);
};
var drawTargetLabel = function drawTargetLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'target', useEleOpacity);
};
var getElementBox = function getElementBox(ele) {
ele.boundingBox();
return ele[0]._private.bodyBounds;
};
var getLabelBox = function getLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.main || emptyBb;
};
var getSourceLabelBox = function getSourceLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.source || emptyBb;
};
var getTargetLabelBox = function getTargetLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.target || emptyBb;
};
var isLabelVisibleAtScale = function isLabelVisibleAtScale(ele, scaledLabelShown) {
return scaledLabelShown;
};
var getElementRotationPoint = function getElementRotationPoint(ele) {
return getBoxCenter(getElementBox(ele));
};
var addTextMargin = function addTextMargin(prefix, pt, ele) {
var pre = prefix ? prefix + '-' : '';
return {
x: pt.x + ele.pstyle(pre + 'text-margin-x').pfValue,
y: pt.y + ele.pstyle(pre + 'text-margin-y').pfValue
};
};
var getRsPt = function getRsPt(ele, x, y) {
var rs = ele[0]._private.rscratch;
return {
x: rs[x],
y: rs[y]
};
};
var getLabelRotationPoint = function getLabelRotationPoint(ele) {
return addTextMargin('', getRsPt(ele, 'labelX', 'labelY'), ele);
};
var getSourceLabelRotationPoint = function getSourceLabelRotationPoint(ele) {
return addTextMargin('source', getRsPt(ele, 'sourceLabelX', 'sourceLabelY'), ele);
};
var getTargetLabelRotationPoint = function getTargetLabelRotationPoint(ele) {
return addTextMargin('target', getRsPt(ele, 'targetLabelX', 'targetLabelY'), ele);
};
var getElementRotationOffset = function getElementRotationOffset(ele) {
return getCenterOffset(getElementBox(ele));
};
var getSourceLabelRotationOffset = function getSourceLabelRotationOffset(ele) {
return getCenterOffset(getSourceLabelBox(ele));
};
var getTargetLabelRotationOffset = function getTargetLabelRotationOffset(ele) {
return getCenterOffset(getTargetLabelBox(ele));
};
var getLabelRotationOffset = function getLabelRotationOffset(ele) {
var bb = getLabelBox(ele);
var p = getCenterOffset(getLabelBox(ele));
if (ele.isNode()) {
switch (ele.pstyle('text-halign').value) {
case 'left':
p.x = -bb.w;
break;
case 'right':
p.x = 0;
break;
}
switch (ele.pstyle('text-valign').value) {
case 'top':
p.y = -bb.h;
break;
case 'bottom':
p.y = 0;
break;
}
}
return p;
};
var eleTxrCache = r.data.eleTxrCache = new ElementTextureCache(r, {
getKey: getStyleKey,
doesEleInvalidateKey: backgroundTimestampHasChanged,
drawElement: drawElement,
getBoundingBox: getElementBox,
getRotationPoint: getElementRotationPoint,
getRotationOffset: getElementRotationOffset,
allowEdgeTxrCaching: false,
allowParentTxrCaching: false
});
var lblTxrCache = r.data.lblTxrCache = new ElementTextureCache(r, {
getKey: getLabelKey,
drawElement: drawLabel,
getBoundingBox: getLabelBox,
getRotationPoint: getLabelRotationPoint,
getRotationOffset: getLabelRotationOffset,
isVisible: isLabelVisibleAtScale
});
var slbTxrCache = r.data.slbTxrCache = new ElementTextureCache(r, {
getKey: getSourceLabelKey,
drawElement: drawSourceLabel,
getBoundingBox: getSourceLabelBox,
getRotationPoint: getSourceLabelRotationPoint,
getRotationOffset: getSourceLabelRotationOffset,
isVisible: isLabelVisibleAtScale
});
var tlbTxrCache = r.data.tlbTxrCache = new ElementTextureCache(r, {
getKey: getTargetLabelKey,
drawElement: drawTargetLabel,
getBoundingBox: getTargetLabelBox,
getRotationPoint: getTargetLabelRotationPoint,
getRotationOffset: getTargetLabelRotationOffset,
isVisible: isLabelVisibleAtScale
});
var lyrTxrCache = r.data.lyrTxrCache = new LayeredTextureCache(r);
r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) {
// each cache should check for sub-key diff to see that the update affects that cache particularly
eleTxrCache.invalidateElements(eles);
lblTxrCache.invalidateElements(eles);
slbTxrCache.invalidateElements(eles);
tlbTxrCache.invalidateElements(eles); // any change invalidates the layers
lyrTxrCache.invalidateElements(eles); // update the old bg timestamp so diffs can be done in the ele txr caches
for (var _i = 0; _i < eles.length; _i++) {
var _p = eles[_i]._private;
_p.oldBackgroundTimestamp = _p.backgroundTimestamp;
}
});
var refineInLayers = function refineInLayers(reqs) {
for (var i = 0; i < reqs.length; i++) {
lyrTxrCache.enqueueElementRefinement(reqs[i].ele);
}
};
eleTxrCache.onDequeue(refineInLayers);
lblTxrCache.onDequeue(refineInLayers);
slbTxrCache.onDequeue(refineInLayers);
tlbTxrCache.onDequeue(refineInLayers);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
CanvasRenderer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getBoxCenter = function getBoxCenter(bb) {
return {
x: (bb.x1 + bb.x2) / 2,
y: (bb.y1 + bb.y2) / 2
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getBoxCenter
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getCenterOffset = function getCenterOffset(bb) {
return {
x: -bb.w / 2,
y: -bb.h / 2
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getCenterOffset
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
backgroundTimestampHasChanged = function backgroundTimestampHasChanged(ele) {
var _p = ele[0]._private;
var same = _p.oldBackgroundTimestamp === _p.backgroundTimestamp;
return !same;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
backgroundTimestampHasChanged
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getStyleKey = function getStyleKey(ele) {
return ele[0]._private.nodeKey;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getStyleKey
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getLabelKey = function getLabelKey(ele) {
return ele[0]._private.labelStyleKey;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getLabelKey
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getSourceLabelKey = function getSourceLabelKey(ele) {
return ele[0]._private.sourceLabelStyleKey;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getSourceLabelKey
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTargetLabelKey = function getTargetLabelKey(ele) {
return ele[0]._private.targetLabelStyleKey;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTargetLabelKey
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawElement = function drawElement(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElement(context, ele, bb, false, false, useEleOpacity);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawElement
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawLabel = function drawLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'main', useEleOpacity);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawLabel
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawSourceLabel = function drawSourceLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'source', useEleOpacity);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawSourceLabel
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
drawTargetLabel = function drawTargetLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {
return r.drawElementText(context, ele, bb, scaledLabelShown, 'target', useEleOpacity);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
drawTargetLabel
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getElementBox = function getElementBox(ele) {
ele.boundingBox();
return ele[0]._private.bodyBounds;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getElementBox
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getLabelBox = function getLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.main || emptyBb;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getLabelBox
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getSourceLabelBox = function getSourceLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.source || emptyBb;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getSourceLabelBox
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTargetLabelBox = function getTargetLabelBox(ele) {
ele.boundingBox();
return ele[0]._private.labelBounds.target || emptyBb;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTargetLabelBox
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
isLabelVisibleAtScale = function isLabelVisibleAtScale(ele, scaledLabelShown) {
return scaledLabelShown;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
isLabelVisibleAtScale
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getElementRotationPoint = function getElementRotationPoint(ele) {
return getBoxCenter(getElementBox(ele));
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getElementRotationPoint
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
addTextMargin = function addTextMargin(prefix, pt, ele) {
var pre = prefix ? prefix + '-' : '';
return {
x: pt.x + ele.pstyle(pre + 'text-margin-x').pfValue,
y: pt.y + ele.pstyle(pre + 'text-margin-y').pfValue
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
addTextMargin
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getRsPt = function getRsPt(ele, x, y) {
var rs = ele[0]._private.rscratch;
return {
x: rs[x],
y: rs[y]
};
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getRsPt
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getLabelRotationPoint = function getLabelRotationPoint(ele) {
return addTextMargin('', getRsPt(ele, 'labelX', 'labelY'), ele);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getLabelRotationPoint
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getSourceLabelRotationPoint = function getSourceLabelRotationPoint(ele) {
return addTextMargin('source', getRsPt(ele, 'sourceLabelX', 'sourceLabelY'), ele);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getSourceLabelRotationPoint
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTargetLabelRotationPoint = function getTargetLabelRotationPoint(ele) {
return addTextMargin('target', getRsPt(ele, 'targetLabelX', 'targetLabelY'), ele);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTargetLabelRotationPoint
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getElementRotationOffset = function getElementRotationOffset(ele) {
return getCenterOffset(getElementBox(ele));
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getElementRotationOffset
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getSourceLabelRotationOffset = function getSourceLabelRotationOffset(ele) {
return getCenterOffset(getSourceLabelBox(ele));
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getSourceLabelRotationOffset
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getTargetLabelRotationOffset = function getTargetLabelRotationOffset(ele) {
return getCenterOffset(getTargetLabelBox(ele));
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getTargetLabelRotationOffset
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getLabelRotationOffset = function getLabelRotationOffset(ele) {
var bb = getLabelBox(ele);
var p = getCenterOffset(getLabelBox(ele));
if (ele.isNode()) {
switch (ele.pstyle('text-halign').value) {
case 'left':
p.x = -bb.w;
break;
case 'right':
p.x = 0;
break;
}
switch (ele.pstyle('text-valign').value) {
case 'top':
p.y = -bb.h;
break;
case 'bottom':
p.y = 0;
break;
}
}
return p;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getLabelRotationOffset
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
refineInLayers = function refineInLayers(reqs) {
for (var i = 0; i < reqs.length; i++) {
lyrTxrCache.enqueueElementRefinement(reqs[i].ele);
}
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
refineInLayers
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
function setExtension(type, name, registrant) {
var ext = registrant;
var overrideErr = function overrideErr(field) {
warn('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden');
};
if (type === 'core') {
if (Core.prototype[name]) {
return overrideErr(name);
} else {
Core.prototype[name] = registrant;
}
} else if (type === 'collection') {
if (Collection.prototype[name]) {
return overrideErr(name);
} else {
Collection.prototype[name] = registrant;
}
} else if (type === 'layout') {
// fill in missing layout functions in the prototype
var Layout = function Layout(options) {
this.options = options;
registrant.call(this, options); // make sure layout has _private for use w/ std apis like .on()
if (!plainObject(this._private)) {
this._private = {};
}
this._private.cy = options.cy;
this._private.listeners = [];
this.createEmitter();
};
var layoutProto = Layout.prototype = Object.create(registrant.prototype);
var optLayoutFns = [];
for (var i = 0; i < optLayoutFns.length; i++) {
var fnName = optLayoutFns[i];
layoutProto[fnName] = layoutProto[fnName] || function () {
return this;
};
} // either .start() or .run() is defined, so autogen the other
if (layoutProto.start && !layoutProto.run) {
layoutProto.run = function () {
this.start();
return this;
};
} else if (!layoutProto.start && layoutProto.run) {
layoutProto.start = function () {
this.run();
return this;
};
}
var regStop = registrant.prototype.stop;
layoutProto.stop = function () {
var opts = this.options;
if (opts && opts.animate) {
var anis = this.animations;
if (anis) {
for (var _i = 0; _i < anis.length; _i++) {
anis[_i].stop();
}
}
}
if (regStop) {
regStop.call(this);
} else {
this.emit('layoutstop');
}
return this;
};
if (!layoutProto.destroy) {
layoutProto.destroy = function () {
return this;
};
}
layoutProto.cy = function () {
return this._private.cy;
};
var getCy = function getCy(layout) {
return layout._private.cy;
};
var emitterOpts = {
addEventFields: function addEventFields(layout, evt) {
evt.layout = layout;
evt.cy = getCy(layout);
evt.target = layout;
},
bubble: function bubble() {
return true;
},
parent: function parent(layout) {
return getCy(layout);
}
};
extend(layoutProto, {
createEmitter: function createEmitter() {
this._private.emitter = new Emitter(emitterOpts, this);
return this;
},
emitter: function emitter() {
return this._private.emitter;
},
on: function on(evt, cb) {
this.emitter().on(evt, cb);
return this;
},
one: function one(evt, cb) {
this.emitter().one(evt, cb);
return this;
},
once: function once(evt, cb) {
this.emitter().one(evt, cb);
return this;
},
removeListener: function removeListener(evt, cb) {
this.emitter().removeListener(evt, cb);
return this;
},
removeAllListeners: function removeAllListeners() {
this.emitter().removeAllListeners();
return this;
},
emit: function emit(evt, params) {
this.emitter().emit(evt, params);
return this;
}
});
define$3.eventAliasesOn(layoutProto);
ext = Layout; // replace with our wrapped layout
} else if (type === 'renderer' && name !== 'null' && name !== 'base') {
// user registered renderers inherit from base
var BaseRenderer = getExtension('renderer', 'base');
var bProto = BaseRenderer.prototype;
var RegistrantRenderer = registrant;
var rProto = registrant.prototype;
var Renderer = function Renderer() {
BaseRenderer.apply(this, arguments);
RegistrantRenderer.apply(this, arguments);
};
var proto = Renderer.prototype;
for (var pName in bProto) {
var pVal = bProto[pName];
var existsInR = rProto[pName] != null;
if (existsInR) {
return overrideErr(pName);
}
proto[pName] = pVal; // take impl from base
}
for (var _pName in rProto) {
proto[_pName] = rProto[_pName]; // take impl from registrant
}
bProto.clientFunctions.forEach(function (name) {
proto[name] = proto[name] || function () {
error('Renderer does not implement `renderer.' + name + '()` on its prototype');
};
});
ext = Renderer;
}
return setMap({
map: extensions,
keys: [type, name],
value: ext
});
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
setExtension
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
overrideErr = function overrideErr(field) {
warn('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden');
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
overrideErr
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
Layout = function Layout(options) {
this.options = options;
registrant.call(this, options); // make sure layout has _private for use w/ std apis like .on()
if (!plainObject(this._private)) {
this._private = {};
}
this._private.cy = options.cy;
this._private.listeners = [];
this.createEmitter();
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
Layout
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
getCy = function getCy(layout) {
return layout._private.cy;
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
getCy
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
Renderer = function Renderer() {
BaseRenderer.apply(this, arguments);
RegistrantRenderer.apply(this, arguments);
}
|
@brief : Function used for keeping track of compound node
sizes, since they should bound all their subnodes.
|
Renderer
|
javascript
|
pistazie/cdk-dia
|
src/render/cytoscape/base/js/app.8e9fe77f.js
|
https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js
|
MIT
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.