boost.src.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /**
  2. * @license Highcharts JS v8.2.0 (2020-08-20)
  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, except
  32. * heatmap series, where markers are always rectangles.
  33. *
  34. * Optimizing tips for users
  35. * - Set extremes (min, max) explicitly on the axes in order for Highcharts to
  36. * avoid computing extremes.
  37. * - Set enableMouseTracking to false on the series to improve total rendering
  38. * time.
  39. * - The default threshold is set based on one series. If you have multiple,
  40. * dense series, the combined number of points drawn gets higher, and you may
  41. * want to set the threshold lower in order to use optimizations.
  42. * - If drawing large scatter charts, it's beneficial to set the marker radius
  43. * to a value less than 1. This is to add additional spacing to make the chart
  44. * more readable.
  45. * - If the value increments on both the X and Y axis aren't small, consider
  46. * setting useGPUTranslations to true on the boost settings object. If you do
  47. * this and the increments are small (e.g. datetime axis with small time
  48. * increments) it may cause rendering issues due to floating point rounding
  49. * errors, so your millage may vary.
  50. *
  51. * Settings
  52. * There are two ways of setting the boost threshold:
  53. * - Per series: boost based on number of points in individual series
  54. * - Per chart: boost based on the number of series
  55. *
  56. * To set the series boost threshold, set seriesBoostThreshold on the chart
  57. * object.
  58. * To set the series-specific threshold, set boostThreshold on the series
  59. * object.
  60. *
  61. * In addition, the following can be set in the boost object:
  62. * {
  63. * //Wether or not to use alpha blending
  64. * useAlpha: boolean - default: true
  65. * //Set to true to perform translations on the GPU.
  66. * //Much faster, but may cause rendering issues
  67. * //when using values far from 0 due to floating point
  68. * //rounding issues
  69. * useGPUTranslations: boolean - default: false
  70. * //Use pre-allocated buffers, much faster,
  71. * //but may cause rendering issues with some data sets
  72. * usePreallocated: boolean - default: false
  73. * }
  74. */
  75. /* *
  76. * Options for the Boost module. The Boost module allows certain series types
  77. * to be rendered by WebGL instead of the default SVG. This allows hundreds of
  78. * thousands of data points to be rendered in milliseconds. In addition to the
  79. * WebGL rendering it saves time by skipping processing and inspection of the
  80. * data wherever possible. This introduces some limitations to what features are
  81. * available in boost mode. See [the docs](
  82. * https://www.highcharts.com/docs/advanced-chart-features/boost-module) for
  83. * details.
  84. *
  85. * In addition to the global `boost` option, each series has a
  86. * [boostThreshold](#plotOptions.series.boostThreshold) that defines when the
  87. * boost should kick in.
  88. *
  89. * Requires the `modules/boost.js` module.
  90. *
  91. * @sample {highstock} highcharts/boost/line-series-heavy-stock
  92. * Stock chart
  93. * @sample {highstock} highcharts/boost/line-series-heavy-dynamic
  94. * Dynamic stock chart
  95. * @sample highcharts/boost/line
  96. * Line chart
  97. * @sample highcharts/boost/line-series-heavy
  98. * Line chart with hundreds of series
  99. * @sample highcharts/boost/scatter
  100. * Scatter chart
  101. * @sample highcharts/boost/area
  102. * Area chart
  103. * @sample highcharts/boost/arearange
  104. * Area range chart
  105. * @sample highcharts/boost/column
  106. * Column chart
  107. * @sample highcharts/boost/columnrange
  108. * Column range chart
  109. * @sample highcharts/boost/bubble
  110. * Bubble chart
  111. * @sample highcharts/boost/heatmap
  112. * Heat map
  113. * @sample highcharts/boost/treemap
  114. * Tree map
  115. *
  116. * @product highcharts highstock
  117. * @apioption boost
  118. * */
  119. 'use strict';
  120. import '../../Extensions/Boost/Boost.js';