streamgraph.src.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /**
  2. * @license Highcharts JS v8.2.2 (2020-10-22)
  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/Series/Series.js']], function (BaseSeries) {
  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. /**
  44. * @private
  45. * @class
  46. * @name Highcharts.seriesTypes.streamgraph
  47. *
  48. * @augments Highcharts.Series
  49. */
  50. BaseSeries.seriesType('streamgraph', 'areaspline'
  51. /**
  52. * A streamgraph is a type of stacked area graph which is displaced around a
  53. * central axis, resulting in a flowing, organic shape.
  54. *
  55. * @sample {highcharts|highstock} highcharts/demo/streamgraph/
  56. * Streamgraph
  57. *
  58. * @extends plotOptions.areaspline
  59. * @since 6.0.0
  60. * @product highcharts highstock
  61. * @requires modules/streamgraph
  62. * @optionparent plotOptions.streamgraph
  63. */
  64. , {
  65. /**
  66. * @see [fillColor](#plotOptions.streamgraph.fillColor)
  67. * @see [fillOpacity](#plotOptions.streamgraph.fillOpacity)
  68. *
  69. * @apioption plotOptions.streamgraph.color
  70. */
  71. /**
  72. * @see [color](#plotOptions.streamgraph.color)
  73. * @see [fillOpacity](#plotOptions.streamgraph.fillOpacity)
  74. *
  75. * @apioption plotOptions.streamgraph.fillColor
  76. */
  77. /**
  78. * @see [color](#plotOptions.streamgraph.color)
  79. * @see [fillColor](#plotOptions.streamgraph.fillColor)
  80. *
  81. * @apioption plotOptions.streamgraph.fillOpacity
  82. */
  83. fillOpacity: 1,
  84. lineWidth: 0,
  85. marker: {
  86. enabled: false
  87. },
  88. stacking: 'stream'
  89. // Prototype functions
  90. }, {
  91. negStacks: false,
  92. // Modifier function for stream stacks. It simply moves the point up or
  93. // down in order to center the full stack vertically.
  94. streamStacker: function (pointExtremes, stack, i) {
  95. // Y bottom value
  96. pointExtremes[0] -= stack.total / 2;
  97. // Y value
  98. pointExtremes[1] -= stack.total / 2;
  99. // Record the Y data for use when getting axis extremes
  100. this.stackedYData[i] = pointExtremes;
  101. }
  102. });
  103. /**
  104. * A `streamgraph` series. If the [type](#series.streamgraph.type) option is not
  105. * specified, it is inherited from [chart.type](#chart.type).
  106. *
  107. * @extends series,plotOptions.streamgraph
  108. * @excluding dataParser, dataURL, step, boostThreshold, boostBlending
  109. * @product highcharts highstock
  110. * @requires modules/streamgraph
  111. * @apioption series.streamgraph
  112. */
  113. /**
  114. * @see [fillColor](#series.streamgraph.fillColor)
  115. * @see [fillOpacity](#series.streamgraph.fillOpacity)
  116. *
  117. * @apioption series.streamgraph.color
  118. */
  119. /**
  120. * An array of data points for the series. For the `streamgraph` series type,
  121. * points can be given in the following ways:
  122. *
  123. * 1. An array of numerical values. In this case, the numerical values will be
  124. * interpreted as `y` options. The `x` values will be automatically
  125. * calculated, either starting at 0 and incremented by 1, or from
  126. * `pointStart` and `pointInterval` given in the series options. If the axis
  127. * has categories, these will be used. Example:
  128. * ```js
  129. * data: [0, 5, 3, 5]
  130. * ```
  131. *
  132. * 2. An array of arrays with 2 values. In this case, the values correspond to
  133. * `x,y`. If the first value is a string, it is applied as the name of the
  134. * point, and the `x` value is inferred.
  135. * ```js
  136. * data: [
  137. * [0, 9],
  138. * [1, 7],
  139. * [2, 6]
  140. * ]
  141. * ```
  142. *
  143. * 3. An array of objects with named values. The following snippet shows only a
  144. * few settings, see the complete options set below. If the total number of
  145. * data points exceeds the series'
  146. * [turboThreshold](#series.area.turboThreshold),
  147. * this option is not available.
  148. * ```js
  149. * data: [{
  150. * x: 1,
  151. * y: 9,
  152. * name: "Point2",
  153. * color: "#00FF00"
  154. * }, {
  155. * x: 1,
  156. * y: 6,
  157. * name: "Point1",
  158. * color: "#FF00FF"
  159. * }]
  160. * ```
  161. *
  162. * @sample {highcharts} highcharts/chart/reflow-true/
  163. * Numerical values
  164. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  165. * Arrays of numeric x and y
  166. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  167. * Arrays of datetime x and y
  168. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  169. * Arrays of point.name and y
  170. * @sample {highcharts} highcharts/series/data-array-of-objects/
  171. * Config objects
  172. *
  173. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  174. * @extends series.line.data
  175. * @product highcharts highstock
  176. * @apioption series.streamgraph.data
  177. */
  178. /**
  179. * @see [color](#series.streamgraph.color)
  180. * @see [fillOpacity](#series.streamgraph.fillOpacity)
  181. *
  182. * @apioption series.streamgraph.fillColor
  183. */
  184. /**
  185. * @see [color](#series.streamgraph.color)
  186. * @see [fillColor](#series.streamgraph.fillColor)
  187. *
  188. * @type {number}
  189. * @default 1
  190. * @apioption series.streamgraph.fillOpacity
  191. */
  192. ''; // adds doclets above to transpiled file
  193. });
  194. _registerModule(_modules, 'masters/modules/streamgraph.src.js', [], function () {
  195. });
  196. }));