plotly.js 3.0.0-rc.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -3
- package/CITATION.cff +2 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +3 -3
- package/dist/README.md +20 -20
- package/dist/plotly-basic.js +19 -11
- package/dist/plotly-basic.min.js +6 -6
- package/dist/plotly-cartesian.js +19 -11
- package/dist/plotly-cartesian.min.js +6 -6
- package/dist/plotly-finance.js +19 -11
- package/dist/plotly-finance.min.js +6 -6
- package/dist/plotly-geo-assets.js +3 -3
- package/dist/plotly-geo.js +19 -11
- package/dist/plotly-geo.min.js +6 -6
- package/dist/plotly-gl2d.js +19 -11
- package/dist/plotly-gl2d.min.js +6 -6
- package/dist/plotly-gl3d.js +19 -11
- package/dist/plotly-gl3d.min.js +6 -6
- package/dist/plotly-mapbox.js +19 -11
- package/dist/plotly-mapbox.min.js +6 -6
- package/dist/plotly-strict.js +58 -16
- package/dist/plotly-strict.min.js +7 -7
- package/dist/plotly-with-meta.js +58 -16
- package/dist/plotly.js +58 -16
- package/dist/plotly.min.js +47 -47
- package/dist/translation-keys.txt +1 -1
- package/package.json +1 -1
- package/src/components/fx/helpers.js +7 -2
- package/src/components/modebar/modebar.js +4 -3
- package/src/lib/dom.js +5 -3
- package/src/plot_api/plot_api.js +19 -1
- package/src/plot_api/subroutines.js +8 -0
- package/src/traces/sankey/render.js +156 -109
- package/src/version.js +1 -1
|
@@ -24,7 +24,7 @@ Erase active shape // components/modebar/but
|
|
|
24
24
|
Lasso Select // components/modebar/buttons.js:121
|
|
25
25
|
Orbital rotation // components/modebar/buttons.js:341
|
|
26
26
|
Pan // components/modebar/buttons.js:101
|
|
27
|
-
Produced with Plotly.js // components/modebar/modebar.js:
|
|
27
|
+
Produced with Plotly.js // components/modebar/modebar.js:324
|
|
28
28
|
Reset // components/modebar/buttons.js:514
|
|
29
29
|
Reset axes // components/modebar/buttons.js:213
|
|
30
30
|
Reset camera to default // components/modebar/buttons.js:380
|
package/package.json
CHANGED
|
@@ -60,8 +60,13 @@ exports.getClosest = function(cd, distfn, pointData) {
|
|
|
60
60
|
// this is the longest loop... if this bogs down, we may need
|
|
61
61
|
// to create pre-sorted data (by x or y), not sure how to
|
|
62
62
|
// do this for 'closest'
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
|
|
64
|
+
// defined outside the for to improve the garbage collector performance
|
|
65
|
+
var newDistance = Infinity;
|
|
66
|
+
// the browser engine typically optimizes the length, but it is outside the cycle if it does not
|
|
67
|
+
var len = cd.length
|
|
68
|
+
for(var i = 0; i < len; i++) {
|
|
69
|
+
newDistance = distfn(cd[i]);
|
|
65
70
|
if(newDistance <= pointData.distance) {
|
|
66
71
|
pointData.index = i;
|
|
67
72
|
pointData.distance = newDistance;
|
|
@@ -60,9 +60,6 @@ proto.update = function(graphInfo, buttons) {
|
|
|
60
60
|
document.querySelectorAll(groupSelector).forEach(function(group) {
|
|
61
61
|
group.style.backgroundColor = style.bgcolor;
|
|
62
62
|
});
|
|
63
|
-
// set styles on hover using event listeners instead of inline CSS that's not allowed by strict CSP's
|
|
64
|
-
Lib.setStyleOnHover('#' + modeBarId + ' .modebar-btn', '.active', '.icon path', 'fill: ' + style.activecolor, 'fill: ' + style.color);
|
|
65
|
-
|
|
66
63
|
// if buttons or logo have changed, redraw modebar interior
|
|
67
64
|
var needsNewButtons = !this.hasButtons(buttons);
|
|
68
65
|
var needsNewLogo = (this.hasLogo !== context.displaylogo);
|
|
@@ -92,6 +89,10 @@ proto.update = function(graphInfo, buttons) {
|
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
this.updateActiveButton();
|
|
92
|
+
|
|
93
|
+
// set styles on hover using event listeners instead of inline CSS that's not allowed by strict CSP's
|
|
94
|
+
Lib.setStyleOnHover('#' + modeBarId + ' .modebar-btn', '.active', '.icon path', 'fill: ' + style.activecolor, 'fill: ' + style.color, this.element);
|
|
95
|
+
|
|
95
96
|
};
|
|
96
97
|
|
|
97
98
|
proto.updateButtons = function(buttons) {
|
package/src/lib/dom.js
CHANGED
|
@@ -101,12 +101,14 @@ function deleteRelatedStyleRule(uid) {
|
|
|
101
101
|
* @param {string} activeStyle style that has to be applied when 'hovered' or 'active'
|
|
102
102
|
* @param {string} inactiveStyle style that has to be applied when not 'hovered' nor 'active'
|
|
103
103
|
*/
|
|
104
|
-
function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle) {
|
|
104
|
+
function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle, element) {
|
|
105
105
|
var activeStyleParts = activeStyle.split(':');
|
|
106
106
|
var inactiveStyleParts = inactiveStyle.split(':');
|
|
107
107
|
var eventAddedAttrName = 'data-btn-style-event-added';
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
if (!element) {
|
|
109
|
+
element = document;
|
|
110
|
+
}
|
|
111
|
+
element.querySelectorAll(selector).forEach(function(el) {
|
|
110
112
|
if(!el.getAttribute(eventAddedAttrName)) {
|
|
111
113
|
// Emulate ":hover" CSS style using JS event handlers to set the
|
|
112
114
|
// style in a strict CSP-compliant manner.
|
package/src/plot_api/plot_api.js
CHANGED
|
@@ -3671,7 +3671,25 @@ function makePlotFramework(gd) {
|
|
|
3671
3671
|
fullLayout._container.enter()
|
|
3672
3672
|
.insert('div', ':first-child')
|
|
3673
3673
|
.classed('plot-container', true)
|
|
3674
|
-
.classed('plotly', true)
|
|
3674
|
+
.classed('plotly', true)
|
|
3675
|
+
// The plot container should always take the full with the height of its
|
|
3676
|
+
// parent (the graph div). This ensures that for responsive plots
|
|
3677
|
+
// without a height or width set, the paper div will take up the full
|
|
3678
|
+
// height & width of the graph div.
|
|
3679
|
+
// So, for responsive plots without a height or width set, if the plot
|
|
3680
|
+
// container's height is left to 'auto', its height will be dictated by
|
|
3681
|
+
// its childrens' height. (The plot container's only child is the paper
|
|
3682
|
+
// div.)
|
|
3683
|
+
// In this scenario, the paper div's height will be set to 100%,
|
|
3684
|
+
// which will be 100% of the plot container's auto height. That is
|
|
3685
|
+
// meaninglesss, so the browser will use the paper div's children to set
|
|
3686
|
+
// the height of the plot container instead. However, the paper div's
|
|
3687
|
+
// children do not have any height, because they are all positioned
|
|
3688
|
+
// absolutely, and therefore take up no space.
|
|
3689
|
+
.style({
|
|
3690
|
+
width: "100%",
|
|
3691
|
+
height: "100%"
|
|
3692
|
+
});
|
|
3675
3693
|
|
|
3676
3694
|
// Make the svg container
|
|
3677
3695
|
fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);
|
|
@@ -52,6 +52,14 @@ function lsInner(gd) {
|
|
|
52
52
|
var axList = Axes.list(gd, '', true);
|
|
53
53
|
var i, subplot, plotinfo, ax, xa, ya;
|
|
54
54
|
|
|
55
|
+
// Set the width and height of the paper div ('.svg-container') in
|
|
56
|
+
// accordance with the users configuration and layout.
|
|
57
|
+
// If the plot is responsive and the user has not set a width/height, then
|
|
58
|
+
// the width/height of the paper div is set to 100% to fill the parent
|
|
59
|
+
// container.
|
|
60
|
+
// We can't leave the height or width unset because all of the contents of
|
|
61
|
+
// the paper div are positioned absolutely (and will therefore not take up
|
|
62
|
+
// any space).
|
|
55
63
|
fullLayout._paperdiv.style({
|
|
56
64
|
width: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroWidth && !gd.layout.width) ? '100%' : fullLayout.width + 'px',
|
|
57
65
|
height: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroHeight && !gd.layout.height) ? '100%' : fullLayout.height + 'px'
|
|
@@ -335,118 +335,165 @@ function createCircularClosedPathString(link, arrowLen) {
|
|
|
335
335
|
var pathString = '';
|
|
336
336
|
var offset = link.width / 2;
|
|
337
337
|
var coords = link.circularPathData;
|
|
338
|
-
|
|
339
|
-
|
|
338
|
+
var isSourceBeforeTarget = coords.sourceX + coords.verticalBuffer < coords.targetX;
|
|
339
|
+
var isPathOverlapped = (coords.rightFullExtent - coords.rightLargeArcRadius - arrowLen) <= (coords.leftFullExtent - offset)
|
|
340
|
+
var diff = Math.abs(coords.rightFullExtent- coords.leftFullExtent - offset) < offset ;
|
|
341
|
+
if (link.circularLinkType === 'top') {
|
|
340
342
|
pathString =
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
343
|
+
// start at the left of the target node
|
|
344
|
+
'M ' +
|
|
345
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
|
|
346
|
+
'L ' +
|
|
347
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
348
|
+
'A ' +
|
|
349
|
+
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
350
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
351
|
+
'L ' + (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
352
|
+
|
|
353
|
+
if (isSourceBeforeTarget && isPathOverlapped) {
|
|
354
|
+
pathString += ' A ' +
|
|
355
|
+
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
356
|
+
(coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + ' ' +
|
|
357
|
+
(coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) +
|
|
358
|
+
' L ' +
|
|
359
|
+
(coords.rightFullExtent + offset - (coords.rightLargeArcRadius - offset) - arrowLen) + ' ' +
|
|
360
|
+
(coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) +
|
|
361
|
+
' A ' +
|
|
362
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
363
|
+
(coords.leftFullExtent + offset) + ' ' + coords.verticalRightInnerExtent;
|
|
364
|
+
} else if (isSourceBeforeTarget) {
|
|
365
|
+
pathString += ' A ' +
|
|
366
|
+
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
367
|
+
(coords.rightFullExtent - offset - arrowLen - (coords.rightLargeArcRadius - offset)) + ' ' +
|
|
368
|
+
(coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) +
|
|
369
|
+
' L ' +
|
|
370
|
+
(coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + ' ' +
|
|
371
|
+
(coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) +
|
|
372
|
+
' A ' +
|
|
373
|
+
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
374
|
+
(coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
375
|
+
} else {
|
|
376
|
+
pathString += ' A ' +
|
|
377
|
+
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
378
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
379
|
+
' L ' +
|
|
380
|
+
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
381
|
+
' A ' +
|
|
382
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
383
|
+
(coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
pathString += ' L ' +
|
|
387
|
+
(coords.leftFullExtent + offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +
|
|
388
|
+
' A ' +
|
|
389
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
390
|
+
coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +
|
|
391
|
+
' L ' +
|
|
392
|
+
coords.sourceX + ' ' + (coords.sourceY + offset) +
|
|
393
|
+
|
|
394
|
+
// Walking back
|
|
395
|
+
' L ' +
|
|
396
|
+
coords.sourceX + ' ' + (coords.sourceY - offset) +
|
|
397
|
+
' L ' +
|
|
398
|
+
coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +
|
|
399
|
+
' A ' +
|
|
400
|
+
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 0 ' +
|
|
401
|
+
(coords.leftFullExtent - offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +
|
|
402
|
+
' L ' +
|
|
403
|
+
(coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
404
|
+
|
|
405
|
+
if (isSourceBeforeTarget && isPathOverlapped) {
|
|
406
|
+
pathString += ' A ' +
|
|
407
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 0 ' +
|
|
408
|
+
(coords.leftFullExtent - offset) + ' ' + (coords.verticalFullExtent + offset) +
|
|
409
|
+
'L' + (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
410
|
+
' A ' +
|
|
411
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 0 ' +
|
|
412
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
413
|
+
} else if (isSourceBeforeTarget) {
|
|
414
|
+
pathString += ' A ' +
|
|
415
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
416
|
+
(coords.leftFullExtent + offset) + ' ' + (coords.verticalFullExtent - offset) +
|
|
417
|
+
' L ' +
|
|
418
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
419
|
+
' A ' +
|
|
420
|
+
(coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
421
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
422
|
+
} else {
|
|
423
|
+
pathString += ' A ' +
|
|
424
|
+
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
425
|
+
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
426
|
+
' L ' +
|
|
427
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
428
|
+
' A ' +
|
|
429
|
+
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
430
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
pathString += ' L ' +
|
|
434
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
435
|
+
' A ' +
|
|
436
|
+
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
|
|
437
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
438
|
+
' L ' +
|
|
439
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
440
|
+
(arrowLen > 0 ? ' L ' + coords.targetX + ' ' + coords.targetY : '') +
|
|
441
|
+
'Z';
|
|
394
442
|
} else {
|
|
395
|
-
// Bottom path
|
|
396
443
|
pathString =
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
444
|
+
'M ' + (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
|
|
445
|
+
' L ' + (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
446
|
+
' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' + (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
447
|
+
' L ' + (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
448
|
+
|
|
449
|
+
if (isSourceBeforeTarget && isPathOverlapped) {
|
|
450
|
+
pathString += ' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
|
|
451
|
+
(coords.rightInnerExtent - offset - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
452
|
+
' L ' + (coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + ' ' + (coords.verticalFullExtent + offset) +
|
|
453
|
+
' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
|
|
454
|
+
(coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
455
|
+
} else if (isSourceBeforeTarget) {
|
|
456
|
+
pathString += ' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
457
|
+
(coords.rightFullExtent - arrowLen - offset - (coords.rightLargeArcRadius - offset)) + ' ' + (coords.verticalFullExtent - offset) +
|
|
458
|
+
' L ' + (coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + ' ' + (coords.verticalFullExtent - offset) +
|
|
459
|
+
' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
460
|
+
(coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
461
|
+
} else {
|
|
462
|
+
pathString += ' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' + (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
463
|
+
' L ' + coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
464
|
+
' A ' + (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 0 ' + (coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
pathString += ' L ' + (coords.leftFullExtent + offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +
|
|
468
|
+
' A ' + (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 0 ' + coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +
|
|
469
|
+
' L ' + coords.sourceX + ' ' + (coords.sourceY - offset) +
|
|
470
|
+
|
|
471
|
+
// Walking back
|
|
472
|
+
' L ' + coords.sourceX + ' ' + (coords.sourceY + offset) +
|
|
473
|
+
' L ' + coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +
|
|
474
|
+
' A ' + (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 1 ' + (coords.leftFullExtent - offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +
|
|
475
|
+
' L ' + (coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent;
|
|
476
|
+
|
|
477
|
+
if (isSourceBeforeTarget && isPathOverlapped) {
|
|
478
|
+
pathString +=
|
|
479
|
+
' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
480
|
+
(coords.leftFullExtent - offset - (coords.rightLargeArcRadius - offset)) + ' ' + (coords.verticalFullExtent - offset) +
|
|
481
|
+
' L ' + (coords.rightFullExtent + offset - arrowLen + (coords.rightLargeArcRadius - offset)) + ' ' + (coords.verticalFullExtent - offset) +
|
|
482
|
+
' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
483
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
484
|
+
} else if (isSourceBeforeTarget) {
|
|
485
|
+
pathString += ' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' + (coords.leftFullExtent + offset) + ' ' + (coords.verticalFullExtent + offset) +
|
|
486
|
+
' L ' + (coords.rightFullExtent - arrowLen - offset) + ' ' + (coords.verticalFullExtent + offset) +
|
|
487
|
+
' A ' + (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' + (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
488
|
+
} else {
|
|
489
|
+
pathString += ' A ' + (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' + coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
490
|
+
' L ' + (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
491
|
+
' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' + (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
pathString += ' L ' + (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
495
|
+
' A ' + (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' + (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
496
|
+
' L ' + (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + (arrowLen > 0 ? ' L ' + coords.targetX + ' ' + coords.targetY : '') + 'Z';
|
|
450
497
|
}
|
|
451
498
|
return pathString;
|
|
452
499
|
}
|
package/src/version.js
CHANGED