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 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
@@ -121533,6 +121533,10 @@ function draw(gd) {
121533
121533
  }
121534
121534
  }
121535
121535
 
121536
+ function couldHaveActiveSelection(gd) {
121537
+ return gd._context.editSelection;
121538
+ }
121539
+
121536
121540
  function drawOne(gd, index) {
121537
121541
  // remove the existing selection if there is one.
121538
121542
  // because indices can change, we need to look in all selection layers
@@ -121569,7 +121573,7 @@ function drawOne(gd, index) {
121569
121573
  lineDash = 'solid';
121570
121574
  }
121571
121575
 
121572
- var isActiveSelection =
121576
+ var isActiveSelection = couldHaveActiveSelection(gd) &&
121573
121577
  gd._fullLayout._activeSelectionIndex === index;
121574
121578
 
121575
121579
  if(isActiveSelection) {
@@ -121636,6 +121640,8 @@ function setClipPath(selectionPath, gd, selectionOptions) {
121636
121640
 
121637
121641
 
121638
121642
  function activateSelection(gd, path) {
121643
+ if(!couldHaveActiveSelection(gd)) return;
121644
+
121639
121645
  var element = path.node();
121640
121646
  var id = +element.getAttribute('data-index');
121641
121647
  if(id >= 0) {
@@ -121652,6 +121658,8 @@ function activateSelection(gd, path) {
121652
121658
  }
121653
121659
 
121654
121660
  function activateLastSelection(gd) {
121661
+ if(!couldHaveActiveSelection(gd)) return;
121662
+
121655
121663
  var id = gd._fullLayout.selections.length - 1;
121656
121664
  gd._fullLayout._activeSelectionIndex = id;
121657
121665
  gd._fullLayout._deactivateSelection = deactivateSelection;
@@ -121659,6 +121667,8 @@ function activateLastSelection(gd) {
121659
121667
  }
121660
121668
 
121661
121669
  function deactivateSelection(gd) {
121670
+ if(!couldHaveActiveSelection(gd)) return;
121671
+
121662
121672
  var id = gd._fullLayout._activeSelectionIndex;
121663
121673
  if(id >= 0) {
121664
121674
  clearOutlineControllers(gd);
@@ -122005,7 +122015,14 @@ var p2r = helpers.p2r;
122005
122015
  var axValue = helpers.axValue;
122006
122016
  var getTransform = helpers.getTransform;
122007
122017
 
122018
+ function hasSubplot(dragOptions) {
122019
+ // N.B. subplot may be falsy e.g zero sankey index!
122020
+ return dragOptions.subplot !== undefined;
122021
+ }
122022
+
122008
122023
  function prepSelect(evt, startX, startY, dragOptions, mode) {
122024
+ var isCartesian = !hasSubplot(dragOptions);
122025
+
122009
122026
  var isFreeMode = freeMode(mode);
122010
122027
  var isRectMode = rectMode(mode);
122011
122028
  var isOpenMode = openMode(mode);
@@ -122019,7 +122036,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122019
122036
  var gd = dragOptions.gd;
122020
122037
  var fullLayout = gd._fullLayout;
122021
122038
  var immediateSelect = isSelectMode && fullLayout.newselection.mode === 'immediate' &&
122022
- !dragOptions.subplot; // N.B. only cartesian subplots have persistent selection
122039
+ isCartesian; // N.B. only cartesian subplots have persistent selection
122023
122040
 
122024
122041
  var zoomLayer = fullLayout._zoomlayer;
122025
122042
  var dragBBox = dragOptions.element.getBoundingClientRect();
@@ -122067,9 +122084,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122067
122084
  opacity: isDrawMode ? newStyle.opacity / 2 : 1,
122068
122085
  fill: (isDrawMode && !isOpenMode) ? newStyle.fillcolor : 'none',
122069
122086
  stroke: newStyle.line.color || (
122070
- dragOptions.subplot !== undefined ?
122071
- '#7f7f7f' : // non-cartesian subplot
122072
- Color.contrast(gd._fullLayout.plot_bgcolor) // cartesian subplot
122087
+ isCartesian ?
122088
+ Color.contrast(gd._fullLayout.plot_bgcolor) :
122089
+ '#7f7f7f' // non-cartesian subplot
122073
122090
  ),
122074
122091
  'stroke-dasharray': dashStyle(newStyle.line.dash, newStyle.line.width),
122075
122092
  'stroke-width': newStyle.line.width + 'px',
@@ -122100,6 +122117,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122100
122117
 
122101
122118
  if(immediateSelect && !evt.shiftKey) {
122102
122119
  dragOptions._clearSubplotSelections = function() {
122120
+ if(!isCartesian) return;
122121
+
122103
122122
  var xRef = xAxis._id;
122104
122123
  var yRef = yAxis._id;
122105
122124
  deselectSubplot(gd, xRef, yRef, searchTraces);
@@ -122120,6 +122139,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122120
122139
  }
122121
122140
 
122122
122141
  if(selectionErased) {
122142
+ gd._fullLayout._noEmitSelectedAtStart = true;
122143
+
122123
122144
  Registry.call('_guiRelayout', gd, {
122124
122145
  selections: list
122125
122146
  });
@@ -122261,10 +122282,10 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122261
122282
  displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);
122262
122283
 
122263
122284
  if(isSelectMode) {
122264
- var _res = reselect(gd);
122285
+ var _res = reselect(gd, false);
122265
122286
  var extraPoints = _res.eventData ? _res.eventData.points.slice() : [];
122266
122287
 
122267
- _res = reselect(gd, selectionTesters, searchTraces, dragOptions);
122288
+ _res = reselect(gd, false, selectionTesters, searchTraces, dragOptions);
122268
122289
  selectionTesters = _res.selectionTesters;
122269
122290
  eventData = _res.eventData;
122270
122291
 
@@ -122358,9 +122379,13 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122358
122379
  }
122359
122380
  }
122360
122381
 
122361
- Registry.call('_guiRelayout', gd, {
122362
- selections: subSelections
122363
- });
122382
+ if(subSelections.length < allSelections.length) {
122383
+ gd._fullLayout._noEmitSelectedAtStart = true;
122384
+
122385
+ Registry.call('_guiRelayout', gd, {
122386
+ selections: subSelections
122387
+ });
122388
+ }
122364
122389
  }
122365
122390
  }
122366
122391
  } else {
@@ -122406,7 +122431,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
122406
122431
  dragOptions.doneFnCompleted(selection);
122407
122432
  }
122408
122433
 
122409
- emitSelected(gd, eventData);
122434
+ if(isSelectMode) {
122435
+ emitSelected(gd, eventData);
122436
+ }
122410
122437
  }).catch(Lib.error);
122411
122438
  };
122412
122439
  }
@@ -122628,15 +122655,23 @@ function coerceSelectionsCache(evt, gd, dragOptions) {
122628
122655
  }
122629
122656
  }
122630
122657
 
122658
+ function hasActiveShape(gd) {
122659
+ return gd._fullLayout._activeShapeIndex >= 0;
122660
+ }
122661
+
122662
+ function hasActiveSelection(gd) {
122663
+ return gd._fullLayout._activeSelectionIndex >= 0;
122664
+ }
122665
+
122631
122666
  function clearSelectionsCache(dragOptions, immediateSelect) {
122632
122667
  var dragmode = dragOptions.dragmode;
122633
122668
  var plotinfo = dragOptions.plotinfo;
122634
122669
 
122635
122670
  var gd = dragOptions.gd;
122636
- if(gd._fullLayout._activeShapeIndex >= 0) {
122671
+ if(hasActiveShape(gd)) {
122637
122672
  gd._fullLayout._deactivateShape(gd);
122638
122673
  }
122639
- if(gd._fullLayout._activeSelectionIndex >= 0) {
122674
+ if(hasActiveSelection(gd)) {
122640
122675
  gd._fullLayout._deactivateSelection(gd);
122641
122676
  }
122642
122677
 
@@ -122664,11 +122699,13 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
122664
122699
  var selections;
122665
122700
  if(
122666
122701
  isSelectMode &&
122667
- !dragOptions.subplot // only allow cartesian - no mapbox for now
122702
+ !hasSubplot(dragOptions) // only allow cartesian - no mapbox for now
122668
122703
  ) {
122669
122704
  selections = newSelections(outlines, dragOptions);
122670
122705
  }
122671
122706
  if(selections) {
122707
+ gd._fullLayout._noEmitSelectedAtStart = true;
122708
+
122672
122709
  Registry.call('_guiRelayout', gd, {
122673
122710
  selections: selections
122674
122711
  }).then(function() {
@@ -122703,7 +122740,10 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) {
122703
122740
 
122704
122741
  if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;
122705
122742
 
122706
- if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {
122743
+ if(
122744
+ hasSubplot({subplot: subplot}) &&
122745
+ (trace.subplot === subplot || trace.geo === subplot)
122746
+ ) {
122707
122747
  searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));
122708
122748
  } else if(trace.type === 'splom') {
122709
122749
  // FIXME: make sure we don't have more than single axis for splom
@@ -123003,7 +123043,7 @@ function _doSelect(selectionTesters, searchTraces) {
123003
123043
  return allSelections;
123004
123044
  }
123005
123045
 
123006
- function reselect(gd, selectionTesters, searchTraces, dragOptions) {
123046
+ function reselect(gd, mayEmitSelected, selectionTesters, searchTraces, dragOptions) {
123007
123047
  var hadSearchTraces = !!searchTraces;
123008
123048
  var plotinfo, xRef, yRef;
123009
123049
  if(dragOptions) {
@@ -123126,15 +123166,15 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
123126
123166
  updateSelectedState(gd, allSearchTraces, eventData);
123127
123167
 
123128
123168
  var clickmode = fullLayout.clickmode;
123129
- var sendEvents = clickmode.indexOf('event') > -1;
123169
+ var sendEvents = clickmode.indexOf('event') > -1 && mayEmitSelected;
123130
123170
 
123131
123171
  if(
123132
123172
  !plotinfo && // get called from plot_api & plots
123133
- fullLayout._reselect
123173
+ mayEmitSelected
123134
123174
  ) {
123135
- if(sendEvents) {
123136
- var activePolygons = getLayoutPolygons(gd, true);
123175
+ var activePolygons = getLayoutPolygons(gd, true);
123137
123176
 
123177
+ if(activePolygons.length) {
123138
123178
  var xref = activePolygons[0].xref;
123139
123179
  var yref = activePolygons[0].yref;
123140
123180
  if(xref && yref) {
@@ -123147,8 +123187,12 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
123147
123187
 
123148
123188
  fillRangeItems(eventData, poly);
123149
123189
  }
123190
+ }
123150
123191
 
123151
- emitSelected(gd, eventData);
123192
+ if(gd._fullLayout._noEmitSelectedAtStart) {
123193
+ gd._fullLayout._noEmitSelectedAtStart = false;
123194
+ } else {
123195
+ if(sendEvents) emitSelected(gd, eventData);
123152
123196
  }
123153
123197
 
123154
123198
  fullLayout._reselect = false;
@@ -123170,7 +123214,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
123170
123214
  if(eventData.points.length) {
123171
123215
  emitSelected(gd, eventData);
123172
123216
  } else {
123173
- gd.emit('plotly_deselect', null);
123217
+ emitDeselect(gd);
123174
123218
  }
123175
123219
  }
123176
123220
 
@@ -123458,13 +123502,10 @@ function getFillRangeItems(dragOptions) {
123458
123502
  }
123459
123503
 
123460
123504
  function emitSelecting(gd, eventData) {
123461
- if(drawMode(gd._fullLayout.dragmode)) return;
123462
123505
  gd.emit('plotly_selecting', eventData);
123463
123506
  }
123464
123507
 
123465
123508
  function emitSelected(gd, eventData) {
123466
- if(drawMode(gd._fullLayout.dragmode)) return;
123467
-
123468
123509
  if(eventData) {
123469
123510
  eventData.selections = (gd.layout || {}).selections || [];
123470
123511
  }
@@ -123473,7 +123514,6 @@ function emitSelected(gd, eventData) {
123473
123514
  }
123474
123515
 
123475
123516
  function emitDeselect(gd) {
123476
- if(drawMode(gd._fullLayout.dragmode)) return;
123477
123517
  gd.emit('plotly_deselect', null);
123478
123518
  }
123479
123519
 
@@ -142182,6 +142222,12 @@ var configAttributes = {
142182
142222
  }
142183
142223
  },
142184
142224
 
142225
+ editSelection: {
142226
+ valType: 'boolean',
142227
+ dflt: true,
142228
+ description: 'Enables moving selections.'
142229
+ },
142230
+
142185
142231
  autosizable: {
142186
142232
  valType: 'boolean',
142187
142233
  dflt: false,
@@ -170118,7 +170164,16 @@ plots.redrag = function(gd) {
170118
170164
  };
170119
170165
 
170120
170166
  plots.reselect = function(gd) {
170121
- Registry.getComponentMethod('selections', 'reselect')(gd);
170167
+ var fullLayout = gd._fullLayout;
170168
+
170169
+ var A = (gd.layout || {}).selections;
170170
+ var B = fullLayout._previousSelections;
170171
+ fullLayout._previousSelections = A;
170172
+
170173
+ var mayEmitSelected = fullLayout._reselect ||
170174
+ JSON.stringify(A) !== JSON.stringify(B);
170175
+
170176
+ Registry.getComponentMethod('selections', 'reselect')(gd, mayEmitSelected);
170122
170177
  };
170123
170178
 
170124
170179
  plots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {
@@ -209533,6 +209588,14 @@ var attrs = module.exports = overrideAll({
209533
209588
  },
209534
209589
 
209535
209590
  link: {
209591
+ arrowlen: {
209592
+ valType: 'number',
209593
+ min: 0,
209594
+ dflt: 0,
209595
+ description: [
209596
+ 'Sets the length (in px) of the links arrow, if 0 no arrow will be drawn.'
209597
+ ].join(' ')
209598
+ },
209536
209599
  label: {
209537
209600
  valType: 'data_array',
209538
209601
  dflt: [],
@@ -209680,6 +209743,7 @@ function subplotUpdateFx(gd, index) {
209680
209743
  var dragMode = fullLayout.dragmode;
209681
209744
  var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';
209682
209745
  var bgRect = trace._bgRect;
209746
+ if(!bgRect) return;
209683
209747
 
209684
209748
  if(dragMode === 'pan' || dragMode === 'zoom') return;
209685
209749
 
@@ -210019,6 +210083,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
210019
210083
  return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);
210020
210084
  }
210021
210085
  coerceLink('label');
210086
+ coerceLink('arrowlen');
210022
210087
  coerceLink('source');
210023
210088
  coerceLink('target');
210024
210089
  coerceLink('value');
@@ -210736,6 +210801,7 @@ function sankeyModel(layout, d, traceIndex) {
210736
210801
  nodeLineWidth: trace.node.line.width,
210737
210802
  linkLineColor: trace.link.line.color,
210738
210803
  linkLineWidth: trace.link.line.width,
210804
+ linkArrowLength: trace.link.arrowlen,
210739
210805
  valueFormat: trace.valueformat,
210740
210806
  valueSuffix: trace.valuesuffix,
210741
210807
  textFont: trace.textfont,
@@ -210774,6 +210840,7 @@ function linkModel(d, l, i) {
210774
210840
  linkPath: linkPath,
210775
210841
  linkLineColor: d.linkLineColor,
210776
210842
  linkLineWidth: d.linkLineWidth,
210843
+ linkArrowLength: d.linkArrowLength,
210777
210844
  valueFormat: d.valueFormat,
210778
210845
  valueSuffix: d.valueSuffix,
210779
210846
  sankey: d.sankey,
@@ -210783,7 +210850,7 @@ function linkModel(d, l, i) {
210783
210850
  };
210784
210851
  }
210785
210852
 
210786
- function createCircularClosedPathString(link) {
210853
+ function createCircularClosedPathString(link, arrowLen) {
210787
210854
  // Using coordinates computed by d3-sankey-circular
210788
210855
  var pathString = '';
210789
210856
  var offset = link.width / 2;
@@ -210793,17 +210860,17 @@ function createCircularClosedPathString(link) {
210793
210860
  pathString =
210794
210861
  // start at the left of the target node
210795
210862
  'M ' +
210796
- coords.targetX + ' ' + (coords.targetY + offset) + ' ' +
210863
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
210797
210864
  'L' +
210798
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
210865
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
210799
210866
  'A' +
210800
210867
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
210801
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
210868
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
210802
210869
  'L' +
210803
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
210870
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
210804
210871
  'A' +
210805
210872
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
210806
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
210873
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
210807
210874
  'L' +
210808
210875
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
210809
210876
  'A' +
@@ -210831,34 +210898,35 @@ function createCircularClosedPathString(link) {
210831
210898
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
210832
210899
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
210833
210900
  'L' +
210834
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
210901
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
210835
210902
  'A' +
210836
210903
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
210837
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
210904
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
210838
210905
  'L' +
210839
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
210906
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
210840
210907
  'A' +
210841
210908
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
210842
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
210909
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
210843
210910
  'L' +
210844
- coords.targetX + ' ' + (coords.targetY - offset) +
210911
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
210912
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
210845
210913
  'Z';
210846
210914
  } else {
210847
210915
  // Bottom path
210848
210916
  pathString =
210849
210917
  // start at the left of the target node
210850
210918
  'M ' +
210851
- coords.targetX + ' ' + (coords.targetY - offset) + ' ' +
210919
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
210852
210920
  'L' +
210853
- coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
210921
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
210854
210922
  'A' +
210855
210923
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
210856
- (coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
210924
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
210857
210925
  'L' +
210858
- (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
210926
+ (coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
210859
210927
  'A' +
210860
210928
  (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
210861
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
210929
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
210862
210930
  'L' +
210863
210931
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
210864
210932
  'A' +
@@ -210886,17 +210954,18 @@ function createCircularClosedPathString(link) {
210886
210954
  (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
210887
210955
  coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
210888
210956
  'L' +
210889
- coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
210957
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
210890
210958
  'A' +
210891
210959
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
210892
- (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
210960
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
210893
210961
  'L' +
210894
- (coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
210962
+ (coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
210895
210963
  'A' +
210896
210964
  (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
210897
- coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
210965
+ (coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
210898
210966
  'L' +
210899
- coords.targetX + ' ' + (coords.targetY + offset) +
210967
+ (coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
210968
+ (arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
210900
210969
  'Z';
210901
210970
  }
210902
210971
  return pathString;
@@ -210905,11 +210974,16 @@ function createCircularClosedPathString(link) {
210905
210974
  function linkPath() {
210906
210975
  var curvature = 0.5;
210907
210976
  function path(d) {
210977
+ var arrowLen = d.linkArrowLength;
210908
210978
  if(d.link.circular) {
210909
- return createCircularClosedPathString(d.link);
210979
+ return createCircularClosedPathString(d.link, arrowLen);
210910
210980
  } else {
210981
+ var maxArrowLength = Math.abs((d.link.target.x0 - d.link.source.x1) / 2);
210982
+ if(arrowLen > maxArrowLength) {
210983
+ arrowLen = maxArrowLength;
210984
+ }
210911
210985
  var x0 = d.link.source.x1;
210912
- var x1 = d.link.target.x0;
210986
+ var x1 = d.link.target.x0 - arrowLen;
210913
210987
  var xi = interpolateNumber(x0, x1);
210914
210988
  var x2 = xi(curvature);
210915
210989
  var x3 = xi(1 - curvature);
@@ -210917,15 +210991,17 @@ function linkPath() {
210917
210991
  var y0b = d.link.y0 + d.link.width / 2;
210918
210992
  var y1a = d.link.y1 - d.link.width / 2;
210919
210993
  var y1b = d.link.y1 + d.link.width / 2;
210920
- return 'M' + x0 + ',' + y0a +
210921
- 'C' + x2 + ',' + y0a +
210922
- ' ' + x3 + ',' + y1a +
210923
- ' ' + x1 + ',' + y1a +
210924
- 'L' + x1 + ',' + y1b +
210925
- 'C' + x3 + ',' + y1b +
210926
- ' ' + x2 + ',' + y0b +
210927
- ' ' + x0 + ',' + y0b +
210928
- 'Z';
210994
+ var start = 'M' + x0 + ',' + y0a;
210995
+ var upperCurve = 'C' + x2 + ',' + y0a +
210996
+ ' ' + x3 + ',' + y1a +
210997
+ ' ' + x1 + ',' + y1a;
210998
+ var lowerCurve = 'C' + x3 + ',' + y1b +
210999
+ ' ' + x2 + ',' + y0b +
211000
+ ' ' + x0 + ',' + y0b;
211001
+
211002
+ var rightEnd = arrowLen > 0 ? 'L' + (x1 + arrowLen) + ',' + (y1a + d.link.width / 2) : '';
211003
+ rightEnd += 'L' + x1 + ',' + y1b;
211004
+ return start + upperCurve + rightEnd + lowerCurve + 'Z';
210929
211005
  }
210930
211006
  }
210931
211007
  return path;
@@ -232759,7 +232835,7 @@ function getSortFunc(opts, d2c) {
232759
232835
  'use strict';
232760
232836
 
232761
232837
  // package version injected by `npm run preprocess`
232762
- exports.version = '2.13.1';
232838
+ exports.version = '2.14.0';
232763
232839
 
232764
232840
  },{}],1133:[function(_dereq_,module,exports){
232765
232841
  (function (global){(function (){