BoostOptions.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /* *
  2. *
  3. * Copyright (c) 2019-2020 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. * @requires modules/boost
  16. * @apioption boost
  17. */
  18. /**
  19. * Set the series threshold for when the boost should kick in globally.
  20. *
  21. * Setting to e.g. 20 will cause the whole chart to enter boost mode
  22. * if there are 20 or more series active. When the chart is in boost mode,
  23. * every series in it will be rendered to a common canvas. This offers
  24. * a significant speed improvment in charts with a very high
  25. * amount of series.
  26. *
  27. * @type {number|null}
  28. * @default null
  29. * @apioption boost.seriesThreshold
  30. */
  31. /**
  32. * Enable or disable boost on a chart.
  33. *
  34. * @type {boolean}
  35. * @default true
  36. * @apioption boost.enabled
  37. */
  38. /**
  39. * Debugging options for boost.
  40. * Useful for benchmarking, and general timing.
  41. *
  42. * @apioption boost.debug
  43. */
  44. /**
  45. * Time the series rendering.
  46. *
  47. * This outputs the time spent on actual rendering in the console when
  48. * set to true.
  49. *
  50. * @type {boolean}
  51. * @default false
  52. * @apioption boost.debug.timeRendering
  53. */
  54. /**
  55. * Time the series processing.
  56. *
  57. * This outputs the time spent on transforming the series data to
  58. * vertex buffers when set to true.
  59. *
  60. * @type {boolean}
  61. * @default false
  62. * @apioption boost.debug.timeSeriesProcessing
  63. */
  64. /**
  65. * Time the the WebGL setup.
  66. *
  67. * This outputs the time spent on setting up the WebGL context,
  68. * creating shaders, and textures.
  69. *
  70. * @type {boolean}
  71. * @default false
  72. * @apioption boost.debug.timeSetup
  73. */
  74. /**
  75. * Time the building of the k-d tree.
  76. *
  77. * This outputs the time spent building the k-d tree used for
  78. * markers etc.
  79. *
  80. * Note that the k-d tree is built async, and runs post-rendering.
  81. * Following, it does not affect the performance of the rendering itself.
  82. *
  83. * @type {boolean}
  84. * @default false
  85. * @apioption boost.debug.timeKDTree
  86. */
  87. /**
  88. * Show the number of points skipped through culling.
  89. *
  90. * When set to true, the number of points skipped in series processing
  91. * is outputted. Points are skipped if they are closer than 1 pixel from
  92. * each other.
  93. *
  94. * @type {boolean}
  95. * @default false
  96. * @apioption boost.debug.showSkipSummary
  97. */
  98. /**
  99. * Time the WebGL to SVG buffer copy
  100. *
  101. * After rendering, the result is copied to an image which is injected
  102. * into the SVG.
  103. *
  104. * If this property is set to true, the time it takes for the buffer copy
  105. * to complete is outputted.
  106. *
  107. * @type {boolean}
  108. * @default false
  109. * @apioption boost.debug.timeBufferCopy
  110. */
  111. /**
  112. * Enable or disable GPU translations. GPU translations are faster than doing
  113. * the translation in JavaScript.
  114. *
  115. * This option may cause rendering issues with certain datasets.
  116. * Namely, if your dataset has large numbers with small increments (such as
  117. * timestamps), it won't work correctly. This is due to floating point
  118. * precission.
  119. *
  120. * @type {boolean}
  121. * @default false
  122. * @apioption boost.useGPUTranslations
  123. */
  124. /**
  125. * Enable or disable pre-allocation of vertex buffers.
  126. *
  127. * Enabling this will make it so that the binary data arrays required for
  128. * storing the series data will be allocated prior to transforming the data
  129. * to a WebGL-compatible format.
  130. *
  131. * This saves a copy operation on the order of O(n) and so is significantly more
  132. * performant. However, this is currently an experimental option, and may cause
  133. * visual artifacts with some datasets.
  134. *
  135. * As such, care should be taken when using this setting to make sure that
  136. * it doesn't cause any rendering glitches with the given use-case.
  137. *
  138. * @type {boolean}
  139. * @default false
  140. * @apioption boost.usePreallocated
  141. */
  142. /**
  143. * Set the point threshold for when a series should enter boost mode.
  144. *
  145. * Setting it to e.g. 2000 will cause the series to enter boost mode when there
  146. * are 2000 or more points in the series.
  147. *
  148. * To disable boosting on the series, set the `boostThreshold` to 0. Setting it
  149. * to 1 will force boosting.
  150. *
  151. * Note that the [cropThreshold](plotOptions.series.cropThreshold) also affects
  152. * this setting. When zooming in on a series that has fewer points than the
  153. * `cropThreshold`, all points are rendered although outside the visible plot
  154. * area, and the `boostThreshold` won't take effect.
  155. *
  156. * @type {number}
  157. * @default 5000
  158. * @requires modules/boost
  159. * @apioption plotOptions.series.boostThreshold
  160. */
  161. /**
  162. * If set to true, the whole chart will be boosted if one of the series
  163. * crosses its threshold, and all the series can be boosted.
  164. *
  165. * @type {boolean}
  166. * @default true
  167. * @apioption boost.allowForce
  168. */
  169. /**
  170. * Sets the color blending in the boost module.
  171. *
  172. * @type {string}
  173. * @default undefined
  174. * @validvalue ["add", "multiply", "darken"]
  175. * @requires modules/boost
  176. * @apioption plotOptions.series.boostBlending
  177. */
  178. ''; // adds doclets above to transpiled file