windbarb.src.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. /**
  2. * @license Highcharts JS v9.1.1 (2021-06-04)
  3. *
  4. * Wind barb series module
  5. *
  6. * (c) 2010-2021 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/windbarb', ['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, 'Mixins/OnSeries.js', [_modules['Series/Column/ColumnSeries.js'], _modules['Core/Series/Series.js'], _modules['Core/Utilities.js']], function (ColumnSeries, Series, U) {
  32. /* *
  33. *
  34. * (c) 2010-2021 Torstein Honsi
  35. *
  36. * License: www.highcharts.com/license
  37. *
  38. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  39. *
  40. * */
  41. var columnProto = ColumnSeries.prototype;
  42. var seriesProto = Series.prototype;
  43. var defined = U.defined,
  44. stableSort = U.stableSort;
  45. /**
  46. * @private
  47. * @mixin onSeriesMixin
  48. */
  49. var onSeriesMixin = {
  50. /* eslint-disable valid-jsdoc */
  51. /**
  52. * Override getPlotBox. If the onSeries option is valid,
  53. return the plot box
  54. * of the onSeries,
  55. otherwise proceed as usual.
  56. *
  57. * @private
  58. * @function onSeriesMixin.getPlotBox
  59. * @return {Highcharts.SeriesPlotBoxObject}
  60. */
  61. getPlotBox: function () {
  62. return seriesProto.getPlotBox.call((this.options.onSeries &&
  63. this.chart.get(this.options.onSeries)) || this);
  64. },
  65. /**
  66. * Extend the translate method by placing the point on the related series
  67. *
  68. * @private
  69. * @function onSeriesMixin.translate
  70. * @return {void}
  71. */
  72. translate: function () {
  73. columnProto.translate.apply(this);
  74. var series = this,
  75. options = series.options,
  76. chart = series.chart,
  77. points = series.points,
  78. cursor = points.length - 1,
  79. point,
  80. lastPoint,
  81. optionsOnSeries = options.onSeries,
  82. onSeries = (optionsOnSeries &&
  83. chart.get(optionsOnSeries)),
  84. onKey = options.onKey || 'y',
  85. step = onSeries && onSeries.options.step,
  86. onData = (onSeries && onSeries.points),
  87. i = onData && onData.length,
  88. inverted = chart.inverted,
  89. xAxis = series.xAxis,
  90. yAxis = series.yAxis,
  91. xOffset = 0,
  92. leftPoint,
  93. lastX,
  94. rightPoint,
  95. currentDataGrouping,
  96. distanceRatio;
  97. // relate to a master series
  98. if (onSeries && onSeries.visible && i) {
  99. xOffset = (onSeries.pointXOffset || 0) + (onSeries.barW || 0) / 2;
  100. currentDataGrouping = onSeries.currentDataGrouping;
  101. lastX = (onData[i - 1].x +
  102. (currentDataGrouping ? currentDataGrouping.totalRange : 0)); // #2374
  103. // sort the data points
  104. stableSort(points, function (a, b) {
  105. return (a.x - b.x);
  106. });
  107. onKey = 'plot' + onKey[0].toUpperCase() + onKey.substr(1);
  108. while (i-- && points[cursor]) {
  109. leftPoint = onData[i];
  110. point = points[cursor];
  111. point.y = leftPoint.y;
  112. if (leftPoint.x <= point.x &&
  113. typeof leftPoint[onKey] !== 'undefined') {
  114. if (point.x <= lastX) { // #803
  115. point.plotY = leftPoint[onKey];
  116. // interpolate between points, #666
  117. if (leftPoint.x < point.x &&
  118. !step) {
  119. rightPoint = onData[i + 1];
  120. if (rightPoint &&
  121. typeof rightPoint[onKey] !== 'undefined') {
  122. // the distance ratio, between 0 and 1
  123. distanceRatio =
  124. (point.x - leftPoint.x) /
  125. (rightPoint.x - leftPoint.x);
  126. point.plotY +=
  127. distanceRatio *
  128. // the plotY distance
  129. (rightPoint[onKey] - leftPoint[onKey]);
  130. point.y +=
  131. distanceRatio *
  132. (rightPoint.y - leftPoint.y);
  133. }
  134. }
  135. }
  136. cursor--;
  137. i++; // check again for points in the same x position
  138. if (cursor < 0) {
  139. break;
  140. }
  141. }
  142. }
  143. }
  144. // Add plotY position and handle stacking
  145. points.forEach(function (point, i) {
  146. var stackIndex;
  147. point.plotX += xOffset; // #2049
  148. // Undefined plotY means the point is either on axis, outside series
  149. // range or hidden series. If the series is outside the range of the
  150. // x axis it should fall through with an undefined plotY, but then
  151. // we must remove the shapeArgs (#847). For inverted charts, we need
  152. // to calculate position anyway, because series.invertGroups is not
  153. // defined
  154. if (typeof point.plotY === 'undefined' || inverted) {
  155. if (point.plotX >= 0 &&
  156. point.plotX <= xAxis.len) {
  157. // We're inside xAxis range
  158. if (inverted) {
  159. point.plotY = xAxis.translate(point.x, 0, 1, 0, 1);
  160. point.plotX = defined(point.y) ?
  161. yAxis.translate(point.y, 0, 0, 0, 1) :
  162. 0;
  163. }
  164. else {
  165. point.plotY = (xAxis.opposite ? 0 : series.yAxis.len) +
  166. xAxis.offset; // For the windbarb demo
  167. }
  168. }
  169. else {
  170. point.shapeArgs = {}; // 847
  171. }
  172. }
  173. // if multiple flags appear at the same x, order them into a stack
  174. lastPoint = points[i - 1];
  175. if (lastPoint && lastPoint.plotX === point.plotX) {
  176. if (typeof lastPoint.stackIndex === 'undefined') {
  177. lastPoint.stackIndex = 0;
  178. }
  179. stackIndex = lastPoint.stackIndex + 1;
  180. }
  181. point.stackIndex = stackIndex; // #3639
  182. });
  183. this.onSeries = onSeries;
  184. }
  185. /* eslint-enable valid-jsdoc */
  186. };
  187. return onSeriesMixin;
  188. });
  189. _registerModule(_modules, 'Series/Windbarb/WindbarbPoint.js', [_modules['Core/Utilities.js'], _modules['Series/Column/ColumnSeries.js']], function (U, ColumnSeries) {
  190. /* *
  191. *
  192. * Wind barb series module
  193. *
  194. * (c) 2010-2021 Torstein Honsi
  195. *
  196. * License: www.highcharts.com/license
  197. *
  198. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  199. *
  200. * */
  201. var __extends = (this && this.__extends) || (function () {
  202. var extendStatics = function (d,
  203. b) {
  204. extendStatics = Object.setPrototypeOf ||
  205. ({ __proto__: [] } instanceof Array && function (d,
  206. b) { d.__proto__ = b; }) ||
  207. function (d,
  208. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  209. return extendStatics(d, b);
  210. };
  211. return function (d, b) {
  212. extendStatics(d, b);
  213. function __() { this.constructor = d; }
  214. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  215. };
  216. })();
  217. var isNumber = U.isNumber;
  218. /* *
  219. *
  220. * Class
  221. *
  222. * */
  223. var WindbarbPoint = /** @class */ (function (_super) {
  224. __extends(WindbarbPoint, _super);
  225. function WindbarbPoint() {
  226. var _this = _super !== null && _super.apply(this,
  227. arguments) || this;
  228. /* *
  229. *
  230. * Properties
  231. *
  232. * */
  233. _this.beaufort = void 0;
  234. _this.beaufortLevel = void 0;
  235. _this.direction = void 0;
  236. _this.options = void 0;
  237. _this.series = void 0;
  238. return _this;
  239. }
  240. /* *
  241. *
  242. * Functions
  243. *
  244. * */
  245. WindbarbPoint.prototype.isValid = function () {
  246. return isNumber(this.value) && this.value >= 0;
  247. };
  248. return WindbarbPoint;
  249. }(ColumnSeries.prototype.pointClass));
  250. /* *
  251. *
  252. * Default export
  253. *
  254. * */
  255. return WindbarbPoint;
  256. });
  257. _registerModule(_modules, 'Series/Windbarb/WindbarbSeries.js', [_modules['Core/Animation/AnimationUtilities.js'], _modules['Core/Globals.js'], _modules['Mixins/OnSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js'], _modules['Series/Windbarb/WindbarbPoint.js']], function (A, H, OnSeriesMixin, SeriesRegistry, U, WindbarbPoint) {
  258. /* *
  259. *
  260. * Wind barb series module
  261. *
  262. * (c) 2010-2021 Torstein Honsi
  263. *
  264. * License: www.highcharts.com/license
  265. *
  266. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  267. *
  268. * */
  269. var __extends = (this && this.__extends) || (function () {
  270. var extendStatics = function (d,
  271. b) {
  272. extendStatics = Object.setPrototypeOf ||
  273. ({ __proto__: [] } instanceof Array && function (d,
  274. b) { d.__proto__ = b; }) ||
  275. function (d,
  276. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  277. return extendStatics(d, b);
  278. };
  279. return function (d, b) {
  280. extendStatics(d, b);
  281. function __() { this.constructor = d; }
  282. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  283. };
  284. })();
  285. var animObject = A.animObject;
  286. var noop = H.noop;
  287. var Series = SeriesRegistry.series,
  288. ColumnSeries = SeriesRegistry.seriesTypes.column;
  289. var extend = U.extend,
  290. merge = U.merge,
  291. pick = U.pick;
  292. /**
  293. * @private
  294. * @class
  295. * @name Highcharts.seriesTypes.windbarb
  296. *
  297. * @augments Highcharts.Series
  298. */
  299. var WindbarbSeries = /** @class */ (function (_super) {
  300. __extends(WindbarbSeries, _super);
  301. function WindbarbSeries() {
  302. /* *
  303. *
  304. * Static properties
  305. *
  306. * */
  307. var _this = _super !== null && _super.apply(this,
  308. arguments) || this;
  309. /* *
  310. *
  311. * Properties
  312. *
  313. * */
  314. _this.data = void 0;
  315. _this.options = void 0;
  316. _this.points = void 0;
  317. return _this;
  318. }
  319. /* *
  320. *
  321. * Static functions
  322. *
  323. * */
  324. // eslint-disable-next-line valid-jsdoc
  325. /**
  326. * Once off, register the windbarb approximation for data grouping. This can
  327. * be called anywhere (not necessarily in the translate function), but must
  328. * happen after the data grouping module is loaded and before the
  329. * wind barb series uses it.
  330. * @private
  331. */
  332. WindbarbSeries.registerApproximation = function () {
  333. if (H.approximations && !H.approximations.windbarb) {
  334. H.approximations.windbarb = function (values, directions) {
  335. var vectorX = 0,
  336. vectorY = 0,
  337. i,
  338. len = values.length;
  339. for (i = 0; i < len; i++) {
  340. vectorX += values[i] * Math.cos(directions[i] * H.deg2rad);
  341. vectorY += values[i] * Math.sin(directions[i] * H.deg2rad);
  342. }
  343. return [
  344. // Wind speed
  345. values.reduce(function (sum, value) {
  346. return sum + value;
  347. }, 0) / values.length,
  348. // Wind direction
  349. Math.atan2(vectorY, vectorX) / H.deg2rad
  350. ];
  351. };
  352. }
  353. };
  354. /* *
  355. *
  356. * Functions
  357. *
  358. * */
  359. WindbarbSeries.prototype.init = function (chart, options) {
  360. WindbarbSeries.registerApproximation();
  361. Series.prototype.init.call(this, chart, options);
  362. };
  363. // Get presentational attributes.
  364. WindbarbSeries.prototype.pointAttribs = function (point, state) {
  365. var options = this.options,
  366. stroke = point.color || this.color,
  367. strokeWidth = this.options.lineWidth;
  368. if (state) {
  369. stroke = options.states[state].color || stroke;
  370. strokeWidth =
  371. (options.states[state].lineWidth || strokeWidth) +
  372. (options.states[state].lineWidthPlus || 0);
  373. }
  374. return {
  375. 'stroke': stroke,
  376. 'stroke-width': strokeWidth
  377. };
  378. };
  379. // Create a single wind arrow. It is later rotated around the zero
  380. // centerpoint.
  381. WindbarbSeries.prototype.windArrow = function (point) {
  382. var knots = point.value * 1.943844,
  383. level = point.beaufortLevel,
  384. path,
  385. barbs,
  386. u = this.options.vectorLength / 20,
  387. pos = -10;
  388. if (point.isNull) {
  389. return [];
  390. }
  391. if (level === 0) {
  392. return this.chart.renderer.symbols.circle(-10 * u, -10 * u, 20 * u, 20 * u);
  393. }
  394. // The stem and the arrow head
  395. path = [
  396. ['M', 0, 7 * u],
  397. ['L', -1.5 * u, 7 * u],
  398. ['L', 0, 10 * u],
  399. ['L', 1.5 * u, 7 * u],
  400. ['L', 0, 7 * u],
  401. ['L', 0, -10 * u] // top
  402. ];
  403. // For each full 50 knots, add a pennant
  404. barbs = (knots - knots % 50) / 50; // pennants
  405. if (barbs > 0) {
  406. while (barbs--) {
  407. path.push(pos === -10 ? ['L', 0, pos * u] : ['M', 0, pos * u], ['L', 5 * u, pos * u + 2], ['L', 0, pos * u + 4]);
  408. // Substract from the rest and move position for next
  409. knots -= 50;
  410. pos += 7;
  411. }
  412. }
  413. // For each full 10 knots, add a full barb
  414. barbs = (knots - knots % 10) / 10;
  415. if (barbs > 0) {
  416. while (barbs--) {
  417. path.push(pos === -10 ? ['L', 0, pos * u] : ['M', 0, pos * u], ['L', 7 * u, pos * u]);
  418. knots -= 10;
  419. pos += 3;
  420. }
  421. }
  422. // For each full 5 knots, add a half barb
  423. barbs = (knots - knots % 5) / 5; // half barbs
  424. if (barbs > 0) {
  425. while (barbs--) {
  426. path.push(pos === -10 ? ['L', 0, pos * u] : ['M', 0, pos * u], ['L', 4 * u, pos * u]);
  427. knots -= 5;
  428. pos += 3;
  429. }
  430. }
  431. return path;
  432. };
  433. WindbarbSeries.prototype.translate = function () {
  434. var beaufortFloor = this.beaufortFloor,
  435. beaufortName = this.beaufortName;
  436. OnSeriesMixin.translate.call(this);
  437. this.points.forEach(function (point) {
  438. var level = 0;
  439. // Find the beaufort level (zero based)
  440. for (; level < beaufortFloor.length; level++) {
  441. if (beaufortFloor[level] > point.value) {
  442. break;
  443. }
  444. }
  445. point.beaufortLevel = level - 1;
  446. point.beaufort = beaufortName[level - 1];
  447. });
  448. };
  449. WindbarbSeries.prototype.drawPoints = function () {
  450. var chart = this.chart,
  451. yAxis = this.yAxis,
  452. inverted = chart.inverted,
  453. shapeOffset = this.options.vectorLength / 2;
  454. this.points.forEach(function (point) {
  455. var plotX = point.plotX,
  456. plotY = point.plotY;
  457. // Check if it's inside the plot area, but only for the X
  458. // dimension.
  459. if (this.options.clip === false ||
  460. chart.isInsidePlot(plotX, 0)) {
  461. // Create the graphic the first time
  462. if (!point.graphic) {
  463. point.graphic = this.chart.renderer
  464. .path()
  465. .add(this.markerGroup)
  466. .addClass('highcharts-point ' +
  467. 'highcharts-color-' +
  468. pick(point.colorIndex, point.series.colorIndex));
  469. }
  470. // Position the graphic
  471. point.graphic
  472. .attr({
  473. d: this.windArrow(point),
  474. translateX: plotX + this.options.xOffset,
  475. translateY: plotY + this.options.yOffset,
  476. rotation: point.direction
  477. });
  478. if (!this.chart.styledMode) {
  479. point.graphic
  480. .attr(this.pointAttribs(point));
  481. }
  482. }
  483. else if (point.graphic) {
  484. point.graphic = point.graphic.destroy();
  485. }
  486. // Set the tooltip anchor position
  487. point.tooltipPos = [
  488. plotX + this.options.xOffset +
  489. (inverted && !this.onSeries ? shapeOffset : 0),
  490. plotY + this.options.yOffset -
  491. (inverted ?
  492. 0 :
  493. shapeOffset + yAxis.pos - chart.plotTop)
  494. ]; // #6327
  495. }, this);
  496. };
  497. // Fade in the arrows on initializing series.
  498. WindbarbSeries.prototype.animate = function (init) {
  499. if (init) {
  500. this.markerGroup.attr({
  501. opacity: 0.01
  502. });
  503. }
  504. else {
  505. this.markerGroup.animate({
  506. opacity: 1
  507. }, animObject(this.options.animation));
  508. }
  509. };
  510. WindbarbSeries.prototype.markerAttribs = function (point, state) {
  511. return {};
  512. };
  513. WindbarbSeries.prototype.getExtremes = function () {
  514. return {};
  515. };
  516. WindbarbSeries.prototype.shouldShowTooltip = function (plotX, plotY, options) {
  517. if (options === void 0) { options = {}; }
  518. options.ignoreX = this.chart.inverted;
  519. options.ignoreY = !options.ignoreX;
  520. return _super.prototype.shouldShowTooltip.call(this, plotX, plotY, options);
  521. };
  522. /**
  523. * Wind barbs are a convenient way to represent wind speed and direction in
  524. * one graphical form. Wind direction is given by the stem direction, and
  525. * wind speed by the number and shape of barbs.
  526. *
  527. * @sample {highcharts|highstock} highcharts/demo/windbarb-series/
  528. * Wind barb series
  529. *
  530. * @extends plotOptions.column
  531. * @excluding boostThreshold, marker, connectEnds, connectNulls,
  532. * cropThreshold, dashStyle, dragDrop, gapSize, gapUnit,
  533. * linecap, shadow, stacking, step, boostBlending
  534. * @since 6.0.0
  535. * @product highcharts highstock
  536. * @requires modules/windbarb
  537. * @optionparent plotOptions.windbarb
  538. */
  539. WindbarbSeries.defaultOptions = merge(ColumnSeries.defaultOptions, {
  540. /**
  541. * Data grouping options for the wind barbs. In Highcharts, this
  542. * requires the `modules/datagrouping.js` module to be loaded. In
  543. * Highcharts Stock, data grouping is included.
  544. *
  545. * @sample highcharts/plotoptions/windbarb-datagrouping
  546. * Wind barb with data grouping
  547. *
  548. * @since 7.1.0
  549. * @product highcharts highstock
  550. */
  551. dataGrouping: {
  552. /**
  553. * Whether to enable data grouping.
  554. *
  555. * @product highcharts highstock
  556. */
  557. enabled: true,
  558. /**
  559. * Approximation function for the data grouping. The default
  560. * returns an average of wind speed and a vector average direction
  561. * weighted by wind speed.
  562. *
  563. * @product highcharts highstock
  564. *
  565. * @type {string|Function}
  566. */
  567. approximation: 'windbarb',
  568. /**
  569. * The approximate data group width.
  570. *
  571. * @product highcharts highstock
  572. */
  573. groupPixelWidth: 30
  574. },
  575. /**
  576. * The line width of the wind barb symbols.
  577. */
  578. lineWidth: 2,
  579. /**
  580. * The id of another series in the chart that the wind barbs are
  581. * projected on. When `null`, the wind symbols are drawn on the X axis,
  582. * but offset up or down by the `yOffset` setting.
  583. *
  584. * @sample {highcharts|highstock} highcharts/plotoptions/windbarb-onseries
  585. * Projected on area series
  586. *
  587. * @type {string|null}
  588. */
  589. onSeries: null,
  590. states: {
  591. hover: {
  592. lineWidthPlus: 0
  593. }
  594. },
  595. tooltip: {
  596. /**
  597. * The default point format for the wind barb tooltip. Note the
  598. * `point.beaufort` property that refers to the Beaufort wind scale.
  599. * The names can be internationalized by modifying
  600. * `Highcharts.seriesTypes.windbarb.prototype.beaufortNames`.
  601. */
  602. pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.value}</b> ({point.beaufort})<br/>'
  603. },
  604. /**
  605. * Pixel length of the stems.
  606. */
  607. vectorLength: 20,
  608. /**
  609. * @default value
  610. */
  611. colorKey: 'value',
  612. /**
  613. * Vertical offset from the cartesian position, in pixels. The default
  614. * value makes sure the symbols don't overlap the X axis when `onSeries`
  615. * is `null`, and that they don't overlap the linked series when
  616. * `onSeries` is given.
  617. */
  618. yOffset: -20,
  619. /**
  620. * Horizontal offset from the cartesian position, in pixels. When the
  621. * chart is inverted, this option allows translation like
  622. * [yOffset](#plotOptions.windbarb.yOffset) in non inverted charts.
  623. *
  624. * @since 6.1.0
  625. */
  626. xOffset: 0
  627. });
  628. return WindbarbSeries;
  629. }(ColumnSeries));
  630. extend(WindbarbSeries.prototype, {
  631. pointArrayMap: ['value', 'direction'],
  632. parallelArrays: ['x', 'value', 'direction'],
  633. beaufortName: ['Calm', 'Light air', 'Light breeze',
  634. 'Gentle breeze', 'Moderate breeze', 'Fresh breeze',
  635. 'Strong breeze', 'Near gale', 'Gale', 'Strong gale', 'Storm',
  636. 'Violent storm', 'Hurricane'],
  637. beaufortFloor: [0, 0.3, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8,
  638. 24.5, 28.5, 32.7],
  639. trackerGroups: ['markerGroup'],
  640. getPlotBox: OnSeriesMixin.getPlotBox,
  641. // Don't invert the marker group (#4960)
  642. invertGroups: noop
  643. });
  644. WindbarbSeries.prototype.pointClass = WindbarbPoint;
  645. /* *
  646. *
  647. * Registry
  648. *
  649. * */
  650. WindbarbSeries.registerApproximation();
  651. SeriesRegistry.registerSeriesType('windbarb', WindbarbSeries);
  652. /* *
  653. *
  654. * Export default
  655. *
  656. * */
  657. /* *
  658. *
  659. * API Options
  660. *
  661. * */
  662. /**
  663. * A `windbarb` series. If the [type](#series.windbarb.type) option is not
  664. * specified, it is inherited from [chart.type](#chart.type).
  665. *
  666. * @extends series,plotOptions.windbarb
  667. * @excluding dataParser, dataURL, boostThreshold, boostBlending
  668. * @product highcharts highstock
  669. * @requires modules/windbarb
  670. * @apioption series.windbarb
  671. */
  672. /**
  673. * An array of data points for the series. For the `windbarb` series type,
  674. * points can be given in the following ways:
  675. *
  676. * 1. An array of arrays with 3 values. In this case, the values correspond to
  677. * `x,value,direction`. If the first value is a string, it is applied as the
  678. * name of the point, and the `x` value is inferred.
  679. * ```js
  680. * data: [
  681. * [Date.UTC(2017, 0, 1, 0), 3.3, 90],
  682. * [Date.UTC(2017, 0, 1, 1), 12.1, 180],
  683. * [Date.UTC(2017, 0, 1, 2), 11.1, 270]
  684. * ]
  685. * ```
  686. *
  687. * 2. An array of objects with named values. The following snippet shows only a
  688. * few settings, see the complete options set below. If the total number of
  689. * data points exceeds the series'
  690. * [turboThreshold](#series.area.turboThreshold), this option is not
  691. * available.
  692. * ```js
  693. * data: [{
  694. * x: Date.UTC(2017, 0, 1, 0),
  695. * value: 12.1,
  696. * direction: 90
  697. * }, {
  698. * x: Date.UTC(2017, 0, 1, 1),
  699. * value: 11.1,
  700. * direction: 270
  701. * }]
  702. * ```
  703. *
  704. * @sample {highcharts} highcharts/chart/reflow-true/
  705. * Numerical values
  706. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  707. * Arrays of numeric x and y
  708. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  709. * Arrays of datetime x and y
  710. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  711. * Arrays of point.name and y
  712. * @sample {highcharts} highcharts/series/data-array-of-objects/
  713. * Config objects
  714. *
  715. * @type {Array<Array<(number|string),number,number>|*>}
  716. * @extends series.line.data
  717. * @product highcharts highstock
  718. * @apioption series.windbarb.data
  719. */
  720. /**
  721. * The wind speed in meters per second.
  722. *
  723. * @type {number|null}
  724. * @product highcharts highstock
  725. * @apioption series.windbarb.data.value
  726. */
  727. /**
  728. * The wind direction in degrees, where 0 is north (pointing towards south).
  729. *
  730. * @type {number}
  731. * @product highcharts highstock
  732. * @apioption series.windbarb.data.direction
  733. */
  734. ''; // adds doclets above to transpiled file
  735. return WindbarbSeries;
  736. });
  737. _registerModule(_modules, 'masters/modules/windbarb.src.js', [], function () {
  738. });
  739. }));