plotly.js 2.13.1 → 2.14.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/dist/plotly.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js v2.13.1
2
+ * plotly.js v2.14.0
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -120599,6 +120599,10 @@ function draw(gd) {
120599
120599
  }
120600
120600
  }
120601
120601
 
120602
+ function couldHaveActiveSelection(gd) {
120603
+ return gd._context.editSelection;
120604
+ }
120605
+
120602
120606
  function drawOne(gd, index) {
120603
120607
  // remove the existing selection if there is one.
120604
120608
  // because indices can change, we need to look in all selection layers
@@ -120635,7 +120639,7 @@ function drawOne(gd, index) {
120635
120639
  lineDash = 'solid';
120636
120640
  }
120637
120641
 
120638
- var isActiveSelection =
120642
+ var isActiveSelection = couldHaveActiveSelection(gd) &&
120639
120643
  gd._fullLayout._activeSelectionIndex === index;
120640
120644
 
120641
120645
  if(isActiveSelection) {
@@ -120702,6 +120706,8 @@ function setClipPath(selectionPath, gd, selectionOptions) {
120702
120706
 
120703
120707
 
120704
120708
  function activateSelection(gd, path) {
120709
+ if(!couldHaveActiveSelection(gd)) return;
120710
+
120705
120711
  var element = path.node();
120706
120712
  var id = +element.getAttribute('data-index');
120707
120713
  if(id >= 0) {
@@ -120718,6 +120724,8 @@ function activateSelection(gd, path) {
120718
120724
  }
120719
120725
 
120720
120726
  function activateLastSelection(gd) {
120727
+ if(!couldHaveActiveSelection(gd)) return;
120728
+
120721
120729
  var id = gd._fullLayout.selections.length - 1;
120722
120730
  gd._fullLayout._activeSelectionIndex = id;
120723
120731
  gd._fullLayout._deactivateSelection = deactivateSelection;
@@ -120725,6 +120733,8 @@ function activateLastSelection(gd) {
120725
120733
  }
120726
120734
 
120727
120735
  function deactivateSelection(gd) {
120736
+ if(!couldHaveActiveSelection(gd)) return;
120737
+
120728
120738
  var id = gd._fullLayout._activeSelectionIndex;
120729
120739
  if(id >= 0) {
120730
120740
  clearOutlineControllers(gd);
@@ -121056,7 +121066,14 @@ var p2r = helpers.p2r;
121056
121066
  var axValue = helpers.axValue;
121057
121067
  var getTransform = helpers.getTransform;
121058
121068
 
121069
+ function hasSubplot(dragOptions) {
121070
+ // N.B. subplot may be falsy e.g zero sankey index!
121071
+ return dragOptions.subplot !== undefined;
121072
+ }
121073
+
121059
121074
  function prepSelect(evt, startX, startY, dragOptions, mode) {
121075
+ var isCartesian = !hasSubplot(dragOptions);
121076
+
121060
121077
  var isFreeMode = freeMode(mode);
121061
121078
  var isRectMode = rectMode(mode);
121062
121079
  var isOpenMode = openMode(mode);
@@ -121070,7 +121087,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121070
121087
  var gd = dragOptions.gd;
121071
121088
  var fullLayout = gd._fullLayout;
121072
121089
  var immediateSelect = isSelectMode && fullLayout.newselection.mode === 'immediate' &&
121073
- !dragOptions.subplot; // N.B. only cartesian subplots have persistent selection
121090
+ isCartesian; // N.B. only cartesian subplots have persistent selection
121074
121091
 
121075
121092
  var zoomLayer = fullLayout._zoomlayer;
121076
121093
  var dragBBox = dragOptions.element.getBoundingClientRect();
@@ -121118,9 +121135,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121118
121135
  opacity: isDrawMode ? newStyle.opacity / 2 : 1,
121119
121136
  fill: (isDrawMode && !isOpenMode) ? newStyle.fillcolor : 'none',
121120
121137
  stroke: newStyle.line.color || (
121121
- dragOptions.subplot !== undefined ?
121122
- '#7f7f7f' : // non-cartesian subplot
121123
- Color.contrast(gd._fullLayout.plot_bgcolor) // cartesian subplot
121138
+ isCartesian ?
121139
+ Color.contrast(gd._fullLayout.plot_bgcolor) :
121140
+ '#7f7f7f' // non-cartesian subplot
121124
121141
  ),
121125
121142
  'stroke-dasharray': dashStyle(newStyle.line.dash, newStyle.line.width),
121126
121143
  'stroke-width': newStyle.line.width + 'px',
@@ -121151,6 +121168,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121151
121168
 
121152
121169
  if(immediateSelect && !evt.shiftKey) {
121153
121170
  dragOptions._clearSubplotSelections = function() {
121171
+ if(!isCartesian) return;
121172
+
121154
121173
  var xRef = xAxis._id;
121155
121174
  var yRef = yAxis._id;
121156
121175
  deselectSubplot(gd, xRef, yRef, searchTraces);
@@ -121171,6 +121190,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121171
121190
  }
121172
121191
 
121173
121192
  if(selectionErased) {
121193
+ gd._fullLayout._noEmitSelectedAtStart = true;
121194
+
121174
121195
  Registry.call('_guiRelayout', gd, {
121175
121196
  selections: list
121176
121197
  });
@@ -121312,10 +121333,10 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121312
121333
  displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);
121313
121334
 
121314
121335
  if(isSelectMode) {
121315
- var _res = reselect(gd);
121336
+ var _res = reselect(gd, false);
121316
121337
  var extraPoints = _res.eventData ? _res.eventData.points.slice() : [];
121317
121338
 
121318
- _res = reselect(gd, selectionTesters, searchTraces, dragOptions);
121339
+ _res = reselect(gd, false, selectionTesters, searchTraces, dragOptions);
121319
121340
  selectionTesters = _res.selectionTesters;
121320
121341
  eventData = _res.eventData;
121321
121342
 
@@ -121409,9 +121430,13 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121409
121430
  }
121410
121431
  }
121411
121432
 
121412
- Registry.call('_guiRelayout', gd, {
121413
- selections: subSelections
121414
- });
121433
+ if(subSelections.length < allSelections.length) {
121434
+ gd._fullLayout._noEmitSelectedAtStart = true;
121435
+
121436
+ Registry.call('_guiRelayout', gd, {
121437
+ selections: subSelections
121438
+ });
121439
+ }
121415
121440
  }
121416
121441
  }
121417
121442
  } else {
@@ -121457,7 +121482,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121457
121482
  dragOptions.doneFnCompleted(selection);
121458
121483
  }
121459
121484
 
121460
- emitSelected(gd, eventData);
121485
+ if(isSelectMode) {
121486
+ emitSelected(gd, eventData);
121487
+ }
121461
121488
  }).catch(Lib.error);
121462
121489
  };
121463
121490
  }
@@ -121679,15 +121706,23 @@ function coerceSelectionsCache(evt, gd, dragOptions) {
121679
121706
  }
121680
121707
  }
121681
121708
 
121709
+ function hasActiveShape(gd) {
121710
+ return gd._fullLayout._activeShapeIndex >= 0;
121711
+ }
121712
+
121713
+ function hasActiveSelection(gd) {
121714
+ return gd._fullLayout._activeSelectionIndex >= 0;
121715
+ }
121716
+
121682
121717
  function clearSelectionsCache(dragOptions, immediateSelect) {
121683
121718
  var dragmode = dragOptions.dragmode;
121684
121719
  var plotinfo = dragOptions.plotinfo;
121685
121720
 
121686
121721
  var gd = dragOptions.gd;
121687
- if(gd._fullLayout._activeShapeIndex >= 0) {
121722
+ if(hasActiveShape(gd)) {
121688
121723
  gd._fullLayout._deactivateShape(gd);
121689
121724
  }
121690
- if(gd._fullLayout._activeSelectionIndex >= 0) {
121725
+ if(hasActiveSelection(gd)) {
121691
121726
  gd._fullLayout._deactivateSelection(gd);
121692
121727
  }
121693
121728
 
@@ -121715,11 +121750,13 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
121715
121750
  var selections;
121716
121751
  if(
121717
121752
  isSelectMode &&
121718
- !dragOptions.subplot // only allow cartesian - no mapbox for now
121753
+ !hasSubplot(dragOptions) // only allow cartesian - no mapbox for now
121719
121754
  ) {
121720
121755
  selections = newSelections(outlines, dragOptions);
121721
121756
  }
121722
121757
  if(selections) {
121758
+ gd._fullLayout._noEmitSelectedAtStart = true;
121759
+
121723
121760
  Registry.call('_guiRelayout', gd, {
121724
121761
  selections: selections
121725
121762
  }).then(function() {
@@ -121754,7 +121791,10 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) {
121754
121791
 
121755
121792
  if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;
121756
121793
 
121757
- if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {
121794
+ if(
121795
+ hasSubplot({subplot: subplot}) &&
121796
+ (trace.subplot === subplot || trace.geo === subplot)
121797
+ ) {
121758
121798
  searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));
121759
121799
  } else if(trace.type === 'splom') {
121760
121800
  // FIXME: make sure we don't have more than single axis for splom
@@ -122054,7 +122094,7 @@ function _doSelect(selectionTesters, searchTraces) {
122054
122094
  return allSelections;
122055
122095
  }
122056
122096
 
122057
- function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122097
+ function reselect(gd, mayEmitSelected, selectionTesters, searchTraces, dragOptions) {
122058
122098
  var hadSearchTraces = !!searchTraces;
122059
122099
  var plotinfo, xRef, yRef;
122060
122100
  if(dragOptions) {
@@ -122177,15 +122217,15 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122177
122217
  updateSelectedState(gd, allSearchTraces, eventData);
122178
122218
 
122179
122219
  var clickmode = fullLayout.clickmode;
122180
- var sendEvents = clickmode.indexOf('event') > -1;
122220
+ var sendEvents = clickmode.indexOf('event') > -1 && mayEmitSelected;
122181
122221
 
122182
122222
  if(
122183
122223
  !plotinfo && // get called from plot_api & plots
122184
- fullLayout._reselect
122224
+ mayEmitSelected
122185
122225
  ) {
122186
- if(sendEvents) {
122187
- var activePolygons = getLayoutPolygons(gd, true);
122226
+ var activePolygons = getLayoutPolygons(gd, true);
122188
122227
 
122228
+ if(activePolygons.length) {
122189
122229
  var xref = activePolygons[0].xref;
122190
122230
  var yref = activePolygons[0].yref;
122191
122231
  if(xref && yref) {
@@ -122198,8 +122238,12 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122198
122238
 
122199
122239
  fillRangeItems(eventData, poly);
122200
122240
  }
122241
+ }
122201
122242
 
122202
- emitSelected(gd, eventData);
122243
+ if(gd._fullLayout._noEmitSelectedAtStart) {
122244
+ gd._fullLayout._noEmitSelectedAtStart = false;
122245
+ } else {
122246
+ if(sendEvents) emitSelected(gd, eventData);
122203
122247
  }
122204
122248
 
122205
122249
  fullLayout._reselect = false;
@@ -122221,7 +122265,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122221
122265
  if(eventData.points.length) {
122222
122266
  emitSelected(gd, eventData);
122223
122267
  } else {
122224
- gd.emit('plotly_deselect', null);
122268
+ emitDeselect(gd);
122225
122269
  }
122226
122270
  }
122227
122271
 
@@ -122509,13 +122553,10 @@ function getFillRangeItems(dragOptions) {
122509
122553
  }
122510
122554
 
122511
122555
  function emitSelecting(gd, eventData) {
122512
- if(drawMode(gd._fullLayout.dragmode)) return;
122513
122556
  gd.emit('plotly_selecting', eventData);
122514
122557
  }
122515
122558
 
122516
122559
  function emitSelected(gd, eventData) {
122517
- if(drawMode(gd._fullLayout.dragmode)) return;
122518
-
122519
122560
  if(eventData) {
122520
122561
  eventData.selections = (gd.layout || {}).selections || [];
122521
122562
  }
@@ -122524,7 +122565,6 @@ function emitSelected(gd, eventData) {
122524
122565
  }
122525
122566
 
122526
122567
  function emitDeselect(gd) {
122527
- if(drawMode(gd._fullLayout.dragmode)) return;
122528
122568
  gd.emit('plotly_deselect', null);
122529
122569
  }
122530
122570
 
@@ -140778,6 +140818,11 @@ var configAttributes = {
140778
140818
  }
140779
140819
  },
140780
140820
 
140821
+ editSelection: {
140822
+ valType: 'boolean',
140823
+ dflt: true,
140824
+ },
140825
+
140781
140826
  autosizable: {
140782
140827
  valType: 'boolean',
140783
140828
  dflt: false,
@@ -167226,7 +167271,16 @@ plots.redrag = function(gd) {
167226
167271
  };
167227
167272
 
167228
167273
  plots.reselect = function(gd) {
167229
- Registry.getComponentMethod('selections', 'reselect')(gd);
167274
+ var fullLayout = gd._fullLayout;
167275
+
167276
+ var A = (gd.layout || {}).selections;
167277
+ var B = fullLayout._previousSelections;
167278
+ fullLayout._previousSelections = A;
167279
+
167280
+ var mayEmitSelected = fullLayout._reselect ||
167281
+ JSON.stringify(A) !== JSON.stringify(B);
167282
+
167283
+ Registry.getComponentMethod('selections', 'reselect')(gd, mayEmitSelected);
167230
167284
  };
167231
167285
 
167232
167286
  plots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {
@@ -204452,6 +204506,11 @@ var attrs = module.exports = overrideAll({
204452
204506
  },
204453
204507
 
204454
204508
  link: {
204509
+ arrowlen: {
204510
+ valType: 'number',
204511
+ min: 0,
204512
+ dflt: 0,
204513
+ },
204455
204514
  label: {
204456
204515
  valType: 'data_array',
204457
204516
  dflt: [],
@@ -204572,6 +204631,7 @@ function subplotUpdateFx(gd, index) {
204572
204631
  var dragMode = fullLayout.dragmode;
204573
204632
  var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';
204574
204633
  var bgRect = trace._bgRect;
204634
+ if(!bgRect) return;
204575
204635
 
204576
204636
  if(dragMode === 'pan' || dragMode === 'zoom') return;
204577
204637
 
@@ -204911,6 +204971,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
204911
204971
  return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);
204912
204972
  }
204913
204973
  coerceLink('label');
204974
+ coerceLink('arrowlen');
204914
204975
  coerceLink('source');
204915
204976
  coerceLink('target');
204916
204977
  coerceLink('value');
@@ -205623,6 +205684,7 @@ function sankeyModel(layout, d, traceIndex) {
205623
205684
  nodeLineWidth: trace.node.line.width,
205624
205685
  linkLineColor: trace.link.line.color,
205625
205686
  linkLineWidth: trace.link.line.width,
205687
+ linkArrowLength: trace.link.arrowlen,
205626
205688
  valueFormat: trace.valueformat,
205627
205689
  valueSuffix: trace.valuesuffix,
205628
205690
  textFont: trace.textfont,
@@ -205661,6 +205723,7 @@ function linkModel(d, l, i) {
205661
205723
  linkPath: linkPath,
205662
205724
  linkLineColor: d.linkLineColor,
205663
205725
  linkLineWidth: d.linkLineWidth,
205726
+ linkArrowLength: d.linkArrowLength,
205664
205727
  valueFormat: d.valueFormat,
205665
205728
  valueSuffix: d.valueSuffix,
205666
205729
  sankey: d.sankey,
@@ -205670,7 +205733,7 @@ function linkModel(d, l, i) {
205670
205733
  };
205671
205734
  }
205672
205735
 
205673
- function createCircularClosedPathString(link) {
205736
+ function createCircularClosedPathString(link, arrowLen) {
205674
205737
  // Using coordinates computed by d3-sankey-circular
205675
205738
  var pathString = '';
205676
205739
  var offset = link.width / 2;
@@ -205680,17 +205743,17 @@ function createCircularClosedPathString(link) {
205680
205743
  pathString =
205681
205744
  // start at the left of the target node
205682
205745
  'M ' +
205683
- coords.targetX + ' ' + (coords.targetY + offset) + ' ' +
205746
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
205684
205747
  'L' +
205685
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
205748
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
205686
205749
  'A' +
205687
205750
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
205688
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
205751
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
205689
205752
  'L' +
205690
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
205753
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
205691
205754
  'A' +
205692
205755
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
205693
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
205756
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
205694
205757
  'L' +
205695
205758
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
205696
205759
  'A' +
@@ -205718,34 +205781,35 @@ function createCircularClosedPathString(link) {
205718
205781
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
205719
205782
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
205720
205783
  'L' +
205721
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
205784
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
205722
205785
  'A' +
205723
205786
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
205724
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
205787
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
205725
205788
  'L' +
205726
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
205789
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
205727
205790
  'A' +
205728
205791
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
205729
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
205792
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
205730
205793
  'L' +
205731
- coords.targetX + ' ' + (coords.targetY - offset) +
205794
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
205795
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
205732
205796
  'Z';
205733
205797
  } else {
205734
205798
  // Bottom path
205735
205799
  pathString =
205736
205800
  // start at the left of the target node
205737
205801
  'M ' +
205738
- coords.targetX + ' ' + (coords.targetY - offset) + ' ' +
205802
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
205739
205803
  'L' +
205740
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
205804
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
205741
205805
  'A' +
205742
205806
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
205743
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
205807
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
205744
205808
  'L' +
205745
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
205809
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
205746
205810
  'A' +
205747
205811
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
205748
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
205812
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
205749
205813
  'L' +
205750
205814
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
205751
205815
  'A' +
@@ -205773,17 +205837,18 @@ function createCircularClosedPathString(link) {
205773
205837
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
205774
205838
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
205775
205839
  'L' +
205776
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
205840
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
205777
205841
  'A' +
205778
205842
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
205779
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
205843
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
205780
205844
  'L' +
205781
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
205845
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
205782
205846
  'A' +
205783
205847
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
205784
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
205848
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
205785
205849
  'L' +
205786
- coords.targetX + ' ' + (coords.targetY + offset) +
205850
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
205851
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
205787
205852
  'Z';
205788
205853
  }
205789
205854
  return pathString;
@@ -205792,11 +205857,16 @@ function createCircularClosedPathString(link) {
205792
205857
  function linkPath() {
205793
205858
  var curvature = 0.5;
205794
205859
  function path(d) {
205860
+ var arrowLen = d.linkArrowLength;
205795
205861
  if(d.link.circular) {
205796
- return createCircularClosedPathString(d.link);
205862
+ return createCircularClosedPathString(d.link, arrowLen);
205797
205863
  } else {
205864
+ var maxArrowLength = Math.abs((d.link.target.x0 - d.link.source.x1) / 2);
205865
+ if(arrowLen > maxArrowLength) {
205866
+ arrowLen = maxArrowLength;
205867
+ }
205798
205868
  var x0 = d.link.source.x1;
205799
- var x1 = d.link.target.x0;
205869
+ var x1 = d.link.target.x0 - arrowLen;
205800
205870
  var xi = interpolateNumber(x0, x1);
205801
205871
  var x2 = xi(curvature);
205802
205872
  var x3 = xi(1 - curvature);
@@ -205804,15 +205874,17 @@ function linkPath() {
205804
205874
  var y0b = d.link.y0 + d.link.width / 2;
205805
205875
  var y1a = d.link.y1 - d.link.width / 2;
205806
205876
  var y1b = d.link.y1 + d.link.width / 2;
205807
- return 'M' + x0 + ',' + y0a +
205808
- 'C' + x2 + ',' + y0a +
205809
- ' ' + x3 + ',' + y1a +
205810
- ' ' + x1 + ',' + y1a +
205811
- 'L' + x1 + ',' + y1b +
205812
- 'C' + x3 + ',' + y1b +
205813
- ' ' + x2 + ',' + y0b +
205814
- ' ' + x0 + ',' + y0b +
205815
- 'Z';
205877
+ var start = 'M' + x0 + ',' + y0a;
205878
+ var upperCurve = 'C' + x2 + ',' + y0a +
205879
+ ' ' + x3 + ',' + y1a +
205880
+ ' ' + x1 + ',' + y1a;
205881
+ var lowerCurve = 'C' + x3 + ',' + y1b +
205882
+ ' ' + x2 + ',' + y0b +
205883
+ ' ' + x0 + ',' + y0b;
205884
+
205885
+ var rightEnd = arrowLen > 0 ? 'L' + (x1 + arrowLen) + ',' + (y1a + d.link.width / 2) : '';
205886
+ rightEnd += 'L' + x1 + ',' + y1b;
205887
+ return start + upperCurve + rightEnd + lowerCurve + 'Z';
205816
205888
  }
205817
205889
  }
205818
205890
  return path;
@@ -226279,7 +226351,7 @@ function getSortFunc(opts, d2c) {
226279
226351
  'use strict';
226280
226352
 
226281
226353
  // package version injected by `npm run preprocess`
226282
- exports.version = '2.13.1';
226354
+ exports.version = '2.14.0';
226283
226355
 
226284
226356
  },{}],1133:[function(_dereq_,module,exports){
226285
226357
  (function (global){(function (){