plotly.js 2.13.3 → 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/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/dist/README.md +19 -19
- package/dist/plot-schema.json +12 -0
- package/dist/plotly-basic.js +18 -3
- package/dist/plotly-basic.min.js +2 -2
- package/dist/plotly-cartesian.js +18 -3
- package/dist/plotly-cartesian.min.js +2 -2
- package/dist/plotly-finance.js +18 -3
- package/dist/plotly-finance.min.js +2 -2
- package/dist/plotly-geo-assets.js +2 -2
- package/dist/plotly-geo.js +18 -3
- package/dist/plotly-geo.min.js +2 -2
- package/dist/plotly-gl2d.js +18 -3
- package/dist/plotly-gl2d.min.js +2 -2
- package/dist/plotly-gl3d.js +18 -3
- package/dist/plotly-gl3d.min.js +2 -2
- package/dist/plotly-locale-nl.js +1 -1
- package/dist/plotly-mapbox.js +18 -3
- package/dist/plotly-mapbox.min.js +2 -2
- package/dist/plotly-strict.js +67 -35
- package/dist/plotly-strict.min.js +2 -2
- package/dist/plotly-with-meta.js +71 -35
- package/dist/plotly.js +67 -35
- package/dist/plotly.min.js +2 -2
- package/lib/locales/nl.js +42 -2
- package/package.json +1 -1
- package/src/components/selections/draw.js +11 -1
- package/src/plot_api/plot_config.js +6 -0
- package/src/traces/sankey/attributes.js +8 -0
- package/src/traces/sankey/defaults.js +1 -0
- package/src/traces/sankey/render.js +43 -32
- package/src/version.js +1 -1
package/dist/plotly-with-meta.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* plotly.js v2.
|
|
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);
|
|
@@ -142212,6 +142222,12 @@ var configAttributes = {
|
|
|
142212
142222
|
}
|
|
142213
142223
|
},
|
|
142214
142224
|
|
|
142225
|
+
editSelection: {
|
|
142226
|
+
valType: 'boolean',
|
|
142227
|
+
dflt: true,
|
|
142228
|
+
description: 'Enables moving selections.'
|
|
142229
|
+
},
|
|
142230
|
+
|
|
142215
142231
|
autosizable: {
|
|
142216
142232
|
valType: 'boolean',
|
|
142217
142233
|
dflt: false,
|
|
@@ -209572,6 +209588,14 @@ var attrs = module.exports = overrideAll({
|
|
|
209572
209588
|
},
|
|
209573
209589
|
|
|
209574
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
|
+
},
|
|
209575
209599
|
label: {
|
|
209576
209600
|
valType: 'data_array',
|
|
209577
209601
|
dflt: [],
|
|
@@ -210059,6 +210083,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
|
|
|
210059
210083
|
return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);
|
|
210060
210084
|
}
|
|
210061
210085
|
coerceLink('label');
|
|
210086
|
+
coerceLink('arrowlen');
|
|
210062
210087
|
coerceLink('source');
|
|
210063
210088
|
coerceLink('target');
|
|
210064
210089
|
coerceLink('value');
|
|
@@ -210776,6 +210801,7 @@ function sankeyModel(layout, d, traceIndex) {
|
|
|
210776
210801
|
nodeLineWidth: trace.node.line.width,
|
|
210777
210802
|
linkLineColor: trace.link.line.color,
|
|
210778
210803
|
linkLineWidth: trace.link.line.width,
|
|
210804
|
+
linkArrowLength: trace.link.arrowlen,
|
|
210779
210805
|
valueFormat: trace.valueformat,
|
|
210780
210806
|
valueSuffix: trace.valuesuffix,
|
|
210781
210807
|
textFont: trace.textfont,
|
|
@@ -210814,6 +210840,7 @@ function linkModel(d, l, i) {
|
|
|
210814
210840
|
linkPath: linkPath,
|
|
210815
210841
|
linkLineColor: d.linkLineColor,
|
|
210816
210842
|
linkLineWidth: d.linkLineWidth,
|
|
210843
|
+
linkArrowLength: d.linkArrowLength,
|
|
210817
210844
|
valueFormat: d.valueFormat,
|
|
210818
210845
|
valueSuffix: d.valueSuffix,
|
|
210819
210846
|
sankey: d.sankey,
|
|
@@ -210823,7 +210850,7 @@ function linkModel(d, l, i) {
|
|
|
210823
210850
|
};
|
|
210824
210851
|
}
|
|
210825
210852
|
|
|
210826
|
-
function createCircularClosedPathString(link) {
|
|
210853
|
+
function createCircularClosedPathString(link, arrowLen) {
|
|
210827
210854
|
// Using coordinates computed by d3-sankey-circular
|
|
210828
210855
|
var pathString = '';
|
|
210829
210856
|
var offset = link.width / 2;
|
|
@@ -210833,17 +210860,17 @@ function createCircularClosedPathString(link) {
|
|
|
210833
210860
|
pathString =
|
|
210834
210861
|
// start at the left of the target node
|
|
210835
210862
|
'M ' +
|
|
210836
|
-
coords.targetX + ' ' + (coords.targetY + offset) + ' ' +
|
|
210863
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
|
|
210837
210864
|
'L' +
|
|
210838
|
-
coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
|
|
210865
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
210839
210866
|
'A' +
|
|
210840
210867
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
210841
|
-
(coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
210868
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
210842
210869
|
'L' +
|
|
210843
|
-
(coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
|
|
210870
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
210844
210871
|
'A' +
|
|
210845
210872
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
210846
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
210873
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
210847
210874
|
'L' +
|
|
210848
210875
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
210849
210876
|
'A' +
|
|
@@ -210871,34 +210898,35 @@ function createCircularClosedPathString(link) {
|
|
|
210871
210898
|
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
210872
210899
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
210873
210900
|
'L' +
|
|
210874
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
210901
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
210875
210902
|
'A' +
|
|
210876
210903
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
210877
|
-
(coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
|
|
210904
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
210878
210905
|
'L' +
|
|
210879
|
-
(coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
210906
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
210880
210907
|
'A' +
|
|
210881
210908
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
|
|
210882
|
-
coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
|
|
210909
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
210883
210910
|
'L' +
|
|
210884
|
-
coords.targetX + ' ' + (coords.targetY - offset) +
|
|
210911
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
210912
|
+
(arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
|
|
210885
210913
|
'Z';
|
|
210886
210914
|
} else {
|
|
210887
210915
|
// Bottom path
|
|
210888
210916
|
pathString =
|
|
210889
210917
|
// start at the left of the target node
|
|
210890
210918
|
'M ' +
|
|
210891
|
-
coords.targetX + ' ' + (coords.targetY - offset) + ' ' +
|
|
210919
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
|
|
210892
210920
|
'L' +
|
|
210893
|
-
coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
|
|
210921
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
210894
210922
|
'A' +
|
|
210895
210923
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
|
|
210896
|
-
(coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
210924
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
210897
210925
|
'L' +
|
|
210898
|
-
(coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
|
|
210926
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
210899
210927
|
'A' +
|
|
210900
210928
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
|
|
210901
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
210929
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
210902
210930
|
'L' +
|
|
210903
210931
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
210904
210932
|
'A' +
|
|
@@ -210926,17 +210954,18 @@ function createCircularClosedPathString(link) {
|
|
|
210926
210954
|
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
|
|
210927
210955
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
210928
210956
|
'L' +
|
|
210929
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
210957
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
210930
210958
|
'A' +
|
|
210931
210959
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
|
|
210932
|
-
(coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
|
|
210960
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
210933
210961
|
'L' +
|
|
210934
|
-
(coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
210962
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
210935
210963
|
'A' +
|
|
210936
210964
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
210937
|
-
coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
|
|
210965
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
210938
210966
|
'L' +
|
|
210939
|
-
coords.targetX + ' ' + (coords.targetY + offset) +
|
|
210967
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
210968
|
+
(arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
|
|
210940
210969
|
'Z';
|
|
210941
210970
|
}
|
|
210942
210971
|
return pathString;
|
|
@@ -210945,11 +210974,16 @@ function createCircularClosedPathString(link) {
|
|
|
210945
210974
|
function linkPath() {
|
|
210946
210975
|
var curvature = 0.5;
|
|
210947
210976
|
function path(d) {
|
|
210977
|
+
var arrowLen = d.linkArrowLength;
|
|
210948
210978
|
if(d.link.circular) {
|
|
210949
|
-
return createCircularClosedPathString(d.link);
|
|
210979
|
+
return createCircularClosedPathString(d.link, arrowLen);
|
|
210950
210980
|
} else {
|
|
210981
|
+
var maxArrowLength = Math.abs((d.link.target.x0 - d.link.source.x1) / 2);
|
|
210982
|
+
if(arrowLen > maxArrowLength) {
|
|
210983
|
+
arrowLen = maxArrowLength;
|
|
210984
|
+
}
|
|
210951
210985
|
var x0 = d.link.source.x1;
|
|
210952
|
-
var x1 = d.link.target.x0;
|
|
210986
|
+
var x1 = d.link.target.x0 - arrowLen;
|
|
210953
210987
|
var xi = interpolateNumber(x0, x1);
|
|
210954
210988
|
var x2 = xi(curvature);
|
|
210955
210989
|
var x3 = xi(1 - curvature);
|
|
@@ -210957,15 +210991,17 @@ function linkPath() {
|
|
|
210957
210991
|
var y0b = d.link.y0 + d.link.width / 2;
|
|
210958
210992
|
var y1a = d.link.y1 - d.link.width / 2;
|
|
210959
210993
|
var y1b = d.link.y1 + d.link.width / 2;
|
|
210960
|
-
|
|
210961
|
-
|
|
210962
|
-
|
|
210963
|
-
|
|
210964
|
-
|
|
210965
|
-
|
|
210966
|
-
|
|
210967
|
-
|
|
210968
|
-
|
|
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';
|
|
210969
211005
|
}
|
|
210970
211006
|
}
|
|
210971
211007
|
return path;
|
|
@@ -232799,7 +232835,7 @@ function getSortFunc(opts, d2c) {
|
|
|
232799
232835
|
'use strict';
|
|
232800
232836
|
|
|
232801
232837
|
// package version injected by `npm run preprocess`
|
|
232802
|
-
exports.version = '2.
|
|
232838
|
+
exports.version = '2.14.0';
|
|
232803
232839
|
|
|
232804
232840
|
},{}],1133:[function(_dereq_,module,exports){
|
|
232805
232841
|
(function (global){(function (){
|
package/dist/plotly.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* plotly.js v2.
|
|
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);
|
|
@@ -140808,6 +140818,11 @@ var configAttributes = {
|
|
|
140808
140818
|
}
|
|
140809
140819
|
},
|
|
140810
140820
|
|
|
140821
|
+
editSelection: {
|
|
140822
|
+
valType: 'boolean',
|
|
140823
|
+
dflt: true,
|
|
140824
|
+
},
|
|
140825
|
+
|
|
140811
140826
|
autosizable: {
|
|
140812
140827
|
valType: 'boolean',
|
|
140813
140828
|
dflt: false,
|
|
@@ -204491,6 +204506,11 @@ var attrs = module.exports = overrideAll({
|
|
|
204491
204506
|
},
|
|
204492
204507
|
|
|
204493
204508
|
link: {
|
|
204509
|
+
arrowlen: {
|
|
204510
|
+
valType: 'number',
|
|
204511
|
+
min: 0,
|
|
204512
|
+
dflt: 0,
|
|
204513
|
+
},
|
|
204494
204514
|
label: {
|
|
204495
204515
|
valType: 'data_array',
|
|
204496
204516
|
dflt: [],
|
|
@@ -204951,6 +204971,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
|
|
|
204951
204971
|
return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);
|
|
204952
204972
|
}
|
|
204953
204973
|
coerceLink('label');
|
|
204974
|
+
coerceLink('arrowlen');
|
|
204954
204975
|
coerceLink('source');
|
|
204955
204976
|
coerceLink('target');
|
|
204956
204977
|
coerceLink('value');
|
|
@@ -205663,6 +205684,7 @@ function sankeyModel(layout, d, traceIndex) {
|
|
|
205663
205684
|
nodeLineWidth: trace.node.line.width,
|
|
205664
205685
|
linkLineColor: trace.link.line.color,
|
|
205665
205686
|
linkLineWidth: trace.link.line.width,
|
|
205687
|
+
linkArrowLength: trace.link.arrowlen,
|
|
205666
205688
|
valueFormat: trace.valueformat,
|
|
205667
205689
|
valueSuffix: trace.valuesuffix,
|
|
205668
205690
|
textFont: trace.textfont,
|
|
@@ -205701,6 +205723,7 @@ function linkModel(d, l, i) {
|
|
|
205701
205723
|
linkPath: linkPath,
|
|
205702
205724
|
linkLineColor: d.linkLineColor,
|
|
205703
205725
|
linkLineWidth: d.linkLineWidth,
|
|
205726
|
+
linkArrowLength: d.linkArrowLength,
|
|
205704
205727
|
valueFormat: d.valueFormat,
|
|
205705
205728
|
valueSuffix: d.valueSuffix,
|
|
205706
205729
|
sankey: d.sankey,
|
|
@@ -205710,7 +205733,7 @@ function linkModel(d, l, i) {
|
|
|
205710
205733
|
};
|
|
205711
205734
|
}
|
|
205712
205735
|
|
|
205713
|
-
function createCircularClosedPathString(link) {
|
|
205736
|
+
function createCircularClosedPathString(link, arrowLen) {
|
|
205714
205737
|
// Using coordinates computed by d3-sankey-circular
|
|
205715
205738
|
var pathString = '';
|
|
205716
205739
|
var offset = link.width / 2;
|
|
@@ -205720,17 +205743,17 @@ function createCircularClosedPathString(link) {
|
|
|
205720
205743
|
pathString =
|
|
205721
205744
|
// start at the left of the target node
|
|
205722
205745
|
'M ' +
|
|
205723
|
-
coords.targetX + ' ' + (coords.targetY + offset) + ' ' +
|
|
205746
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) + ' ' +
|
|
205724
205747
|
'L' +
|
|
205725
|
-
coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
|
|
205748
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
205726
205749
|
'A' +
|
|
205727
205750
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +
|
|
205728
|
-
(coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
205751
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
205729
205752
|
'L' +
|
|
205730
|
-
(coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
|
|
205753
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
205731
205754
|
'A' +
|
|
205732
205755
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +
|
|
205733
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
205756
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
205734
205757
|
'L' +
|
|
205735
205758
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
205736
205759
|
'A' +
|
|
@@ -205758,34 +205781,35 @@ function createCircularClosedPathString(link) {
|
|
|
205758
205781
|
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
205759
205782
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
205760
205783
|
'L' +
|
|
205761
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
205784
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
205762
205785
|
'A' +
|
|
205763
205786
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +
|
|
205764
|
-
(coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
|
|
205787
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
205765
205788
|
'L' +
|
|
205766
|
-
(coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
205789
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +
|
|
205767
205790
|
'A' +
|
|
205768
205791
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +
|
|
205769
|
-
coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
|
|
205792
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
205770
205793
|
'L' +
|
|
205771
|
-
coords.targetX + ' ' + (coords.targetY - offset) +
|
|
205794
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
205795
|
+
(arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
|
|
205772
205796
|
'Z';
|
|
205773
205797
|
} else {
|
|
205774
205798
|
// Bottom path
|
|
205775
205799
|
pathString =
|
|
205776
205800
|
// start at the left of the target node
|
|
205777
205801
|
'M ' +
|
|
205778
|
-
coords.targetX + ' ' + (coords.targetY - offset) + ' ' +
|
|
205802
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY - offset) + ' ' +
|
|
205779
205803
|
'L' +
|
|
205780
|
-
coords.rightInnerExtent + ' ' + (coords.targetY - offset) +
|
|
205804
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY - offset) +
|
|
205781
205805
|
'A' +
|
|
205782
205806
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +
|
|
205783
|
-
(coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
205807
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
205784
205808
|
'L' +
|
|
205785
|
-
(coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +
|
|
205809
|
+
(coords.rightFullExtent - offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
205786
205810
|
'A' +
|
|
205787
205811
|
(coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +
|
|
205788
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
205812
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent + offset) +
|
|
205789
205813
|
'L' +
|
|
205790
205814
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +
|
|
205791
205815
|
'A' +
|
|
@@ -205813,17 +205837,18 @@ function createCircularClosedPathString(link) {
|
|
|
205813
205837
|
(coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +
|
|
205814
205838
|
coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
205815
205839
|
'L' +
|
|
205816
|
-
coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +
|
|
205840
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.verticalFullExtent - offset) +
|
|
205817
205841
|
'A' +
|
|
205818
205842
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +
|
|
205819
|
-
(coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +
|
|
205843
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + coords.verticalRightInnerExtent +
|
|
205820
205844
|
'L' +
|
|
205821
|
-
(coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
205845
|
+
(coords.rightFullExtent + offset - arrowLen) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +
|
|
205822
205846
|
'A' +
|
|
205823
205847
|
(coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +
|
|
205824
|
-
coords.rightInnerExtent + ' ' + (coords.targetY + offset) +
|
|
205848
|
+
(coords.rightInnerExtent - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
205825
205849
|
'L' +
|
|
205826
|
-
coords.targetX + ' ' + (coords.targetY + offset) +
|
|
205850
|
+
(coords.targetX - arrowLen) + ' ' + (coords.targetY + offset) +
|
|
205851
|
+
(arrowLen > 0 ? 'L' + coords.targetX + ' ' + (coords.targetY) : '') +
|
|
205827
205852
|
'Z';
|
|
205828
205853
|
}
|
|
205829
205854
|
return pathString;
|
|
@@ -205832,11 +205857,16 @@ function createCircularClosedPathString(link) {
|
|
|
205832
205857
|
function linkPath() {
|
|
205833
205858
|
var curvature = 0.5;
|
|
205834
205859
|
function path(d) {
|
|
205860
|
+
var arrowLen = d.linkArrowLength;
|
|
205835
205861
|
if(d.link.circular) {
|
|
205836
|
-
return createCircularClosedPathString(d.link);
|
|
205862
|
+
return createCircularClosedPathString(d.link, arrowLen);
|
|
205837
205863
|
} else {
|
|
205864
|
+
var maxArrowLength = Math.abs((d.link.target.x0 - d.link.source.x1) / 2);
|
|
205865
|
+
if(arrowLen > maxArrowLength) {
|
|
205866
|
+
arrowLen = maxArrowLength;
|
|
205867
|
+
}
|
|
205838
205868
|
var x0 = d.link.source.x1;
|
|
205839
|
-
var x1 = d.link.target.x0;
|
|
205869
|
+
var x1 = d.link.target.x0 - arrowLen;
|
|
205840
205870
|
var xi = interpolateNumber(x0, x1);
|
|
205841
205871
|
var x2 = xi(curvature);
|
|
205842
205872
|
var x3 = xi(1 - curvature);
|
|
@@ -205844,15 +205874,17 @@ function linkPath() {
|
|
|
205844
205874
|
var y0b = d.link.y0 + d.link.width / 2;
|
|
205845
205875
|
var y1a = d.link.y1 - d.link.width / 2;
|
|
205846
205876
|
var y1b = d.link.y1 + d.link.width / 2;
|
|
205847
|
-
|
|
205848
|
-
|
|
205849
|
-
|
|
205850
|
-
|
|
205851
|
-
|
|
205852
|
-
|
|
205853
|
-
|
|
205854
|
-
|
|
205855
|
-
|
|
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';
|
|
205856
205888
|
}
|
|
205857
205889
|
}
|
|
205858
205890
|
return path;
|
|
@@ -226319,7 +226351,7 @@ function getSortFunc(opts, d2c) {
|
|
|
226319
226351
|
'use strict';
|
|
226320
226352
|
|
|
226321
226353
|
// package version injected by `npm run preprocess`
|
|
226322
|
-
exports.version = '2.
|
|
226354
|
+
exports.version = '2.14.0';
|
|
226323
226355
|
|
|
226324
226356
|
},{}],1133:[function(_dereq_,module,exports){
|
|
226325
226357
|
(function (global){(function (){
|