Skip to content

Commit

Permalink
Build 3.30.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Jul 18, 2024
1 parent 36ed03d commit 9cd7b31
Show file tree
Hide file tree
Showing 7 changed files with 289 additions and 80 deletions.
106 changes: 82 additions & 24 deletions dist/cytoscape.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17089,6 +17089,12 @@ var styfn$2 = {};
}, {
name: 'line-dash-offset',
type: t.number
}, {
name: 'line-outline-width',
type: t.size
}, {
name: 'line-outline-color',
type: t.color
}, {
name: 'line-gradient-stop-colors',
type: t.colors
Expand Down Expand Up @@ -17547,6 +17553,8 @@ styfn$2.getDefaultProperties = function () {
'line-fill': 'solid',
'line-cap': 'butt',
'line-opacity': 1,
'line-outline-width': 0,
'line-outline-color': '#000',
'line-gradient-stop-colors': '#999',
'line-gradient-stop-positions': '0%',
'control-point-step-size': 40,
Expand Down Expand Up @@ -23545,8 +23553,6 @@ BRp$a.recalculateEdgeProjections = function (edges) {
this.findEdgeControlPoints(edges);
};

/* global document */

var BRp$9 = {};
BRp$9.recalculateNodeLabelProjection = function (node) {
var content = node.pstyle('label').strValue;
Expand Down Expand Up @@ -23865,8 +23871,8 @@ BRp$9.getLabelText = function (ele, prefix) {
var overflow = ele.pstyle('text-overflow-wrap').value;
var overflowAny = overflow === 'anywhere';
var wrappedLines = [];
var wordsRegex = /[\s\u200b]+/;
var wordSeparator = overflowAny ? '' : ' ';
var separatorRegex = /[\s\u200b]+|$/g; // Include end of string to add last word

for (var l = 0; l < lines.length; l++) {
var line = lines[l];
var lineDims = this.calculateLabelDimensions(ele, line);
Expand All @@ -23877,26 +23883,39 @@ BRp$9.getLabelText = function (ele, prefix) {
}
if (lineW > maxW) {
// line is too long
var words = line.split(wordsRegex);
var separatorMatches = line.matchAll(separatorRegex);
var subline = '';
for (var w = 0; w < words.length; w++) {
var word = words[w];
var testLine = subline.length === 0 ? word : subline + wordSeparator + word;
var testDims = this.calculateLabelDimensions(ele, testLine);
var testW = testDims.width;
if (testW <= maxW) {
// word fits on current line
subline += word + wordSeparator;
} else {
// word starts new line
if (subline) {
wrappedLines.push(subline);
var previousIndex = 0;
// Add fake match
var _iterator = _createForOfIteratorHelper(separatorMatches),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var separatorMatch = _step.value;
var wordSeparator = separatorMatch[0];
var word = line.substring(previousIndex, separatorMatch.index);
previousIndex = separatorMatch.index + wordSeparator.length;
var testLine = subline.length === 0 ? word : subline + word + wordSeparator;
var testDims = this.calculateLabelDimensions(ele, testLine);
var testW = testDims.width;
if (testW <= maxW) {
// word fits on current line
subline += word + wordSeparator;
} else {
// word starts new line
if (subline) {
wrappedLines.push(subline);
}
subline = word + wordSeparator;
}
subline = word + wordSeparator;
}
}

// if there's remaining text, put it in a wrapped line
// if there's remaining text, put it in a wrapped line
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (!subline.match(/^[\s\u200b]+$/)) {
wrappedLines.push(subline);
}
Expand Down Expand Up @@ -23958,6 +23977,8 @@ BRp$9.getLabelJustification = function (ele) {
};
BRp$9.calculateLabelDimensions = function (ele, text) {
var r = this;
var containerWindow = r.cy.window();
var document = containerWindow.document;
var cacheKey = hashString(text, ele._private.labelDimsKey);
var cache = r.labelDimCache || (r.labelDimCache = []);
var existingVal = cache[cacheKey];
Expand Down Expand Up @@ -24282,7 +24303,7 @@ BRp$4.getCachedImage = function (url, crossOrigin, onLoad) {

var BRp$3 = {};

/* global document, window, ResizeObserver, MutationObserver */
/* global document, ResizeObserver, MutationObserver */

BRp$3.registerBinding = function (target, event, handler, useCapture) {
// eslint-disable-line no-unused-vars
Expand Down Expand Up @@ -24616,6 +24637,11 @@ BRp$3.load = function () {
if (!eventInContainer(e)) {
return;
}

// during left mouse button gestures, ignore other buttons
if (r.hoverData.which === 1 && e.which !== 1) {
return;
}
e.preventDefault();
blurActiveDomElement();
r.hoverData.capture = true;
Expand Down Expand Up @@ -25000,6 +25026,10 @@ BRp$3.load = function () {
var clickTimeout, didDoubleClick, prevClickTimeStamp;
r.registerBinding(containerWindow, 'mouseup', function mouseupHandler(e) {
// eslint-disable-line no-undef
// during left mouse button gestures, ignore other buttons
if (r.hoverData.which === 1 && e.which !== 1 && r.hoverData.capture) {
return;
}
var capture = r.hoverData.capture;
if (!capture) {
return;
Expand Down Expand Up @@ -25498,7 +25528,7 @@ BRp$3.load = function () {
}
}, false);
var touchmoveHandler;
r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) {
r.registerBinding(containerWindow, 'touchmove', touchmoveHandler = function touchmoveHandler(e) {
// eslint-disable-line no-undef
var capture = r.touchData.capture;
if (!capture && !eventInContainer(e)) {
Expand Down Expand Up @@ -28455,6 +28485,8 @@ CRp$8.drawEdge = function (context, edge, shiftToOriginWithBb) {
var lineStyle = edge.pstyle('line-style').value;
var edgeWidth = edge.pstyle('width').pfValue;
var lineCap = edge.pstyle('line-cap').value;
var lineOutlineWidth = edge.pstyle('line-outline-width').value;
var lineOutlineColor = edge.pstyle('line-outline-color').value;
var effectiveLineOpacity = opacity * lineOpacity;
// separate arrow opacity would require arrow-opacity property
var effectiveArrowOpacity = opacity * lineOpacity;
Expand All @@ -28472,6 +28504,25 @@ CRp$8.drawEdge = function (context, edge, shiftToOriginWithBb) {
}
};

var drawLineOutline = function drawLineOutline() {
var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : effectiveLineOpacity;
context.lineWidth = edgeWidth + lineOutlineWidth;
context.lineCap = lineCap;
if (lineOutlineWidth > 0) {
r.colorStrokeStyle(context, lineOutlineColor[0], lineOutlineColor[1], lineOutlineColor[2], strokeOpacity);
} else {
// do not draw any lineOutline
context.lineCap = 'butt'; // reset for other drawing functions
return;
}
if (curveStyle === 'straight-triangle') {
r.drawEdgeTrianglePath(edge, context, rs.allpts);
} else {
r.drawEdgePath(edge, context, rs.allpts, lineStyle);
context.lineCap = 'butt'; // reset for other drawing functions
}
};

var drawOverlay = function drawOverlay() {
if (!shouldDrawOverlay) {
return;
Expand Down Expand Up @@ -28502,6 +28553,8 @@ CRp$8.drawEdge = function (context, edge, shiftToOriginWithBb) {
drawLine(effectiveGhostOpacity);
drawArrows(effectiveGhostOpacity);
context.translate(-gx, -gy);
} else {
drawLineOutline();
}
drawUnderlay();
drawLine();
Expand Down Expand Up @@ -29798,8 +29851,9 @@ CRp$4.getPixelRatio = function () {
if (this.forcedPixelRatio != null) {
return this.forcedPixelRatio;
}
var containerWindow = this.cy.window();
var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef
return (containerWindow.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef
};

CRp$4.paintCache = function (context) {
Expand Down Expand Up @@ -30645,6 +30699,8 @@ CRp.MOTIONBLUR_BUFFER_NODE = 1;
CRp.MOTIONBLUR_BUFFER_DRAG = 2;
function CanvasRenderer(options) {
var r = this;
var containerWindow = r.cy.window();
var document = containerWindow.document;
r.data = {
canvases: new Array(CRp.CANVAS_LAYERS),
contexts: new Array(CRp.CANVAS_LAYERS),
Expand Down Expand Up @@ -30928,6 +30984,8 @@ CRp.makeOffscreenCanvas = function (width, height) {
if ((typeof OffscreenCanvas === "undefined" ? "undefined" : _typeof(OffscreenCanvas)) !== ("undefined" )) {
canvas = new OffscreenCanvas(width, height);
} else {
var containerWindow = this.cy.window();
var document = containerWindow.document;
canvas = document.createElement('canvas'); // eslint-disable-line no-undef
canvas.width = width;
canvas.height = height;
Expand Down Expand Up @@ -31266,7 +31324,7 @@ sheetfn.appendToStyle = function (style) {
return style;
};

var version = "3.29.1";
var version = "3.30.1";

var cytoscape = function cytoscape(options) {
// if no options specified, use default
Expand Down
6 changes: 3 additions & 3 deletions dist/cytoscape.esm.min.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit 9cd7b31

Please sign in to comment.