sankey.src.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. /* *
  2. * Sankey diagram module
  3. *
  4. * (c) 2010-2019 Torstein Honsi
  5. *
  6. * License: www.highcharts.com/license
  7. */
  8. 'use strict';
  9. import H from '../parts/Globals.js';
  10. import '../parts/Utilities.js';
  11. import '../parts/Options.js';
  12. import '../mixins/nodes.js';
  13. var defined = H.defined,
  14. seriesType = H.seriesType,
  15. pick = H.pick,
  16. Point = H.Point;
  17. /**
  18. * @private
  19. * @class
  20. * @name Highcharts.seriesTypes.sankey
  21. *
  22. * @augments Highcharts.Series
  23. */
  24. seriesType('sankey', 'column'
  25. /**
  26. * A sankey diagram is a type of flow diagram, in which the width of the
  27. * link between two nodes is shown proportionally to the flow quantity.
  28. *
  29. * @sample highcharts/demo/sankey-diagram/
  30. * Sankey diagram
  31. * @sample highcharts/plotoptions/sankey-inverted/
  32. * Inverted sankey diagram
  33. * @sample highcharts/plotoptions/sankey-outgoing
  34. * Sankey diagram with outgoing links
  35. *
  36. * @extends plotOptions.column
  37. * @since 6.0.0
  38. * @product highcharts
  39. * @excluding animationLimit, boostThreshold, borderColor, borderRadius,
  40. * borderWidth, crisp, cropThreshold, depth, edgeColor, edgeWidth,
  41. * findNearestPointBy, grouping, groupPadding, groupZPadding,
  42. * maxPointWidth, negativeColor, pointInterval, pointIntervalUnit,
  43. * pointPadding, pointPlacement, pointRange, pointStart,
  44. * pointWidth, shadow, softThreshold, stacking, threshold,
  45. * zoneAxis, zones
  46. * @optionparent plotOptions.sankey
  47. */
  48. , {
  49. colorByPoint: true,
  50. /**
  51. * Higher numbers makes the links in a sankey diagram render more curved.
  52. * A `curveFactor` of 0 makes the lines straight.
  53. */
  54. curveFactor: 0.33,
  55. /**
  56. * Options for the data labels appearing on top of the nodes and links. For
  57. * sankey charts, data labels are visible for the nodes by default, but
  58. * hidden for links. This is controlled by modifying the `nodeFormat`, and
  59. * the `format` that applies to links and is an empty string by default.
  60. */
  61. dataLabels: {
  62. enabled: true,
  63. backgroundColor: 'none', // enable padding
  64. crop: false,
  65. /**
  66. * The
  67. * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)
  68. * specifying what to show for _nodes_ in the sankey diagram. By default
  69. * the `nodeFormatter` returns `{point.name}`.
  70. *
  71. * @type {string}
  72. */
  73. nodeFormat: undefined,
  74. /**
  75. * Callback to format data labels for _nodes_ in the sankey diagram.
  76. * The `nodeFormat` option takes precedence over the `nodeFormatter`.
  77. *
  78. * @type {Highcharts.FormatterCallbackFunction<object>}
  79. * @since 6.0.2
  80. */
  81. nodeFormatter: function () {
  82. return this.point.name;
  83. },
  84. /**
  85. * The
  86. * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)
  87. * specifying what to show for _links_ in the sankey diagram. Defaults
  88. * to an empty string returned from the `formatter`, in effect disabling
  89. * the labels.
  90. *
  91. * @type {string}
  92. */
  93. format: undefined,
  94. /**
  95. * Callback to format data labels for _links_ in the sankey diagram.
  96. * The `format` option takes precedence over the `formatter`.
  97. *
  98. * @type {Highcharts.FormatterCallbackFunction<Highcharts.SeriesDataLabelsFormatterContextObject>}
  99. * @since 6.0.2
  100. */
  101. formatter: function () {
  102. return '';
  103. },
  104. inside: true
  105. },
  106. /**
  107. * Opacity for the links between nodes in the sankey diagram.
  108. */
  109. linkOpacity: 0.5,
  110. /**
  111. * The pixel width of each node in a sankey diagram, or the height in case
  112. * the chart is inverted.
  113. */
  114. nodeWidth: 20,
  115. /**
  116. * The padding between nodes in a sankey diagram, in pixels.
  117. */
  118. nodePadding: 10,
  119. showInLegend: false,
  120. states: {
  121. hover: {
  122. /**
  123. * Opacity for the links between nodes in the sankey diagram in
  124. * hover mode.
  125. */
  126. linkOpacity: 1
  127. }
  128. },
  129. tooltip: {
  130. /**
  131. * A callback for defining the format for _nodes_ in the sankey chart's
  132. * tooltip, as opposed to links.
  133. *
  134. * @type {Highcharts.FormatterCallbackFunction<object>}
  135. * @since 6.0.2
  136. * @apioption plotOptions.sankey.tooltip.nodeFormatter
  137. */
  138. /**
  139. * Whether the tooltip should follow the pointer or stay fixed on the
  140. * item.
  141. */
  142. followPointer: true,
  143. headerFormat:
  144. '<span style="font-size: 10px">{series.name}</span><br/>',
  145. pointFormat: '{point.fromNode.name} \u2192 {point.toNode.name}: <b>{point.weight}</b><br/>',
  146. /**
  147. * The
  148. * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)
  149. * specifying what to show for _nodes_ in tooltip of a sankey diagram
  150. * series, as opposed to links.
  151. */
  152. nodeFormat: '{point.name}: <b>{point.sum}</b><br/>'
  153. }
  154. }, {
  155. isCartesian: false,
  156. forceDL: true,
  157. // Create a single node that holds information on incoming and outgoing
  158. // links.
  159. createNode: H.NodesMixin.createNode,
  160. // Create a node column.
  161. createNodeColumn: function () {
  162. var chart = this.chart,
  163. column = [],
  164. nodePadding = this.options.nodePadding;
  165. column.sum = function () {
  166. var sum = 0;
  167. this.forEach(function (node) {
  168. sum += node.getSum();
  169. });
  170. return sum;
  171. };
  172. // Get the offset in pixels of a node inside the column.
  173. column.offset = function (node, factor) {
  174. var offset = 0;
  175. for (var i = 0; i < column.length; i++) {
  176. if (column[i] === node) {
  177. return offset + (node.options.offset || 0);
  178. }
  179. offset += column[i].getSum() * factor + nodePadding;
  180. }
  181. };
  182. // Get the column height in pixels.
  183. column.top = function (factor) {
  184. var height = 0;
  185. for (var i = 0; i < column.length; i++) {
  186. if (i > 0) {
  187. height += nodePadding;
  188. }
  189. height += column[i].getSum() * factor;
  190. }
  191. return (chart.plotSizeY - height) / 2;
  192. };
  193. return column;
  194. },
  195. // Create node columns by analyzing the nodes and the relations between
  196. // incoming and outgoing links.
  197. createNodeColumns: function () {
  198. var columns = [];
  199. this.nodes.forEach(function (node) {
  200. var fromColumn = -1,
  201. i,
  202. point;
  203. if (!H.defined(node.options.column)) {
  204. // No links to this node, place it left
  205. if (node.linksTo.length === 0) {
  206. node.column = 0;
  207. // There are incoming links, place it to the right of the
  208. // highest order column that links to this one.
  209. } else {
  210. for (i = 0; i < node.linksTo.length; i++) {
  211. point = node.linksTo[0];
  212. if (point.fromNode.column > fromColumn) {
  213. fromColumn = point.fromNode.column;
  214. }
  215. }
  216. node.column = fromColumn + 1;
  217. }
  218. }
  219. if (!columns[node.column]) {
  220. columns[node.column] = this.createNodeColumn();
  221. }
  222. columns[node.column].push(node);
  223. }, this);
  224. // Fill in empty columns (#8865)
  225. for (var i = 0; i < columns.length; i++) {
  226. if (columns[i] === undefined) {
  227. columns[i] = this.createNodeColumn();
  228. }
  229. }
  230. return columns;
  231. },
  232. // Return the presentational attributes.
  233. pointAttribs: function (point, state) {
  234. var opacity = this.options.linkOpacity,
  235. color = point.color;
  236. if (state) {
  237. opacity = this.options.states[state].linkOpacity || opacity;
  238. color = this.options.states[state].color || point.color;
  239. }
  240. return {
  241. fill: point.isNode ?
  242. color :
  243. H.color(color).setOpacity(opacity).get()
  244. };
  245. },
  246. // Extend generatePoints by adding the nodes, which are Point objects
  247. // but pushed to the this.nodes array.
  248. generatePoints: function () {
  249. var nodeLookup = {},
  250. chart = this.chart;
  251. H.Series.prototype.generatePoints.call(this);
  252. if (!this.nodes) {
  253. this.nodes = []; // List of Point-like node items
  254. }
  255. this.colorCounter = 0;
  256. // Reset links from previous run
  257. this.nodes.forEach(function (node) {
  258. node.linksFrom.length = 0;
  259. node.linksTo.length = 0;
  260. });
  261. // Create the node list and set up links
  262. this.points.forEach(function (point) {
  263. if (defined(point.from)) {
  264. if (!nodeLookup[point.from]) {
  265. nodeLookup[point.from] = this.createNode(point.from);
  266. }
  267. nodeLookup[point.from].linksFrom.push(point);
  268. point.fromNode = nodeLookup[point.from];
  269. // Point color defaults to the fromNode's color
  270. if (chart.styledMode) {
  271. point.colorIndex = pick(
  272. point.options.colorIndex,
  273. nodeLookup[point.from].colorIndex
  274. );
  275. } else {
  276. point.color =
  277. point.options.color || nodeLookup[point.from].color;
  278. }
  279. }
  280. if (defined(point.to)) {
  281. if (!nodeLookup[point.to]) {
  282. nodeLookup[point.to] = this.createNode(point.to);
  283. }
  284. nodeLookup[point.to].linksTo.push(point);
  285. point.toNode = nodeLookup[point.to];
  286. }
  287. // for use in formats
  288. point.name = point.name || point.options.id;
  289. }, this);
  290. // Order the nodes, starting with the root node(s) (#9818)
  291. function order(node, level) {
  292. node.level = level;
  293. node.linksFrom.forEach(function (link) {
  294. order(link.toNode, level + 1);
  295. });
  296. }
  297. this.nodes
  298. // Identify the root node(s)
  299. .filter(function (node) {
  300. return node.linksTo.length === 0;
  301. })
  302. // Start by the root node(s) and recursively set the level on
  303. // all following nodes.
  304. .forEach(function (node) {
  305. order(node, 0);
  306. });
  307. this.nodes.sort(function (a, b) {
  308. return a.level - b.level;
  309. });
  310. },
  311. // Destroy all nodes on setting new data
  312. setData: function () {
  313. if (this.nodes) {
  314. this.nodes.forEach(function (node) {
  315. node.destroy();
  316. });
  317. this.nodes.length = 0;
  318. }
  319. H.Series.prototype.setData.apply(this, arguments);
  320. },
  321. // Run pre-translation by generating the nodeColumns.
  322. translate: function () {
  323. if (!this.processedXData) {
  324. this.processData();
  325. }
  326. this.generatePoints();
  327. this.nodeColumns = this.createNodeColumns();
  328. var chart = this.chart,
  329. inverted = chart.inverted,
  330. options = this.options,
  331. left = 0,
  332. nodeWidth = options.nodeWidth,
  333. nodeColumns = this.nodeColumns,
  334. colDistance = (chart.plotSizeX - nodeWidth) /
  335. (nodeColumns.length - 1),
  336. curvy = (
  337. (inverted ? -colDistance : colDistance) *
  338. options.curveFactor
  339. ),
  340. factor = Infinity;
  341. // Find out how much space is needed. Base it on the translation
  342. // factor of the most spaceous column.
  343. this.nodeColumns.forEach(function (column) {
  344. var height = chart.plotSizeY -
  345. (column.length - 1) * options.nodePadding;
  346. factor = Math.min(factor, height / column.sum());
  347. });
  348. this.nodeColumns.forEach(function (column) {
  349. column.forEach(function (node) {
  350. var sum = node.getSum(),
  351. height = sum * factor,
  352. fromNodeTop = (
  353. column.top(factor) +
  354. column.offset(node, factor)
  355. ),
  356. nodeLeft = inverted ?
  357. chart.plotSizeX - left :
  358. left;
  359. node.sum = sum;
  360. // Draw the node
  361. node.shapeType = 'rect';
  362. if (!inverted) {
  363. node.shapeArgs = {
  364. x: nodeLeft,
  365. y: fromNodeTop,
  366. width: nodeWidth,
  367. height: height
  368. };
  369. } else {
  370. node.shapeArgs = {
  371. x: nodeLeft - nodeWidth,
  372. y: chart.plotSizeY - fromNodeTop - height,
  373. width: nodeWidth,
  374. height: height
  375. };
  376. }
  377. node.shapeArgs.display = node.hasShape() ? '' : 'none';
  378. // Pass test in drawPoints
  379. node.plotY = 1;
  380. // Draw the links from this node
  381. node.linksFrom.forEach(function (point) {
  382. var linkHeight = point.weight * factor,
  383. fromLinkTop = node.offset(point, 'linksFrom') *
  384. factor,
  385. fromY = fromNodeTop + fromLinkTop,
  386. toNode = point.toNode,
  387. toColTop = nodeColumns[toNode.column].top(factor),
  388. toY = (
  389. toColTop +
  390. (toNode.offset(point, 'linksTo') * factor) +
  391. nodeColumns[toNode.column].offset(
  392. toNode,
  393. factor
  394. )
  395. ),
  396. nodeW = nodeWidth,
  397. right = toNode.column * colDistance,
  398. outgoing = point.outgoing,
  399. straight = right > nodeLeft;
  400. if (inverted) {
  401. fromY = chart.plotSizeY - fromY;
  402. toY = chart.plotSizeY - toY;
  403. right = chart.plotSizeX - right;
  404. nodeW = -nodeW;
  405. linkHeight = -linkHeight;
  406. straight = nodeLeft > right;
  407. }
  408. point.shapeType = 'path';
  409. // Links going from left to right
  410. if (straight) {
  411. point.shapeArgs = {
  412. d: [
  413. 'M', nodeLeft + nodeW, fromY,
  414. 'C', nodeLeft + nodeW + curvy, fromY,
  415. right - curvy, toY,
  416. right, toY,
  417. 'L',
  418. right + (outgoing ? nodeW : 0),
  419. toY + linkHeight / 2,
  420. 'L',
  421. right,
  422. toY + linkHeight,
  423. 'C', right - curvy, toY + linkHeight,
  424. nodeLeft + nodeW + curvy,
  425. fromY + linkHeight,
  426. nodeLeft + nodeW, fromY + linkHeight,
  427. 'z'
  428. ]
  429. };
  430. // Experimental: Circular links pointing backwards. In
  431. // v6.1.0 this breaks the rendering completely, so even
  432. // this experimental rendering is an improvement. #8218.
  433. // @todo
  434. // - Make room for the link in the layout
  435. // - Automatically determine if the link should go up or
  436. // down.
  437. } else {
  438. var bend = 20,
  439. vDist = chart.plotHeight - fromY - linkHeight,
  440. x1 = right - bend - linkHeight,
  441. x2 = right - bend,
  442. x3 = right,
  443. x4 = nodeLeft + nodeW,
  444. x5 = x4 + bend,
  445. x6 = x5 + linkHeight,
  446. fy1 = fromY,
  447. fy2 = fromY + linkHeight,
  448. fy3 = fy2 + bend,
  449. y4 = fy3 + vDist,
  450. y5 = y4 + bend,
  451. y6 = y5 + linkHeight,
  452. ty1 = toY,
  453. ty2 = ty1 + linkHeight,
  454. ty3 = ty2 + bend,
  455. cfy1 = fy2 - linkHeight * 0.7,
  456. cy2 = y5 + linkHeight * 0.7,
  457. cty1 = ty2 - linkHeight * 0.7,
  458. cx1 = x3 - linkHeight * 0.7,
  459. cx2 = x4 + linkHeight * 0.7;
  460. point.shapeArgs = {
  461. d: [
  462. 'M', x4, fy1,
  463. 'C', cx2, fy1, x6, cfy1, x6, fy3,
  464. 'L', x6, y4,
  465. 'C', x6, cy2, cx2, y6, x4, y6,
  466. 'L', x3, y6,
  467. 'C', cx1, y6, x1, cy2, x1, y4,
  468. 'L', x1, ty3,
  469. 'C', x1, cty1, cx1, ty1, x3, ty1,
  470. 'L', x3, ty2,
  471. 'C', x2, ty2, x2, ty2, x2, ty3,
  472. 'L', x2, y4,
  473. 'C', x2, y5, x2, y5, x3, y5,
  474. 'L', x4, y5,
  475. 'C', x5, y5, x5, y5, x5, y4,
  476. 'L', x5, fy3,
  477. 'C', x5, fy2, x5, fy2, x4, fy2,
  478. 'z'
  479. ]
  480. };
  481. }
  482. // Place data labels in the middle
  483. point.dlBox = {
  484. x: nodeLeft + (right - nodeLeft + nodeW) / 2,
  485. y: fromY + (toY - fromY) / 2,
  486. height: linkHeight,
  487. width: 0
  488. };
  489. // Pass test in drawPoints
  490. point.y = point.plotY = 1;
  491. if (!point.color) {
  492. point.color = node.color;
  493. }
  494. });
  495. });
  496. left += colDistance;
  497. }, this);
  498. },
  499. // Extend the render function to also render this.nodes together with
  500. // the points.
  501. render: function () {
  502. var points = this.points;
  503. this.points = this.points.concat(this.nodes);
  504. H.seriesTypes.column.prototype.render.call(this);
  505. this.points = points;
  506. },
  507. animate: H.Series.prototype.animate,
  508. destroy: function () {
  509. // Nodes must also be destroyed (#8682, #9300)
  510. this.data = [].concat(this.points, this.nodes);
  511. H.Series.prototype.destroy.call(this);
  512. }
  513. }, {
  514. getClassName: function () {
  515. return (this.isNode ? 'highcharts-node ' : 'highcharts-link ') +
  516. Point.prototype.getClassName.call(this);
  517. },
  518. isValid: function () {
  519. return this.isNode || typeof this.weight === 'number';
  520. }
  521. });
  522. /**
  523. * A `sankey` series. If the [type](#series.sankey.type) option is not
  524. * specified, it is inherited from [chart.type](#chart.type).
  525. *
  526. * @extends series,plotOptions.sankey
  527. * @excluding animationLimit, boostThreshold, borderColor, borderRadius,
  528. * borderWidth, crisp, cropThreshold, dataParser, dataURL, depth,
  529. * edgeColor, edgeWidth, findNearestPointBy, grouping, groupPadding,
  530. * groupZPadding, maxPointWidth, negativeColor, pointInterval,
  531. * pointIntervalUnit, pointPadding, pointPlacement, pointRange,
  532. * pointStart, pointWidth, shadow, softThreshold, stacking,
  533. * threshold, zoneAxis, zones
  534. * @product highcharts
  535. * @apioption series.sankey
  536. */
  537. /**
  538. * A collection of options for the individual nodes. The nodes in a sankey
  539. * diagram are auto-generated instances of `Highcharts.Point`, but options can
  540. * be applied here and linked by the `id`.
  541. *
  542. * @sample highcharts/css/sankey/
  543. * Sankey diagram with node options
  544. *
  545. * @type {Array<*>}
  546. * @product highcharts
  547. * @apioption series.sankey.nodes
  548. */
  549. /**
  550. * The id of the auto-generated node, refering to the `from` or `to` setting of
  551. * the link.
  552. *
  553. * @type {string}
  554. * @product highcharts
  555. * @apioption series.sankey.nodes.id
  556. */
  557. /**
  558. * The color of the auto generated node.
  559. *
  560. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  561. * @product highcharts
  562. * @apioption series.sankey.nodes.color
  563. */
  564. /**
  565. * The color index of the auto generated node, especially for use in styled
  566. * mode.
  567. *
  568. * @type {number}
  569. * @product highcharts
  570. * @apioption series.sankey.nodes.colorIndex
  571. */
  572. /**
  573. * An optional column index of where to place the node. The default behaviour is
  574. * to place it next to the preceding node.
  575. *
  576. * @sample highcharts/plotoptions/sankey-node-column/
  577. * Specified node column
  578. *
  579. * @type {number}
  580. * @since 6.0.5
  581. * @product highcharts
  582. * @apioption series.sankey.nodes.column
  583. */
  584. /**
  585. * The name to display for the node in data labels and tooltips. Use this when
  586. * the name is different from the `id`. Where the id must be unique for each
  587. * node, this is not necessary for the name.
  588. *
  589. * @sample highcharts/css/sankey/
  590. * Sankey diagram with node options
  591. *
  592. * @type {string}
  593. * @product highcharts
  594. * @apioption series.sankey.nodes.name
  595. */
  596. /**
  597. * The vertical offset of a node in terms of weight. Positive values shift the
  598. * node downwards, negative shift it upwards.
  599. *
  600. * @sample highcharts/plotoptions/sankey-node-column/
  601. * Specified node offset
  602. *
  603. * @type {number}
  604. * @default 0
  605. * @since 6.0.5
  606. * @product highcharts
  607. * @apioption series.sankey.nodes.offset
  608. */
  609. /**
  610. * An array of data points for the series. For the `sankey` series type,
  611. * points can be given in the following way:
  612. *
  613. * An array of objects with named values. The following snippet shows only a
  614. * few settings, see the complete options set below. If the total number of data
  615. * points exceeds the series' [turboThreshold](#series.area.turboThreshold),
  616. * this option is not available.
  617. *
  618. * ```js
  619. * data: [{
  620. * from: 'Category1',
  621. * to: 'Category2',
  622. * weight: 2
  623. * }, {
  624. * from: 'Category1',
  625. * to: 'Category3',
  626. * weight: 5
  627. * }]
  628. * ```
  629. *
  630. * @sample {highcharts} highcharts/series/data-array-of-objects/
  631. * Config objects
  632. *
  633. * @type {Array<*>}
  634. * @extends series.line.data
  635. * @excluding drilldown, marker, x, y
  636. * @product highcharts
  637. * @apioption series.sankey.data
  638. */
  639. /**
  640. * The color for the individual _link_. By default, the link color is the same
  641. * as the node it extends from. The `series.fillOpacity` option also applies to
  642. * the points, so when setting a specific link color, consider setting the
  643. * `fillOpacity` to 1.
  644. *
  645. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  646. * @product highcharts
  647. * @apioption series.sankey.data.color
  648. */
  649. /**
  650. * The node that the link runs from.
  651. *
  652. * @type {string}
  653. * @product highcharts
  654. * @apioption series.sankey.data.from
  655. */
  656. /**
  657. * The node that the link runs to.
  658. *
  659. * @type {string}
  660. * @product highcharts
  661. * @apioption series.sankey.data.to
  662. */
  663. /**
  664. * Whether the link goes out of the system.
  665. *
  666. * @sample highcharts/plotoptions/sankey-outgoing
  667. * Sankey chart with outgoing links
  668. *
  669. * @type {boolean}
  670. * @default false
  671. * @product highcharts
  672. * @apioption series.sankey.data.outgoing
  673. */
  674. /**
  675. * The weight of the link.
  676. *
  677. * @type {number}
  678. * @product highcharts
  679. * @apioption series.sankey.data.weight
  680. */