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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js (strict) v2.13.1
2
+ * plotly.js (strict) v2.14.0
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -120579,6 +120579,10 @@ function draw(gd) {
120579
120579
  }
120580
120580
  }
120581
120581
 
120582
+ function couldHaveActiveSelection(gd) {
120583
+ return gd._context.editSelection;
120584
+ }
120585
+
120582
120586
  function drawOne(gd, index) {
120583
120587
  // remove the existing selection if there is one.
120584
120588
  // because indices can change, we need to look in all selection layers
@@ -120615,7 +120619,7 @@ function drawOne(gd, index) {
120615
120619
  lineDash = 'solid';
120616
120620
  }
120617
120621
 
120618
- var isActiveSelection =
120622
+ var isActiveSelection = couldHaveActiveSelection(gd) &&
120619
120623
  gd._fullLayout._activeSelectionIndex === index;
120620
120624
 
120621
120625
  if(isActiveSelection) {
@@ -120682,6 +120686,8 @@ function setClipPath(selectionPath, gd, selectionOptions) {
120682
120686
 
120683
120687
 
120684
120688
  function activateSelection(gd, path) {
120689
+ if(!couldHaveActiveSelection(gd)) return;
120690
+
120685
120691
  var element = path.node();
120686
120692
  var id = +element.getAttribute('data-index');
120687
120693
  if(id >= 0) {
@@ -120698,6 +120704,8 @@ function activateSelection(gd, path) {
120698
120704
  }
120699
120705
 
120700
120706
  function activateLastSelection(gd) {
120707
+ if(!couldHaveActiveSelection(gd)) return;
120708
+
120701
120709
  var id = gd._fullLayout.selections.length - 1;
120702
120710
  gd._fullLayout._activeSelectionIndex = id;
120703
120711
  gd._fullLayout._deactivateSelection = deactivateSelection;
@@ -120705,6 +120713,8 @@ function activateLastSelection(gd) {
120705
120713
  }
120706
120714
 
120707
120715
  function deactivateSelection(gd) {
120716
+ if(!couldHaveActiveSelection(gd)) return;
120717
+
120708
120718
  var id = gd._fullLayout._activeSelectionIndex;
120709
120719
  if(id >= 0) {
120710
120720
  clearOutlineControllers(gd);
@@ -121036,7 +121046,14 @@ var p2r = helpers.p2r;
121036
121046
  var axValue = helpers.axValue;
121037
121047
  var getTransform = helpers.getTransform;
121038
121048
 
121049
+ function hasSubplot(dragOptions) {
121050
+ // N.B. subplot may be falsy e.g zero sankey index!
121051
+ return dragOptions.subplot !== undefined;
121052
+ }
121053
+
121039
121054
  function prepSelect(evt, startX, startY, dragOptions, mode) {
121055
+ var isCartesian = !hasSubplot(dragOptions);
121056
+
121040
121057
  var isFreeMode = freeMode(mode);
121041
121058
  var isRectMode = rectMode(mode);
121042
121059
  var isOpenMode = openMode(mode);
@@ -121050,7 +121067,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121050
121067
  var gd = dragOptions.gd;
121051
121068
  var fullLayout = gd._fullLayout;
121052
121069
  var immediateSelect = isSelectMode && fullLayout.newselection.mode === 'immediate' &&
121053
- !dragOptions.subplot; // N.B. only cartesian subplots have persistent selection
121070
+ isCartesian; // N.B. only cartesian subplots have persistent selection
121054
121071
 
121055
121072
  var zoomLayer = fullLayout._zoomlayer;
121056
121073
  var dragBBox = dragOptions.element.getBoundingClientRect();
@@ -121098,9 +121115,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121098
121115
  opacity: isDrawMode ? newStyle.opacity / 2 : 1,
121099
121116
  fill: (isDrawMode && !isOpenMode) ? newStyle.fillcolor : 'none',
121100
121117
  stroke: newStyle.line.color || (
121101
- dragOptions.subplot !== undefined ?
121102
- '#7f7f7f' : // non-cartesian subplot
121103
- Color.contrast(gd._fullLayout.plot_bgcolor) // cartesian subplot
121118
+ isCartesian ?
121119
+ Color.contrast(gd._fullLayout.plot_bgcolor) :
121120
+ '#7f7f7f' // non-cartesian subplot
121104
121121
  ),
121105
121122
  'stroke-dasharray': dashStyle(newStyle.line.dash, newStyle.line.width),
121106
121123
  'stroke-width': newStyle.line.width + 'px',
@@ -121131,6 +121148,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121131
121148
 
121132
121149
  if(immediateSelect && !evt.shiftKey) {
121133
121150
  dragOptions._clearSubplotSelections = function() {
121151
+ if(!isCartesian) return;
121152
+
121134
121153
  var xRef = xAxis._id;
121135
121154
  var yRef = yAxis._id;
121136
121155
  deselectSubplot(gd, xRef, yRef, searchTraces);
@@ -121151,6 +121170,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121151
121170
  }
121152
121171
 
121153
121172
  if(selectionErased) {
121173
+ gd._fullLayout._noEmitSelectedAtStart = true;
121174
+
121154
121175
  Registry.call('_guiRelayout', gd, {
121155
121176
  selections: list
121156
121177
  });
@@ -121292,10 +121313,10 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121292
121313
  displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);
121293
121314
 
121294
121315
  if(isSelectMode) {
121295
- var _res = reselect(gd);
121316
+ var _res = reselect(gd, false);
121296
121317
  var extraPoints = _res.eventData ? _res.eventData.points.slice() : [];
121297
121318
 
121298
- _res = reselect(gd, selectionTesters, searchTraces, dragOptions);
121319
+ _res = reselect(gd, false, selectionTesters, searchTraces, dragOptions);
121299
121320
  selectionTesters = _res.selectionTesters;
121300
121321
  eventData = _res.eventData;
121301
121322
 
@@ -121389,9 +121410,13 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121389
121410
  }
121390
121411
  }
121391
121412
 
121392
- Registry.call('_guiRelayout', gd, {
121393
- selections: subSelections
121394
- });
121413
+ if(subSelections.length < allSelections.length) {
121414
+ gd._fullLayout._noEmitSelectedAtStart = true;
121415
+
121416
+ Registry.call('_guiRelayout', gd, {
121417
+ selections: subSelections
121418
+ });
121419
+ }
121395
121420
  }
121396
121421
  }
121397
121422
  } else {
@@ -121437,7 +121462,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
121437
121462
  dragOptions.doneFnCompleted(selection);
121438
121463
  }
121439
121464
 
121440
- emitSelected(gd, eventData);
121465
+ if(isSelectMode) {
121466
+ emitSelected(gd, eventData);
121467
+ }
121441
121468
  }).catch(Lib.error);
121442
121469
  };
121443
121470
  }
@@ -121659,15 +121686,23 @@ function coerceSelectionsCache(evt, gd, dragOptions) {
121659
121686
  }
121660
121687
  }
121661
121688
 
121689
+ function hasActiveShape(gd) {
121690
+ return gd._fullLayout._activeShapeIndex >= 0;
121691
+ }
121692
+
121693
+ function hasActiveSelection(gd) {
121694
+ return gd._fullLayout._activeSelectionIndex >= 0;
121695
+ }
121696
+
121662
121697
  function clearSelectionsCache(dragOptions, immediateSelect) {
121663
121698
  var dragmode = dragOptions.dragmode;
121664
121699
  var plotinfo = dragOptions.plotinfo;
121665
121700
 
121666
121701
  var gd = dragOptions.gd;
121667
- if(gd._fullLayout._activeShapeIndex >= 0) {
121702
+ if(hasActiveShape(gd)) {
121668
121703
  gd._fullLayout._deactivateShape(gd);
121669
121704
  }
121670
- if(gd._fullLayout._activeSelectionIndex >= 0) {
121705
+ if(hasActiveSelection(gd)) {
121671
121706
  gd._fullLayout._deactivateSelection(gd);
121672
121707
  }
121673
121708
 
@@ -121695,11 +121730,13 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
121695
121730
  var selections;
121696
121731
  if(
121697
121732
  isSelectMode &&
121698
- !dragOptions.subplot // only allow cartesian - no mapbox for now
121733
+ !hasSubplot(dragOptions) // only allow cartesian - no mapbox for now
121699
121734
  ) {
121700
121735
  selections = newSelections(outlines, dragOptions);
121701
121736
  }
121702
121737
  if(selections) {
121738
+ gd._fullLayout._noEmitSelectedAtStart = true;
121739
+
121703
121740
  Registry.call('_guiRelayout', gd, {
121704
121741
  selections: selections
121705
121742
  }).then(function() {
@@ -121734,7 +121771,10 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) {
121734
121771
 
121735
121772
  if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;
121736
121773
 
121737
- if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {
121774
+ if(
121775
+ hasSubplot({subplot: subplot}) &&
121776
+ (trace.subplot === subplot || trace.geo === subplot)
121777
+ ) {
121738
121778
  searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));
121739
121779
  } else if(trace.type === 'splom') {
121740
121780
  // FIXME: make sure we don't have more than single axis for splom
@@ -122034,7 +122074,7 @@ function _doSelect(selectionTesters, searchTraces) {
122034
122074
  return allSelections;
122035
122075
  }
122036
122076
 
122037
- function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122077
+ function reselect(gd, mayEmitSelected, selectionTesters, searchTraces, dragOptions) {
122038
122078
  var hadSearchTraces = !!searchTraces;
122039
122079
  var plotinfo, xRef, yRef;
122040
122080
  if(dragOptions) {
@@ -122157,15 +122197,15 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122157
122197
  updateSelectedState(gd, allSearchTraces, eventData);
122158
122198
 
122159
122199
  var clickmode = fullLayout.clickmode;
122160
- var sendEvents = clickmode.indexOf('event') > -1;
122200
+ var sendEvents = clickmode.indexOf('event') > -1 && mayEmitSelected;
122161
122201
 
122162
122202
  if(
122163
122203
  !plotinfo && // get called from plot_api & plots
122164
- fullLayout._reselect
122204
+ mayEmitSelected
122165
122205
  ) {
122166
- if(sendEvents) {
122167
- var activePolygons = getLayoutPolygons(gd, true);
122206
+ var activePolygons = getLayoutPolygons(gd, true);
122168
122207
 
122208
+ if(activePolygons.length) {
122169
122209
  var xref = activePolygons[0].xref;
122170
122210
  var yref = activePolygons[0].yref;
122171
122211
  if(xref && yref) {
@@ -122178,8 +122218,12 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122178
122218
 
122179
122219
  fillRangeItems(eventData, poly);
122180
122220
  }
122221
+ }
122181
122222
 
122182
- emitSelected(gd, eventData);
122223
+ if(gd._fullLayout._noEmitSelectedAtStart) {
122224
+ gd._fullLayout._noEmitSelectedAtStart = false;
122225
+ } else {
122226
+ if(sendEvents) emitSelected(gd, eventData);
122183
122227
  }
122184
122228
 
122185
122229
  fullLayout._reselect = false;
@@ -122201,7 +122245,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
122201
122245
  if(eventData.points.length) {
122202
122246
  emitSelected(gd, eventData);
122203
122247
  } else {
122204
- gd.emit('plotly_deselect', null);
122248
+ emitDeselect(gd);
122205
122249
  }
122206
122250
  }
122207
122251
 
@@ -122489,13 +122533,10 @@ function getFillRangeItems(dragOptions) {
122489
122533
  }
122490
122534
 
122491
122535
  function emitSelecting(gd, eventData) {
122492
- if(drawMode(gd._fullLayout.dragmode)) return;
122493
122536
  gd.emit('plotly_selecting', eventData);
122494
122537
  }
122495
122538
 
122496
122539
  function emitSelected(gd, eventData) {
122497
- if(drawMode(gd._fullLayout.dragmode)) return;
122498
-
122499
122540
  if(eventData) {
122500
122541
  eventData.selections = (gd.layout || {}).selections || [];
122501
122542
  }
@@ -122504,7 +122545,6 @@ function emitSelected(gd, eventData) {
122504
122545
  }
122505
122546
 
122506
122547
  function emitDeselect(gd) {
122507
- if(drawMode(gd._fullLayout.dragmode)) return;
122508
122548
  gd.emit('plotly_deselect', null);
122509
122549
  }
122510
122550
 
@@ -163700,6 +163740,11 @@ var configAttributes = {
163700
163740
  }
163701
163741
  },
163702
163742
 
163743
+ editSelection: {
163744
+ valType: 'boolean',
163745
+ dflt: true,
163746
+ },
163747
+
163703
163748
  autosizable: {
163704
163749
  valType: 'boolean',
163705
163750
  dflt: false,
@@ -190148,7 +190193,16 @@ plots.redrag = function(gd) {
190148
190193
  };
190149
190194
 
190150
190195
  plots.reselect = function(gd) {
190151
- Registry.getComponentMethod('selections', 'reselect')(gd);
190196
+ var fullLayout = gd._fullLayout;
190197
+
190198
+ var A = (gd.layout || {}).selections;
190199
+ var B = fullLayout._previousSelections;
190200
+ fullLayout._previousSelections = A;
190201
+
190202
+ var mayEmitSelected = fullLayout._reselect ||
190203
+ JSON.stringify(A) !== JSON.stringify(B);
190204
+
190205
+ Registry.getComponentMethod('selections', 'reselect')(gd, mayEmitSelected);
190152
190206
  };
190153
190207
 
190154
190208
  plots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {
@@ -227399,6 +227453,11 @@ var attrs = module.exports = overrideAll({
227399
227453
  },
227400
227454
 
227401
227455
  link: {
227456
+ arrowlen: {
227457
+ valType: 'number',
227458
+ min: 0,
227459
+ dflt: 0,
227460
+ },
227402
227461
  label: {
227403
227462
  valType: 'data_array',
227404
227463
  dflt: [],
@@ -227519,6 +227578,7 @@ function subplotUpdateFx(gd, index) {
227519
227578
  var dragMode = fullLayout.dragmode;
227520
227579
  var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';
227521
227580
  var bgRect = trace._bgRect;
227581
+ if(!bgRect) return;
227522
227582
 
227523
227583
  if(dragMode === 'pan' || dragMode === 'zoom') return;
227524
227584
 
@@ -227858,6 +227918,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
227858
227918
  return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);
227859
227919
  }
227860
227920
  coerceLink('label');
227921
+ coerceLink('arrowlen');
227861
227922
  coerceLink('source');
227862
227923
  coerceLink('target');
227863
227924
  coerceLink('value');
@@ -228570,6 +228631,7 @@ function sankeyModel(layout, d, traceIndex) {
228570
228631
  nodeLineWidth: trace.node.line.width,
228571
228632
  linkLineColor: trace.link.line.color,
228572
228633
  linkLineWidth: trace.link.line.width,
228634
+ linkArrowLength: trace.link.arrowlen,
228573
228635
  valueFormat: trace.valueformat,
228574
228636
  valueSuffix: trace.valuesuffix,
228575
228637
  textFont: trace.textfont,
@@ -228608,6 +228670,7 @@ function linkModel(d, l, i) {
228608
228670
  linkPath: linkPath,
228609
228671
  linkLineColor: d.linkLineColor,
228610
228672
  linkLineWidth: d.linkLineWidth,
228673
+ linkArrowLength: d.linkArrowLength,
228611
228674
  valueFormat: d.valueFormat,
228612
228675
  valueSuffix: d.valueSuffix,
228613
228676
  sankey: d.sankey,
@@ -228617,7 +228680,7 @@ function linkModel(d, l, i) {
228617
228680
  };
228618
228681
  }
228619
228682
 
228620
- function createCircularClosedPathString(link) {
228683
+ function createCircularClosedPathString(link, arrowLen) {
228621
228684
  // Using coordinates computed by d3-sankey-circular
228622
228685
  var pathString = '';
228623
228686
  var offset = link.width / 2;
@@ -228627,17 +228690,17 @@ function createCircularClosedPathString(link) {
228627
228690
  pathString =
228628
228691
  // start at the left of the target node
228629
228692
  'M ' +
228630
- coords.targetX + ' ' + (coords.targetY + offset) + ' ' +
228693
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
228631
228694
  'L' +
228632
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
228695
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
228633
228696
  'A' +
228634
228697
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
228635
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
228698
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
228636
228699
  'L' +
228637
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
228700
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
228638
228701
  'A' +
228639
228702
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
228640
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
228703
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
228641
228704
  'L' +
228642
228705
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
228643
228706
  'A' +
@@ -228665,34 +228728,35 @@ function createCircularClosedPathString(link) {
228665
228728
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
228666
228729
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
228667
228730
  'L' +
228668
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
228731
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
228669
228732
  'A' +
228670
228733
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
228671
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
228734
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
228672
228735
  'L' +
228673
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
228736
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
228674
228737
  'A' +
228675
228738
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
228676
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
228739
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
228677
228740
  'L' +
228678
- coords.targetX + ' ' + (coords.targetY - offset) +
228741
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
228742
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
228679
228743
  'Z';
228680
228744
  } else {
228681
228745
  // Bottom path
228682
228746
  pathString =
228683
228747
  // start at the left of the target node
228684
228748
  'M ' +
228685
- coords.targetX + ' ' + (coords.targetY - offset) + ' ' +
228749
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
228686
228750
  'L' +
228687
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
228751
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
228688
228752
  'A' +
228689
228753
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
228690
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
228754
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
228691
228755
  'L' +
228692
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
228756
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
228693
228757
  'A' +
228694
228758
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
228695
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
228759
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
228696
228760
  'L' +
228697
228761
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
228698
228762
  'A' +
@@ -228720,17 +228784,18 @@ function createCircularClosedPathString(link) {
228720
228784
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
228721
228785
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
228722
228786
  'L' +
228723
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
228787
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
228724
228788
  'A' +
228725
228789
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
228726
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
228790
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
228727
228791
  'L' +
228728
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
228792
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
228729
228793
  'A' +
228730
228794
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
228731
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
228795
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
228732
228796
  'L' +
228733
- coords.targetX + ' ' + (coords.targetY + offset) +
228797
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
228798
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
228734
228799
  'Z';
228735
228800
  }
228736
228801
  return pathString;
@@ -228739,11 +228804,16 @@ function createCircularClosedPathString(link) {
228739
228804
  function linkPath() {
228740
228805
  var curvature = 0.5;
228741
228806
  function path(d) {
228807
+ var arrowLen = d.linkArrowLength;
228742
228808
  if(d.link.circular) {
228743
- return createCircularClosedPathString(d.link);
228809
+ return createCircularClosedPathString(d.link, arrowLen);
228744
228810
  } else {
228811
+ var maxArrowLength = Math.abs((d.link.target.x0 - d.link.source.x1) / 2);
228812
+ if(arrowLen > maxArrowLength) {
228813
+ arrowLen = maxArrowLength;
228814
+ }
228745
228815
  var x0 = d.link.source.x1;
228746
- var x1 = d.link.target.x0;
228816
+ var x1 = d.link.target.x0 - arrowLen;
228747
228817
  var xi = interpolateNumber(x0, x1);
228748
228818
  var x2 = xi(curvature);
228749
228819
  var x3 = xi(1 - curvature);
@@ -228751,15 +228821,17 @@ function linkPath() {
228751
228821
  var y0b = d.link.y0 + d.link.width / 2;
228752
228822
  var y1a = d.link.y1 - d.link.width / 2;
228753
228823
  var y1b = d.link.y1 + d.link.width / 2;
228754
- return 'M' + x0 + ',' + y0a +
228755
- 'C' + x2 + ',' + y0a +
228756
- ' ' + x3 + ',' + y1a +
228757
- ' ' + x1 + ',' + y1a +
228758
- 'L' + x1 + ',' + y1b +
228759
- 'C' + x3 + ',' + y1b +
228760
- ' ' + x2 + ',' + y0b +
228761
- ' ' + x0 + ',' + y0b +
228762
- 'Z';
228824
+ var start = 'M' + x0 + ',' + y0a;
228825
+ var upperCurve = 'C' + x2 + ',' + y0a +
228826
+ ' ' + x3 + ',' + y1a +
228827
+ ' ' + x1 + ',' + y1a;
228828
+ var lowerCurve = 'C' + x3 + ',' + y1b +
228829
+ ' ' + x2 + ',' + y0b +
228830
+ ' ' + x0 + ',' + y0b;
228831
+
228832
+ var rightEnd = arrowLen > 0 ? 'L' + (x1 + arrowLen) + ',' + (y1a + d.link.width / 2) : '';
228833
+ rightEnd += 'L' + x1 + ',' + y1b;
228834
+ return start + upperCurve + rightEnd + lowerCurve + 'Z';
228763
228835
  }
228764
228836
  }
228765
228837
  return path;
@@ -249315,7 +249387,7 @@ function getSortFunc(opts, d2c) {
249315
249387
  'use strict';
249316
249388
 
249317
249389
  // package version injected by `npm run preprocess`
249318
- exports.version = '2.13.1';
249390
+ exports.version = '2.14.0';
249319
249391
 
249320
249392
  },{}],1151:[function(_dereq_,module,exports){
249321
249393
  (function (global){(function (){