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.
@@ -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:323
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotly.js",
3
- "version": "3.0.0-rc.1",
3
+ "version": "3.0.0",
4
4
  "description": "The open source javascript graphing library that powers plotly",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",
@@ -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
- for(var i = 0; i < cd.length; i++) {
64
- var newDistance = distfn(cd[i]);
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
- document.querySelectorAll(selector).forEach(function(el) {
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.
@@ -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
- if(link.circularLinkType === 'top') {
339
- // Top path
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
- // start at the left of the target node
342
- 'M ' +
343
- (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
344
- 'L' +
345
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
346
- 'A' +
347
- (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
348
- (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
349
- 'L' +
350
- (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
351
- 'A' +
352
- (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
353
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
354
- 'L' +
355
- coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
356
- 'A' +
357
- (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 1 ' +
358
- (coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent +
359
- 'L' +
360
- (coords.leftFullExtent + offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +
361
- 'A' +
362
- (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 1 ' +
363
- coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +
364
- 'L' +
365
- coords.sourceX + ' ' + (coords.sourceY + offset) +
366
-
367
- // Walking back
368
- 'L' +
369
- coords.sourceX + ' ' + (coords.sourceY - offset) +
370
- 'L' +
371
- coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +
372
- 'A' +
373
- (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 0 ' +
374
- (coords.leftFullExtent - offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +
375
- 'L' +
376
- (coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent +
377
- 'A' +
378
- (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
379
- coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
380
- 'L' +
381
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
382
- 'A' +
383
- (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
384
- (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
385
- 'L' +
386
- (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
387
- 'A' +
388
- (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
389
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
390
- 'L' +
391
- (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
392
- (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
393
- 'Z';
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
- // start at the left of the target node
398
- 'M ' +
399
- (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
400
- 'L' +
401
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
402
- 'A' +
403
- (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
404
- (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
405
- 'L' +
406
- (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
407
- 'A' +
408
- (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
409
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
410
- 'L' +
411
- coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
412
- 'A' +
413
- (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 0 ' +
414
- (coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent +
415
- 'L' +
416
- (coords.leftFullExtent + offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +
417
- 'A' +
418
- (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 0 ' +
419
- coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +
420
- 'L' +
421
- coords.sourceX + ' ' + (coords.sourceY - offset) +
422
-
423
- // Walking back
424
- 'L' +
425
- coords.sourceX + ' ' + (coords.sourceY + offset) +
426
- 'L' +
427
- coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +
428
- 'A' +
429
- (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 1 ' +
430
- (coords.leftFullExtent - offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +
431
- 'L' +
432
- (coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent +
433
- 'A' +
434
- (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
435
- coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
436
- 'L' +
437
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
438
- 'A' +
439
- (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
440
- (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
441
- 'L' +
442
- (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
443
- 'A' +
444
- (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
445
- (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
446
- 'L' +
447
- (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
448
- (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
449
- 'Z';
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
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
 
3
3
  // package version injected by `npm run preprocess`
4
- exports.version = '3.0.0-rc.1';
4
+ exports.version = '3.0.0';