boost.src.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * @license Highcharts JS v8.0.0 (2019-12-10)
  3. * @module highcharts/modules/boost
  4. * @requires highcharts
  5. *
  6. * Boost module
  7. *
  8. * (c) 2010-2019 Highsoft AS
  9. * Author: Torstein Honsi
  10. *
  11. * License: www.highcharts.com/license
  12. *
  13. * This is a Highcharts module that draws long data series on a canvas in order
  14. * to increase performance of the initial load time and tooltip responsiveness.
  15. *
  16. * Compatible with WebGL compatible browsers (not IE < 11).
  17. *
  18. * If this module is taken in as part of the core
  19. * - All the loading logic should be merged with core. Update styles in the
  20. * core.
  21. * - Most of the method wraps should probably be added directly in parent
  22. * methods.
  23. *
  24. * Notes for boost mode
  25. * - Area lines are not drawn
  26. * - Lines are not drawn on scatter charts
  27. * - Zones and negativeColor don't work
  28. * - Dash styles are not rendered on lines.
  29. * - Columns are always one pixel wide. Don't set the threshold too low.
  30. * - Disable animations
  31. * - Marker shapes are not supported: markers will always be circles
  32. *
  33. * Optimizing tips for users
  34. * - Set extremes (min, max) explicitly on the axes in order for Highcharts to
  35. * avoid computing extremes.
  36. * - Set enableMouseTracking to false on the series to improve total rendering
  37. * time.
  38. * - The default threshold is set based on one series. If you have multiple,
  39. * dense series, the combined number of points drawn gets higher, and you may
  40. * want to set the threshold lower in order to use optimizations.
  41. * - If drawing large scatter charts, it's beneficial to set the marker radius
  42. * to a value less than 1. This is to add additional spacing to make the chart
  43. * more readable.
  44. * - If the value increments on both the X and Y axis aren't small, consider
  45. * setting useGPUTranslations to true on the boost settings object. If you do
  46. * this and the increments are small (e.g. datetime axis with small time
  47. * increments) it may cause rendering issues due to floating point rounding
  48. * errors, so your millage may vary.
  49. *
  50. * Settings
  51. * There are two ways of setting the boost threshold:
  52. * - Per series: boost based on number of points in individual series
  53. * - Per chart: boost based on the number of series
  54. *
  55. * To set the series boost threshold, set seriesBoostThreshold on the chart
  56. * object.
  57. * To set the series-specific threshold, set boostThreshold on the series
  58. * object.
  59. *
  60. * In addition, the following can be set in the boost object:
  61. * {
  62. * //Wether or not to use alpha blending
  63. * useAlpha: boolean - default: true
  64. * //Set to true to perform translations on the GPU.
  65. * //Much faster, but may cause rendering issues
  66. * //when using values far from 0 due to floating point
  67. * //rounding issues
  68. * useGPUTranslations: boolean - default: false
  69. * //Use pre-allocated buffers, much faster,
  70. * //but may cause rendering issues with some data sets
  71. * usePreallocated: boolean - default: false
  72. * }
  73. */
  74. /* *
  75. * Options for the Boost module. The Boost module allows certain series types
  76. * to be rendered by WebGL instead of the default SVG. This allows hundreds of
  77. * thousands of data points to be rendered in milliseconds. In addition to the
  78. * WebGL rendering it saves time by skipping processing and inspection of the
  79. * data wherever possible. This introduces some limitations to what features are
  80. * available in boost mode. See [the docs](
  81. * https://www.highcharts.com/docs/advanced-chart-features/boost-module) for
  82. * details.
  83. *
  84. * In addition to the global `boost` option, each series has a
  85. * [boostThreshold](#plotOptions.series.boostThreshold) that defines when the
  86. * boost should kick in.
  87. *
  88. * Requires the `modules/boost.js` module.
  89. *
  90. * @sample {highstock} highcharts/boost/line-series-heavy-stock
  91. * Stock chart
  92. * @sample {highstock} highcharts/boost/line-series-heavy-dynamic
  93. * Dynamic stock chart
  94. * @sample highcharts/boost/line
  95. * Line chart
  96. * @sample highcharts/boost/line-series-heavy
  97. * Line chart with hundreds of series
  98. * @sample highcharts/boost/scatter
  99. * Scatter chart
  100. * @sample highcharts/boost/area
  101. * Area chart
  102. * @sample highcharts/boost/arearange
  103. * Area range chart
  104. * @sample highcharts/boost/column
  105. * Column chart
  106. * @sample highcharts/boost/columnrange
  107. * Column range chart
  108. * @sample highcharts/boost/bubble
  109. * Bubble chart
  110. * @sample highcharts/boost/heatmap
  111. * Heat map
  112. * @sample highcharts/boost/treemap
  113. * Tree map
  114. *
  115. * @product highcharts highstock
  116. * @apioption boost
  117. * */
  118. 'use strict';
  119. import '../../modules/boost/boost.js';