BoostOptions.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /* *
  2. *
  3. * Copyright (c) 2019-2021 Highsoft AS
  4. *
  5. * Boost module: stripped-down renderer for higher performance
  6. *
  7. * License: highcharts.com/license
  8. *
  9. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  10. *
  11. * */
  12. 'use strict';
  13. import '../../Core/Globals.js';
  14. /**
  15. * Options for the Boost module. The Boost module allows certain series types
  16. * to be rendered by WebGL instead of the default SVG. This allows hundreds of
  17. * thousands of data points to be rendered in milliseconds. In addition to the
  18. * WebGL rendering it saves time by skipping processing and inspection of the
  19. * data wherever possible. This introduces some limitations to what features are
  20. * available in boost mode. See [the docs](
  21. * https://www.highcharts.com/docs/advanced-chart-features/boost-module) for
  22. * details.
  23. *
  24. * In addition to the global `boost` option, each series has a
  25. * [boostThreshold](#plotOptions.series.boostThreshold) that defines when the
  26. * boost should kick in.
  27. *
  28. * Requires the `modules/boost.js` module.
  29. *
  30. * @sample {highstock} highcharts/boost/line-series-heavy-stock
  31. * Stock chart
  32. * @sample {highstock} highcharts/boost/line-series-heavy-dynamic
  33. * Dynamic stock chart
  34. * @sample highcharts/boost/line
  35. * Line chart
  36. * @sample highcharts/boost/line-series-heavy
  37. * Line chart with hundreds of series
  38. * @sample highcharts/boost/scatter
  39. * Scatter chart
  40. * @sample highcharts/boost/area
  41. * Area chart
  42. * @sample highcharts/boost/arearange
  43. * Area range chart
  44. * @sample highcharts/boost/column
  45. * Column chart
  46. * @sample highcharts/boost/columnrange
  47. * Column range chart
  48. * @sample highcharts/boost/bubble
  49. * Bubble chart
  50. * @sample highcharts/boost/heatmap
  51. * Heat map
  52. * @sample highcharts/boost/treemap
  53. * Tree map
  54. *
  55. * @product highcharts highstock
  56. * @requires modules/boost
  57. * @apioption boost
  58. */
  59. /**
  60. * Set the series threshold for when the boost should kick in globally.
  61. *
  62. * Setting to e.g. 20 will cause the whole chart to enter boost mode
  63. * if there are 20 or more series active. When the chart is in boost mode,
  64. * every series in it will be rendered to a common canvas. This offers
  65. * a significant speed improvment in charts with a very high
  66. * amount of series.
  67. *
  68. * @type {number|null}
  69. * @default null
  70. * @apioption boost.seriesThreshold
  71. */
  72. /**
  73. * Enable or disable boost on a chart.
  74. *
  75. * @type {boolean}
  76. * @default true
  77. * @apioption boost.enabled
  78. */
  79. /**
  80. * Debugging options for boost.
  81. * Useful for benchmarking, and general timing.
  82. *
  83. * @apioption boost.debug
  84. */
  85. /**
  86. * Time the series rendering.
  87. *
  88. * This outputs the time spent on actual rendering in the console when
  89. * set to true.
  90. *
  91. * @type {boolean}
  92. * @default false
  93. * @apioption boost.debug.timeRendering
  94. */
  95. /**
  96. * Time the series processing.
  97. *
  98. * This outputs the time spent on transforming the series data to
  99. * vertex buffers when set to true.
  100. *
  101. * @type {boolean}
  102. * @default false
  103. * @apioption boost.debug.timeSeriesProcessing
  104. */
  105. /**
  106. * Time the the WebGL setup.
  107. *
  108. * This outputs the time spent on setting up the WebGL context,
  109. * creating shaders, and textures.
  110. *
  111. * @type {boolean}
  112. * @default false
  113. * @apioption boost.debug.timeSetup
  114. */
  115. /**
  116. * Time the building of the k-d tree.
  117. *
  118. * This outputs the time spent building the k-d tree used for
  119. * markers etc.
  120. *
  121. * Note that the k-d tree is built async, and runs post-rendering.
  122. * Following, it does not affect the performance of the rendering itself.
  123. *
  124. * @type {boolean}
  125. * @default false
  126. * @apioption boost.debug.timeKDTree
  127. */
  128. /**
  129. * Show the number of points skipped through culling.
  130. *
  131. * When set to true, the number of points skipped in series processing
  132. * is outputted. Points are skipped if they are closer than 1 pixel from
  133. * each other.
  134. *
  135. * @type {boolean}
  136. * @default false
  137. * @apioption boost.debug.showSkipSummary
  138. */
  139. /**
  140. * Time the WebGL to SVG buffer copy
  141. *
  142. * After rendering, the result is copied to an image which is injected
  143. * into the SVG.
  144. *
  145. * If this property is set to true, the time it takes for the buffer copy
  146. * to complete is outputted.
  147. *
  148. * @type {boolean}
  149. * @default false
  150. * @apioption boost.debug.timeBufferCopy
  151. */
  152. /**
  153. * Enable or disable GPU translations. GPU translations are faster than doing
  154. * the translation in JavaScript.
  155. *
  156. * This option may cause rendering issues with certain datasets.
  157. * Namely, if your dataset has large numbers with small increments (such as
  158. * timestamps), it won't work correctly. This is due to floating point
  159. * precission.
  160. *
  161. * @type {boolean}
  162. * @default false
  163. * @apioption boost.useGPUTranslations
  164. */
  165. /**
  166. * Enable or disable pre-allocation of vertex buffers.
  167. *
  168. * Enabling this will make it so that the binary data arrays required for
  169. * storing the series data will be allocated prior to transforming the data
  170. * to a WebGL-compatible format.
  171. *
  172. * This saves a copy operation on the order of O(n) and so is significantly more
  173. * performant. However, this is currently an experimental option, and may cause
  174. * visual artifacts with some datasets.
  175. *
  176. * As such, care should be taken when using this setting to make sure that
  177. * it doesn't cause any rendering glitches with the given use-case.
  178. *
  179. * @type {boolean}
  180. * @default false
  181. * @apioption boost.usePreallocated
  182. */
  183. /**
  184. * Set the point threshold for when a series should enter boost mode.
  185. *
  186. * Setting it to e.g. 2000 will cause the series to enter boost mode when there
  187. * are 2000 or more points in the series.
  188. *
  189. * To disable boosting on the series, set the `boostThreshold` to 0. Setting it
  190. * to 1 will force boosting.
  191. *
  192. * Note that the [cropThreshold](plotOptions.series.cropThreshold) also affects
  193. * this setting. When zooming in on a series that has fewer points than the
  194. * `cropThreshold`, all points are rendered although outside the visible plot
  195. * area, and the `boostThreshold` won't take effect.
  196. *
  197. * @type {number}
  198. * @default 5000
  199. * @requires modules/boost
  200. * @apioption plotOptions.series.boostThreshold
  201. */
  202. /**
  203. * If set to true, the whole chart will be boosted if one of the series
  204. * crosses its threshold, and all the series can be boosted.
  205. *
  206. * @type {boolean}
  207. * @default true
  208. * @apioption boost.allowForce
  209. */
  210. /**
  211. * Sets the color blending in the boost module.
  212. *
  213. * @type {string}
  214. * @default undefined
  215. * @validvalue ["add", "multiply", "darken"]
  216. * @requires modules/boost
  217. * @apioption plotOptions.series.boostBlending
  218. */
  219. ''; // adds doclets above to transpiled file