streamgraph.src.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /**
  2. * @license Highcharts JS v8.2.0 (2020-08-20)
  3. *
  4. * Streamgraph module
  5. *
  6. * (c) 2010-2019 Torstein Honsi
  7. *
  8. * License: www.highcharts.com/license
  9. */
  10. 'use strict';
  11. (function (factory) {
  12. if (typeof module === 'object' && module.exports) {
  13. factory['default'] = factory;
  14. module.exports = factory;
  15. } else if (typeof define === 'function' && define.amd) {
  16. define('highcharts/modules/streamgraph', ['highcharts'], function (Highcharts) {
  17. factory(Highcharts);
  18. factory.Highcharts = Highcharts;
  19. return factory;
  20. });
  21. } else {
  22. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  23. }
  24. }(function (Highcharts) {
  25. var _modules = Highcharts ? Highcharts._modules : {};
  26. function _registerModule(obj, path, args, fn) {
  27. if (!obj.hasOwnProperty(path)) {
  28. obj[path] = fn.apply(null, args);
  29. }
  30. }
  31. _registerModule(_modules, 'Series/StreamgraphSeries.js', [_modules['Core/Utilities.js']], function (U) {
  32. /* *
  33. *
  34. * Streamgraph module
  35. *
  36. * (c) 2010-2020 Torstein Honsi
  37. *
  38. * License: www.highcharts.com/license
  39. *
  40. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  41. *
  42. * */
  43. var seriesType = U.seriesType;
  44. /**
  45. * @private
  46. * @class
  47. * @name Highcharts.seriesTypes.streamgraph
  48. *
  49. * @augments Highcharts.Series
  50. */
  51. seriesType('streamgraph', 'areaspline'
  52. /**
  53. * A streamgraph is a type of stacked area graph which is displaced around a
  54. * central axis, resulting in a flowing, organic shape.
  55. *
  56. * @sample {highcharts|highstock} highcharts/demo/streamgraph/
  57. * Streamgraph
  58. *
  59. * @extends plotOptions.areaspline
  60. * @since 6.0.0
  61. * @product highcharts highstock
  62. * @requires modules/streamgraph
  63. * @optionparent plotOptions.streamgraph
  64. */
  65. , {
  66. fillOpacity: 1,
  67. lineWidth: 0,
  68. marker: {
  69. enabled: false
  70. },
  71. stacking: 'stream'
  72. // Prototype functions
  73. }, {
  74. negStacks: false,
  75. // Modifier function for stream stacks. It simply moves the point up or
  76. // down in order to center the full stack vertically.
  77. streamStacker: function (pointExtremes, stack, i) {
  78. // Y bottom value
  79. pointExtremes[0] -= stack.total / 2;
  80. // Y value
  81. pointExtremes[1] -= stack.total / 2;
  82. // Record the Y data for use when getting axis extremes
  83. this.stackedYData[i] = pointExtremes;
  84. }
  85. });
  86. /**
  87. * A `streamgraph` series. If the [type](#series.streamgraph.type) option is not
  88. * specified, it is inherited from [chart.type](#chart.type).
  89. *
  90. * @extends series,plotOptions.streamgraph
  91. * @excluding dataParser, dataURL, step, boostThreshold, boostBlending
  92. * @product highcharts highstock
  93. * @requires modules/streamgraph
  94. * @apioption series.streamgraph
  95. */
  96. /**
  97. * An array of data points for the series. For the `streamgraph` series type,
  98. * points can be given in the following ways:
  99. *
  100. * 1. An array of numerical values. In this case, the numerical values will be
  101. * interpreted as `y` options. The `x` values will be automatically
  102. * calculated, either starting at 0 and incremented by 1, or from
  103. * `pointStart` and `pointInterval` given in the series options. If the axis
  104. * has categories, these will be used. Example:
  105. * ```js
  106. * data: [0, 5, 3, 5]
  107. * ```
  108. *
  109. * 2. An array of arrays with 2 values. In this case, the values correspond to
  110. * `x,y`. If the first value is a string, it is applied as the name of the
  111. * point, and the `x` value is inferred.
  112. * ```js
  113. * data: [
  114. * [0, 9],
  115. * [1, 7],
  116. * [2, 6]
  117. * ]
  118. * ```
  119. *
  120. * 3. An array of objects with named values. The following snippet shows only a
  121. * few settings, see the complete options set below. If the total number of
  122. * data points exceeds the series'
  123. * [turboThreshold](#series.area.turboThreshold),
  124. * this option is not available.
  125. * ```js
  126. * data: [{
  127. * x: 1,
  128. * y: 9,
  129. * name: "Point2",
  130. * color: "#00FF00"
  131. * }, {
  132. * x: 1,
  133. * y: 6,
  134. * name: "Point1",
  135. * color: "#FF00FF"
  136. * }]
  137. * ```
  138. *
  139. * @sample {highcharts} highcharts/chart/reflow-true/
  140. * Numerical values
  141. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  142. * Arrays of numeric x and y
  143. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  144. * Arrays of datetime x and y
  145. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  146. * Arrays of point.name and y
  147. * @sample {highcharts} highcharts/series/data-array-of-objects/
  148. * Config objects
  149. *
  150. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  151. * @extends series.line.data
  152. * @product highcharts highstock
  153. * @apioption series.streamgraph.data
  154. */
  155. ''; // adds doclets above to transpiled file
  156. });
  157. _registerModule(_modules, 'masters/modules/streamgraph.src.js', [], function () {
  158. });
  159. }));