scichart 2.2.2417 → 3.0.0-beta.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/Builder/buildDataSeries.d.ts +16 -1
  2. package/Builder/buildDataSeries.js +24 -1
  3. package/Builder/buildSeries.d.ts +60 -3
  4. package/Builder/buildSeries.js +28 -1
  5. package/Builder/buildSurface.d.ts +28 -2
  6. package/Builder/buildSurface.js +53 -31
  7. package/Builder/chartBuilder.d.ts +20 -7
  8. package/Builder/chartBuilder.js +37 -3
  9. package/Charting/ChartModifiers/ChartModifierBase.d.ts +21 -0
  10. package/Charting/ChartModifiers/ChartModifierBase.js +12 -0
  11. package/Charting/ChartModifiers/ChartModifierBase2D.js +2 -1
  12. package/Charting/ChartModifiers/CursorModifier.d.ts +92 -19
  13. package/Charting/ChartModifiers/CursorModifier.js +147 -58
  14. package/Charting/ChartModifiers/DataPointSelectionModifier.js +2 -1
  15. package/Charting/ChartModifiers/LegendModifier.js +2 -1
  16. package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +6 -1
  17. package/Charting/ChartModifiers/ModifierMouseArgs.js +13 -3
  18. package/Charting/ChartModifiers/MouseWheelZoomModifier.d.ts +2 -2
  19. package/Charting/ChartModifiers/MouseWheelZoomModifier.js +16 -4
  20. package/Charting/ChartModifiers/OverviewRangeSelectionModifier.d.ts +2 -1
  21. package/Charting/ChartModifiers/OverviewRangeSelectionModifier.js +8 -4
  22. package/Charting/ChartModifiers/PinchZoomModifier.js +2 -1
  23. package/Charting/ChartModifiers/RolloverModifier.d.ts +43 -21
  24. package/Charting/ChartModifiers/RolloverModifier.js +48 -29
  25. package/Charting/ChartModifiers/RubberBandXyZoomModifier.d.ts +9 -6
  26. package/Charting/ChartModifiers/RubberBandXyZoomModifier.js +10 -8
  27. package/Charting/ChartModifiers/SeriesSelectionModifier.js +2 -1
  28. package/Charting/ChartModifiers/XAxisDragModifier.d.ts +1 -1
  29. package/Charting/ChartModifiers/XAxisDragModifier.js +2 -1
  30. package/Charting/ChartModifiers/YAxisDragModifier.d.ts +1 -1
  31. package/Charting/ChartModifiers/YAxisDragModifier.js +2 -1
  32. package/Charting/ChartModifiers/ZoomExtentsModifier.js +2 -1
  33. package/Charting/ChartModifiers/ZoomPanModifier.js +2 -1
  34. package/Charting/ChartModifiers/constants.d.ts +3 -1
  35. package/Charting/ChartModifiers/constants.js +2 -0
  36. package/Charting/Drawing/BatchRenderContext.d.ts +6 -0
  37. package/Charting/Drawing/BatchRenderContext.js +40 -0
  38. package/Charting/Drawing/RenderSurface.d.ts +2 -1
  39. package/Charting/Drawing/RenderSurface.js +3 -2
  40. package/Charting/Drawing/WebGlRenderContext2D.d.ts +19 -4
  41. package/Charting/Drawing/WebGlRenderContext2D.js +70 -41
  42. package/Charting/LayoutManager/BaseCenteredAxisLayoutStrategy.js +2 -1
  43. package/Charting/LayoutManager/BottomAlignedInnerAxisLayoutStrategy.js +1 -1
  44. package/Charting/LayoutManager/CentralAxesLayoutManager.js +2 -1
  45. package/Charting/LayoutManager/LayoutManager.d.ts +2 -1
  46. package/Charting/LayoutManager/LayoutManager.js +6 -5
  47. package/Charting/LayoutManager/LeftAlignedInnerAxisLayoutStrategy.js +1 -1
  48. package/Charting/LayoutManager/RightAlignedInnerAxisLayoutStrategy.js +1 -1
  49. package/Charting/LayoutManager/TopAlignedInnerAxisLayoutStrategy.js +1 -1
  50. package/Charting/Model/BaseDataSeries.d.ts +10 -1
  51. package/Charting/Model/BaseDataSeries.js +9 -8
  52. package/Charting/Model/BaseHeatmapDataSeries.d.ts +18 -5
  53. package/Charting/Model/BaseHeatmapDataSeries.js +21 -13
  54. package/Charting/Model/ChartData/SeriesInfo.d.ts +6 -0
  55. package/Charting/Model/ChartData/SeriesInfo.js +5 -0
  56. package/Charting/Model/ChartData/XyySeriesInfo.d.ts +2 -0
  57. package/Charting/Model/ChartData/XyySeriesInfo.js +2 -0
  58. package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +4 -3
  59. package/Charting/Model/Filters/HlcCustomFilter.js +12 -9
  60. package/Charting/Model/Filters/HlcFilterBase.js +2 -1
  61. package/Charting/Model/Filters/HlcScaleOffsetFilter.js +2 -1
  62. package/Charting/Model/Filters/OhlcCustomFilter.js +12 -9
  63. package/Charting/Model/Filters/OhlcScaleOffsetFilter.js +2 -1
  64. package/Charting/Model/Filters/XyCustomFilter.js +12 -9
  65. package/Charting/Model/Filters/XyFilterBase.d.ts +14 -5
  66. package/Charting/Model/Filters/XyFilterBase.js +47 -15
  67. package/Charting/Model/Filters/XyMovingAverageFilter.js +2 -1
  68. package/Charting/Model/Filters/XyRatioFilter.js +2 -1
  69. package/Charting/Model/Filters/XyScaleOffsetFilter.js +2 -1
  70. package/Charting/Model/Filters/XyyCustomFilter.js +12 -9
  71. package/Charting/Model/Filters/XyyFilterBase.js +2 -1
  72. package/Charting/Model/Filters/XyyScaleOffsetFilter.js +2 -1
  73. package/Charting/Model/Filters/XyzCustomFilter.js +12 -9
  74. package/Charting/Model/Filters/XyzFilterBase.js +2 -1
  75. package/Charting/Model/Filters/XyzScaleOffsetFilter.js +2 -1
  76. package/Charting/Model/IDataSeries.d.ts +9 -1
  77. package/Charting/Model/IDataSeries.js +8 -0
  78. package/Charting/Model/NonUniformHeatmapDataSeries.d.ts +112 -0
  79. package/Charting/Model/NonUniformHeatmapDataSeries.js +261 -0
  80. package/Charting/Model/PaletteFactory.d.ts +40 -4
  81. package/Charting/Model/PaletteFactory.js +37 -11
  82. package/Charting/Model/XyTextDataSeries.d.ts +121 -0
  83. package/Charting/Model/XyTextDataSeries.js +274 -0
  84. package/Charting/Numerics/CoordinateCalculators/CoordinateCalculatorBase.d.ts +1 -1
  85. package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +1 -1
  86. package/Charting/Services/RenderPassData.d.ts +15 -5
  87. package/Charting/Services/RenderPassData.js +27 -5
  88. package/Charting/Services/SciChartRenderer.d.ts +2 -1
  89. package/Charting/Services/SciChartRenderer.js +91 -29
  90. package/Charting/Themes/IThemeProvider.d.ts +61 -0
  91. package/Charting/Themes/IThemeProvider.js +67 -1
  92. package/Charting/Themes/SciChartJSDarkTheme.d.ts +4 -0
  93. package/Charting/Themes/SciChartJSDarkTheme.js +6 -2
  94. package/Charting/Themes/SciChartJSDarkv2Theme.js +3 -0
  95. package/Charting/Themes/SciChartJSLightTheme.d.ts +8 -0
  96. package/Charting/Themes/SciChartJSLightTheme.js +8 -0
  97. package/Charting/Themes/SciChartJsNavyTheme.d.ts +10 -0
  98. package/Charting/Themes/SciChartJsNavyTheme.js +49 -0
  99. package/Charting/Visuals/Annotations/AdornerLayer.js +4 -8
  100. package/Charting/Visuals/Annotations/AnnotationBase.d.ts +80 -7
  101. package/Charting/Visuals/Annotations/AnnotationBase.js +238 -28
  102. package/Charting/Visuals/Annotations/AnnotationClickEventArgs.d.ts +11 -0
  103. package/Charting/Visuals/Annotations/AnnotationClickEventArgs.js +12 -0
  104. package/Charting/Visuals/Annotations/AxisMarkerAnnotation.d.ts +1 -0
  105. package/Charting/Visuals/Annotations/AxisMarkerAnnotation.js +18 -19
  106. package/Charting/Visuals/Annotations/BoxAnnotation.d.ts +1 -0
  107. package/Charting/Visuals/Annotations/BoxAnnotation.js +69 -67
  108. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +2 -2
  109. package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +20 -20
  110. package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +1 -1
  111. package/Charting/Visuals/Annotations/CustomAnnotation.js +3 -2
  112. package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +6 -3
  113. package/Charting/Visuals/Annotations/IAdornerProvider.d.ts +12 -0
  114. package/Charting/Visuals/Annotations/IAnnotation.d.ts +9 -0
  115. package/Charting/Visuals/Annotations/IAnnotation.js +9 -0
  116. package/Charting/Visuals/Annotations/LineAnnotation.d.ts +1 -0
  117. package/Charting/Visuals/Annotations/LineAnnotation.js +29 -35
  118. package/Charting/Visuals/Annotations/NativeTextAnnotation.d.ts +193 -0
  119. package/Charting/Visuals/Annotations/NativeTextAnnotation.js +536 -0
  120. package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.d.ts +4 -2
  121. package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.js +19 -14
  122. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +2 -2
  123. package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +9 -8
  124. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +2 -2
  125. package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +6 -6
  126. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +2 -2
  127. package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +20 -21
  128. package/Charting/Visuals/Annotations/SvgAnnotationBase.d.ts +13 -2
  129. package/Charting/Visuals/Annotations/SvgAnnotationBase.js +34 -42
  130. package/Charting/Visuals/Annotations/TextAnnotation.d.ts +2 -2
  131. package/Charting/Visuals/Annotations/TextAnnotation.js +41 -22
  132. package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +6 -3
  133. package/Charting/Visuals/Annotations/annotationHelpers.d.ts +6 -6
  134. package/Charting/Visuals/Annotations/annotationHelpers.js +7 -6
  135. package/Charting/Visuals/Annotations/constants.d.ts +13 -1
  136. package/Charting/Visuals/Annotations/constants.js +12 -0
  137. package/Charting/Visuals/Axis/AxisBase2D.d.ts +24 -4
  138. package/Charting/Visuals/Axis/AxisBase2D.js +115 -38
  139. package/Charting/Visuals/Axis/AxisCore.d.ts +10 -5
  140. package/Charting/Visuals/Axis/AxisCore.js +11 -10
  141. package/Charting/Visuals/Axis/AxisRenderer.js +114 -20
  142. package/Charting/Visuals/Axis/CategoryAxis.js +2 -1
  143. package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +15 -15
  144. package/Charting/Visuals/Axis/CategoryAxisBase.js +14 -12
  145. package/Charting/Visuals/Axis/DateTimeNumericAxis.js +2 -1
  146. package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +2 -1
  147. package/Charting/Visuals/Axis/LabelProvider/DateLabelProvider.js +2 -1
  148. package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -0
  149. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.d.ts +14 -0
  150. package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +140 -33
  151. package/Charting/Visuals/Axis/LabelProvider/LogarithmicLabelProvider.js +2 -1
  152. package/Charting/Visuals/Axis/LabelProvider/NumericLabelProvider.js +2 -1
  153. package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +2 -1
  154. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +31 -1
  155. package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +64 -42
  156. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.d.ts +2 -2
  157. package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.js +16 -19
  158. package/Charting/Visuals/Axis/LogarithmicAxis.js +9 -6
  159. package/Charting/Visuals/Axis/NumericAxis.js +3 -3
  160. package/Charting/Visuals/Axis/constants.d.ts +1 -0
  161. package/Charting/Visuals/Axis/constants.js +1 -0
  162. package/Charting/Visuals/HeatmapLegend.d.ts +95 -0
  163. package/Charting/Visuals/HeatmapLegend.js +192 -0
  164. package/Charting/Visuals/Helpers/NativeObject.d.ts +15 -2
  165. package/Charting/Visuals/Helpers/NativeObject.js +72 -6
  166. package/Charting/Visuals/I2DSurfaceOptions.d.ts +46 -0
  167. package/Charting/Visuals/PointMarkers/BasePointMarker.d.ts +5 -0
  168. package/Charting/Visuals/PointMarkers/BasePointMarker.js +28 -0
  169. package/Charting/Visuals/PointMarkers/IPointMarker.d.ts +8 -0
  170. package/Charting/Visuals/RenderableSeries/Animations/BandAnimation.js +2 -1
  171. package/Charting/Visuals/RenderableSeries/Animations/BandAnimationStyle.js +2 -1
  172. package/Charting/Visuals/RenderableSeries/Animations/BubbleAnimation.js +2 -1
  173. package/Charting/Visuals/RenderableSeries/Animations/CandlestickAnimation.js +2 -1
  174. package/Charting/Visuals/RenderableSeries/Animations/CandlestickAnimationStyle.js +2 -1
  175. package/Charting/Visuals/RenderableSeries/Animations/ColumnAnimation.js +2 -1
  176. package/Charting/Visuals/RenderableSeries/Animations/ColumnAnimationStyle.js +2 -1
  177. package/Charting/Visuals/RenderableSeries/Animations/CustomPointMarkerStyle.js +2 -1
  178. package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.js +2 -1
  179. package/Charting/Visuals/RenderableSeries/Animations/LineAnimation.js +2 -1
  180. package/Charting/Visuals/RenderableSeries/Animations/MountainAnimation.js +2 -1
  181. package/Charting/Visuals/RenderableSeries/Animations/MountainAnimationStyle.js +2 -1
  182. package/Charting/Visuals/RenderableSeries/Animations/OhlcAnimation.js +2 -1
  183. package/Charting/Visuals/RenderableSeries/Animations/OhlcAnimationStyle.js +2 -1
  184. package/Charting/Visuals/RenderableSeries/Animations/PointMarkerStyle.js +2 -1
  185. package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.js +2 -1
  186. package/Charting/Visuals/RenderableSeries/Animations/ScatterAnimation.js +2 -1
  187. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +8 -2
  188. package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.js +3 -3
  189. package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.js +2 -1
  190. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +7 -0
  191. package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +42 -10
  192. package/Charting/Visuals/RenderableSeries/BaseHeatmapRenderableSeries.d.ts +128 -0
  193. package/Charting/Visuals/RenderableSeries/BaseHeatmapRenderableSeries.js +201 -0
  194. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +26 -0
  195. package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +39 -3
  196. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +7 -0
  197. package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +17 -2
  198. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +2 -0
  199. package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +15 -2
  200. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +10 -0
  201. package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +93 -17
  202. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +8 -1
  203. package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +21 -1
  204. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +1 -0
  205. package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +4 -0
  206. package/Charting/Visuals/RenderableSeries/DataLabels/BandSeriesDataLabelProvider.d.ts +43 -0
  207. package/Charting/Visuals/RenderableSeries/DataLabels/BandSeriesDataLabelProvider.js +142 -0
  208. package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.d.ts +92 -0
  209. package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.js +129 -0
  210. package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.d.ts +17 -0
  211. package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.js +62 -0
  212. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.d.ts +47 -0
  213. package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.js +125 -0
  214. package/Charting/Visuals/RenderableSeries/DataLabels/ContoursDataLabelProvider.d.ts +71 -0
  215. package/Charting/Visuals/RenderableSeries/DataLabels/ContoursDataLabelProvider.js +221 -0
  216. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelLayoutManager.d.ts +5 -0
  217. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelLayoutManager.js +2 -0
  218. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.d.ts +208 -0
  219. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +410 -0
  220. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.d.ts +40 -0
  221. package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.js +141 -0
  222. package/Charting/Visuals/RenderableSeries/DataLabels/HeatMapDataLabelProvider.d.ts +63 -0
  223. package/Charting/Visuals/RenderableSeries/DataLabels/HeatMapDataLabelProvider.js +198 -0
  224. package/Charting/Visuals/RenderableSeries/DataLabels/LineSeriesDataLabelProvider.d.ts +35 -0
  225. package/Charting/Visuals/RenderableSeries/DataLabels/LineSeriesDataLabelProvider.js +92 -0
  226. package/Charting/Visuals/RenderableSeries/DataLabels/NonUniformHeatmapDataLabelProvider.d.ts +12 -0
  227. package/Charting/Visuals/RenderableSeries/DataLabels/NonUniformHeatmapDataLabelProvider.js +134 -0
  228. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.d.ts +56 -0
  229. package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.js +167 -0
  230. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +0 -1
  231. package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +1 -2
  232. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +5 -2
  233. package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +47 -40
  234. package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +1 -1
  235. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
  236. package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +18 -5
  237. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +0 -1
  238. package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +14 -27
  239. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +17 -4
  240. package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +34 -11
  241. package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.d.ts +36 -0
  242. package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.js +493 -0
  243. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +5 -2
  244. package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +8 -5
  245. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +4 -4
  246. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.d.ts +3 -0
  247. package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +15 -4
  248. package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.js +2 -1
  249. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +21 -0
  250. package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +40 -4
  251. package/Charting/Visuals/RenderableSeries/FastCandlestickRenderableSeries.d.ts +2 -0
  252. package/Charting/Visuals/RenderableSeries/FastCandlestickRenderableSeries.js +18 -3
  253. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +36 -2
  254. package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +77 -8
  255. package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +2 -1
  256. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.d.ts +7 -0
  257. package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +16 -4
  258. package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +2 -1
  259. package/Charting/Visuals/RenderableSeries/FastMountainRenderableSeries.js +2 -1
  260. package/Charting/Visuals/RenderableSeries/FastOhlcRenderableSeries.js +2 -1
  261. package/Charting/Visuals/RenderableSeries/FastTextRenderableSeries.d.ts +17 -0
  262. package/Charting/Visuals/RenderableSeries/FastTextRenderableSeries.js +45 -0
  263. package/Charting/Visuals/RenderableSeries/HeatmapColorMap.js +3 -2
  264. package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +35 -5
  265. package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +17 -1
  266. package/Charting/Visuals/RenderableSeries/HitTest/HitTestInfo.d.ts +8 -0
  267. package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +7 -1
  268. package/Charting/Visuals/RenderableSeries/HitTest/NonUniformHeatmapHitTestProvider.d.ts +20 -0
  269. package/Charting/Visuals/RenderableSeries/HitTest/NonUniformHeatmapHitTestProvider.js +86 -0
  270. package/Charting/Visuals/RenderableSeries/HitTest/TextSeriesHitTestProvider.d.ts +6 -0
  271. package/Charting/Visuals/RenderableSeries/HitTest/TextSeriesHitTestProvider.js +56 -0
  272. package/Charting/Visuals/RenderableSeries/HitTest/UniformHeatmapHitTestProvider.js +1 -1
  273. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +7 -1
  274. package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +34 -2
  275. package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +6 -1
  276. package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +12 -0
  277. package/Charting/Visuals/RenderableSeries/NonUniformHeatmapRenderableSeries.d.ts +74 -0
  278. package/Charting/Visuals/RenderableSeries/NonUniformHeatmapRenderableSeries.js +99 -0
  279. package/Charting/Visuals/RenderableSeries/RolloverModifier/RolloverModifierRenderableSeriesProps.d.ts +7 -2
  280. package/Charting/Visuals/RenderableSeries/ShaderEffect.js +2 -2
  281. package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +2 -1
  282. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +2 -3
  283. package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +2 -1
  284. package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +2 -1
  285. package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +2 -1
  286. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +3 -0
  287. package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +13 -2
  288. package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +4 -1
  289. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +7 -0
  290. package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +33 -9
  291. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
  292. package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +7 -1
  293. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +2 -75
  294. package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +8 -130
  295. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
  296. package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +7 -1
  297. package/Charting/Visuals/RenderableSeries/constants.d.ts +5 -1
  298. package/Charting/Visuals/RenderableSeries/constants.js +4 -0
  299. package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.js +3 -3
  300. package/Charting/Visuals/SciChartDefaults.d.ts +4 -0
  301. package/Charting/Visuals/SciChartDefaults.js +4 -0
  302. package/Charting/Visuals/SciChartOverview.js +5 -3
  303. package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +4 -0
  304. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +13 -0
  305. package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +22 -4
  306. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +2 -1
  307. package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +1 -0
  308. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +5 -0
  309. package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +17 -19
  310. package/Charting/Visuals/SciChartSurface.d.ts +238 -7
  311. package/Charting/Visuals/SciChartSurface.js +800 -28
  312. package/Charting/Visuals/SciChartSurfaceBase.d.ts +16 -1
  313. package/Charting/Visuals/SciChartSurfaceBase.js +34 -2
  314. package/Charting/Visuals/TextureManager/CanvasTexture.js +1 -1
  315. package/Charting/Visuals/TextureManager/DpiHelper.js +3 -7
  316. package/Charting/Visuals/TextureManager/TextureManager.d.ts +11 -0
  317. package/Charting/Visuals/TextureManager/TextureManager.js +37 -1
  318. package/Charting/Visuals/createMaster.js +7 -10
  319. package/Charting/Visuals/createSingle.js +2 -0
  320. package/Charting/Visuals/licenseManager2D.js +9 -9
  321. package/Charting/Visuals/sciChartInitCommon.js +16 -12
  322. package/Charting3D/CameraController.d.ts +5 -0
  323. package/Charting3D/CameraController.js +6 -0
  324. package/Charting3D/ChartModifiers/ResetCamera3DModifier.js +2 -1
  325. package/Charting3D/Visuals/Axis/AxisBase3D.js +7 -5
  326. package/Charting3D/Visuals/Axis/NumericAxis3D.js +2 -1
  327. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.d.ts +4 -0
  328. package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +7 -0
  329. package/Charting3D/Visuals/Primitives/SurfaceMeshSceneEntity.js +6 -4
  330. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.d.ts +7 -2
  331. package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.js +3 -2
  332. package/Charting3D/Visuals/RenderableSeries/SurfaceMesh/SurfaceMeshRenderableSeries3D.d.ts +0 -5
  333. package/Charting3D/Visuals/RenderableSeries/SurfaceMesh/SurfaceMeshRenderableSeries3D.js +12 -11
  334. package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
  335. package/Charting3D/Visuals/SciChart3DSurface.js +18 -11
  336. package/Charting3D/Visuals/createMaster3d.js +10 -18
  337. package/Charting3D/Visuals/createSingle3d.js +12 -10
  338. package/Core/Animations/GenericAnimation.d.ts +2 -0
  339. package/Core/Animations/GenericAnimation.js +3 -0
  340. package/Core/Animations/NumberRangeAnimator.js +7 -2
  341. package/Core/BuildStamp.d.ts +1 -1
  342. package/Core/BuildStamp.js +2 -2
  343. package/Core/Mouse/MouseManager.d.ts +20 -0
  344. package/Core/Mouse/MouseManager.js +201 -30
  345. package/Core/Telemetry.js +1 -1
  346. package/README.md +91 -403
  347. package/_wasm/scichart.browser.js +1 -1
  348. package/_wasm/scichart2d.data +0 -0
  349. package/_wasm/scichart2d.js +280 -267
  350. package/_wasm/scichart2d.wasm +0 -0
  351. package/_wasm/scichart3d.data +0 -0
  352. package/_wasm/scichart3d.js +280 -268
  353. package/_wasm/scichart3d.wasm +0 -0
  354. package/constants/performanceWarnings.d.ts +2 -0
  355. package/constants/performanceWarnings.js +3 -1
  356. package/package.json +2 -2
  357. package/types/AutoColorMode.d.ts +9 -0
  358. package/types/AutoColorMode.js +13 -0
  359. package/types/BaseType.d.ts +3 -1
  360. package/types/BaseType.js +2 -0
  361. package/types/DataLabelProviderType.d.ts +15 -0
  362. package/types/DataLabelProviderType.js +19 -0
  363. package/types/DataLabelSkipMode.d.ts +21 -0
  364. package/types/DataLabelSkipMode.js +25 -0
  365. package/types/DefaultRenderLayer.d.ts +10 -0
  366. package/types/DefaultRenderLayer.js +14 -0
  367. package/types/MousePosition.d.ts +1 -1
  368. package/types/MousePosition.js +1 -1
  369. package/types/SeriesType.d.ts +7 -1
  370. package/types/SeriesType.js +6 -0
  371. package/types/SvgClippingMode.d.ts +17 -0
  372. package/types/SvgClippingMode.js +21 -0
  373. package/types/TDataLabelStyle.d.ts +16 -0
  374. package/types/TDataLabelStyle.js +2 -0
  375. package/types/TSciChart.d.ts +214 -118
  376. package/types/TSciChart3D.d.ts +104 -70
  377. package/types/TextPosition.d.ts +17 -0
  378. package/types/TextPosition.js +39 -0
  379. package/types/ThemeProviderType.d.ts +3 -1
  380. package/types/ThemeProviderType.js +2 -0
  381. package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +10 -1
  382. package/utils/ccall/appendDoubleVectorFromJsArray.js +24 -1
  383. package/utils/memoize.d.ts +1 -0
  384. package/utils/memoize.js +26 -0
  385. package/utils/number.d.ts +1 -0
  386. package/utils/number.js +5 -1
  387. package/utils/parseColor.d.ts +2 -0
  388. package/utils/parseColor.js +3 -3
  389. package/utils/text.d.ts +5 -0
  390. package/utils/text.js +48 -0
  391. package/utils/translate.d.ts +12 -2
  392. package/utils/translate.js +67 -11
  393. package/utils/zeroArray2D.d.ts +5 -0
  394. package/utils/zeroArray2D.js +5 -0
@@ -66,6 +66,7 @@ exports.LabelProviderBase2D = exports.LabelInfo = void 0;
66
66
  var app_1 = require("../../../../constants/app");
67
67
  var guid_1 = require("../../../../utils/guid");
68
68
  var TextureWorker_1 = require("../../../Services/Workers/TextureWorker");
69
+ var NativeObject_1 = require("../../Helpers/NativeObject");
69
70
  var SciChartDefaults_1 = require("../../SciChartDefaults");
70
71
  var TextureManager_1 = require("../../TextureManager/TextureManager");
71
72
  var LabelCache_1 = require("./LabelCache");
@@ -97,15 +98,23 @@ exports.LabelInfo = LabelInfo;
97
98
  var LabelProviderBase2D = /** @class */ (function (_super) {
98
99
  __extends(LabelProviderBase2D, _super);
99
100
  function LabelProviderBase2D(options) {
100
- var _a, _b, _c;
101
- var _this = _super.call(this, options) || this;
101
+ var _this = this;
102
+ var _a, _b, _c, _d;
103
+ _this = _super.call(this, options) || this;
102
104
  _this.useCache = !app_1.IS_TEST_ENV;
105
+ /**
106
+ * Experimental - set true to use native text for axes. Not all text features currently supported
107
+ */
108
+ _this.useNativeText = false;
103
109
  _this.tickToText = new Map();
110
+ /** Set this true if the format function could return different results for the same input (eg SmartDateLabelprovider) */
111
+ _this.textVariesForSameTick = false;
104
112
  _this.rotationProperty = 0;
105
113
  _this.providerId = (0, guid_1.generateGuid)();
106
114
  _this.rotationProperty = (_a = options === null || options === void 0 ? void 0 : options.rotation) !== null && _a !== void 0 ? _a : _this.rotationProperty;
107
115
  _this.asyncLabels = (_b = options === null || options === void 0 ? void 0 : options.asyncLabels) !== null && _b !== void 0 ? _b : SciChartDefaults_1.SciChartDefaults.asyncLabels;
108
116
  _this.useSharedCache = (_c = options === null || options === void 0 ? void 0 : options.useSharedCache) !== null && _c !== void 0 ? _c : SciChartDefaults_1.SciChartDefaults.useSharedCache;
117
+ _this.useNativeText = (_d = options === null || options === void 0 ? void 0 : options.useNativeText) !== null && _d !== void 0 ? _d : SciChartDefaults_1.SciChartDefaults.useNativeText;
109
118
  return _this;
110
119
  }
111
120
  Object.defineProperty(LabelProviderBase2D.prototype, "rotation", {
@@ -128,45 +137,93 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
128
137
  LabelProviderBase2D.prototype.getLabels = function (majorTicks) {
129
138
  var _this = this;
130
139
  var axis = this.parentAxis;
131
- if (!this.styleId) {
132
- this.styleId = LabelCache_1.labelCache.getStyleId(this.getCachedStyle());
133
- }
134
- else if (!LabelCache_1.labelCache.checkStyle(this.styleId, this.getCachedStyle())) {
135
- this.delete();
136
- this.styleId = LabelCache_1.labelCache.getStyleId(this.getCachedStyle());
140
+ if (this.useCache) {
141
+ if (!this.styleId) {
142
+ this.styleId = LabelCache_1.labelCache.getStyleId(this.getCachedStyle());
143
+ }
144
+ else if (!LabelCache_1.labelCache.checkStyle(this.styleId, this.getCachedStyle())) {
145
+ this.delete();
146
+ this.styleId = LabelCache_1.labelCache.getStyleId(this.getCachedStyle());
147
+ }
137
148
  }
138
149
  var ticks = majorTicks;
139
150
  if (this.parentAxis.isCategoryAxis) {
140
- var categoryCoordCalc_1 = this.parentAxis.getCurrentCoordinateCalculator(true);
151
+ var categoryCoordCalc_1 = this.parentAxis.getCurrentCoordinateCalculator();
141
152
  ticks = majorTicks.map(function (tick) { return categoryCoordCalc_1.transformIndexToData(tick); });
142
153
  }
143
154
  var labels = [];
144
155
  if (this.useCache) {
145
- for (var _i = 0, ticks_1 = ticks; _i < ticks_1.length; _i++) {
146
- var tick = ticks_1[_i];
147
- var cachedLabelText = this.tickToText.get(tick);
148
- var cachedLabel = void 0;
149
- if (cachedLabelText) {
150
- cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
151
- if (cachedLabel) {
152
- labels.push(cachedLabelText);
156
+ if (!this.useNativeText) {
157
+ for (var _i = 0, ticks_1 = ticks; _i < ticks_1.length; _i++) {
158
+ var tick = ticks_1[_i];
159
+ var cachedLabel = void 0;
160
+ var text = void 0;
161
+ var cachedLabelText = this.tickToText.get(tick);
162
+ if (this.textVariesForSameTick) {
163
+ text = this.formatLabel(tick);
164
+ if (cachedLabelText && cachedLabelText === text) {
165
+ cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
166
+ if (cachedLabel) {
167
+ labels.push(cachedLabelText);
168
+ }
169
+ }
170
+ else {
171
+ this.tickToText.set(tick, text);
172
+ }
173
+ }
174
+ else {
175
+ if (cachedLabelText) {
176
+ cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
177
+ if (cachedLabel) {
178
+ labels.push(cachedLabelText);
179
+ }
180
+ }
181
+ else {
182
+ text = this.formatLabel(tick);
183
+ this.tickToText.set(tick, text);
184
+ }
185
+ }
186
+ if (!cachedLabel) {
187
+ var texture = this.getCachedLabelTexture(text, axis.axisRenderer.textureManager, axis.dpiAdjustedLabelStyle);
188
+ if (texture.textureWidth !== null) {
189
+ cachedLabel = new LabelInfo(tick, text, texture.bitmapTexture, texture.textureHeight, texture.textureWidth);
190
+ LabelCache_1.labelCache.setLabel(text, this.styleId, cachedLabel);
191
+ }
192
+ labels.push(text);
153
193
  }
154
194
  }
155
- if (!cachedLabel) {
156
- var text = cachedLabelText;
157
- if (!cachedLabelText) {
158
- text = this.formatLabel(tick);
159
- this.tickToText.set(tick, text);
195
+ LabelCache_1.labelCache.pruneCache();
196
+ }
197
+ else {
198
+ var sizesToGet = [];
199
+ for (var _a = 0, ticks_2 = ticks; _a < ticks_2.length; _a++) {
200
+ var tick = ticks_2[_a];
201
+ var cachedLabelText = this.tickToText.get(tick);
202
+ if (this.textVariesForSameTick) {
203
+ var text = this.formatLabel(tick);
204
+ if (cachedLabelText && cachedLabelText === text) {
205
+ labels.push(cachedLabelText);
206
+ }
207
+ else {
208
+ this.tickToText.set(tick, text);
209
+ sizesToGet.push(text);
210
+ labels.push(text);
211
+ }
160
212
  }
161
- var texture = this.getCachedLabelTexture(text, axis.axisRenderer.textureManager, axis.dpiAdjustedLabelStyle);
162
- if (texture.textureWidth !== null) {
163
- cachedLabel = new LabelInfo(tick, text, texture.bitmapTexture, texture.textureHeight, texture.textureWidth);
164
- LabelCache_1.labelCache.setLabel(text, this.styleId, cachedLabel);
213
+ else {
214
+ if (cachedLabelText) {
215
+ labels.push(cachedLabelText);
216
+ }
217
+ else {
218
+ var text = this.formatLabel(tick);
219
+ this.tickToText.set(tick, text);
220
+ sizesToGet.push(text);
221
+ labels.push(text);
222
+ }
165
223
  }
166
- labels.push(text);
167
224
  }
225
+ this.getLabelSizesNative(sizesToGet, axis.dpiAdjustedLabelStyle);
168
226
  }
169
- LabelCache_1.labelCache.pruneCache();
170
227
  }
171
228
  else {
172
229
  labels = ticks.map(function (t) { return _this.formatLabel(t); });
@@ -182,7 +239,7 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
182
239
  */
183
240
  LabelProviderBase2D.prototype.getLabelHeight = function (ctx, labelText, labelStyle) {
184
241
  if (this.rotationProperty % 90 === 0 || this.parentAxis.isHorizontalAxis) {
185
- var cachedLabel = LabelCache_1.labelCache.getLabel(labelText, this.styleId);
242
+ var cachedLabel = this.useCache ? LabelCache_1.labelCache.getLabel(labelText, this.styleId) : undefined;
186
243
  if (!cachedLabel || !cachedLabel.textureHeight) {
187
244
  var fontSize = labelStyle.fontSize, padding = labelStyle.padding;
188
245
  return (0, TextureManager_1.measureTextHeight)(fontSize) + (padding === null || padding === void 0 ? void 0 : padding.top) + (padding === null || padding === void 0 ? void 0 : padding.bottom);
@@ -202,7 +259,7 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
202
259
  */
203
260
  LabelProviderBase2D.prototype.getLabelWidth = function (ctx, labelText, labelStyle) {
204
261
  if (this.rotationProperty % 90 === 0 || !this.parentAxis.isHorizontalAxis) {
205
- var cachedlabel = LabelCache_1.labelCache.getLabel(labelText, this.styleId);
262
+ var cachedlabel = this.useCache ? LabelCache_1.labelCache.getLabel(labelText, this.styleId) : undefined;
206
263
  if (!cachedlabel || !cachedlabel.textureWidth) {
207
264
  var padding = labelStyle.padding;
208
265
  return (0, TextureManager_1.measureTextWidth)(ctx, labelText) + padding.left + padding.right;
@@ -324,6 +381,9 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
324
381
  LabelProviderBase2D.prototype.getLabelTexture = function (labelText, textureManager, labelStyle) {
325
382
  return textureManager.createTextTexture([labelText], labelStyle, this.rotationProperty);
326
383
  };
384
+ LabelProviderBase2D.prototype.getNativeLabelInfo = function (labelText) {
385
+ return LabelCache_1.labelCache.getLabel(labelText, this.styleId);
386
+ };
327
387
  LabelProviderBase2D.prototype.delete = function () {
328
388
  if (this.styleId) {
329
389
  LabelCache_1.labelCache.freeStyle(this.styleId);
@@ -336,11 +396,58 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
336
396
  var options = {
337
397
  rotation: this.rotation,
338
398
  asyncLabels: this.asyncLabels,
339
- useSharedCache: this.useSharedCache
399
+ useSharedCache: this.useSharedCache,
400
+ useNativeText: this.useNativeText
340
401
  };
341
402
  Object.assign(json.options, options);
342
403
  return json;
343
404
  };
405
+ LabelProviderBase2D.prototype.getLabelSizesNative = function (labels, textStyle) {
406
+ var _this = this;
407
+ if (!labels || labels.length === 0 || app_1.IS_TEST_ENV)
408
+ return;
409
+ var allLabels = "";
410
+ var simpleLabels = [];
411
+ var wasmContext = this.parentAxis.parentSurface.webAssemblyContext2D;
412
+ var textBounds = (0, NativeObject_1.getTextBounds)(wasmContext);
413
+ var nativeContext = wasmContext.SCRTGetMainRenderContext2D();
414
+ var fontKey = (0, NativeObject_1.getFontKey)(wasmContext, this.getCachedStyle(), false);
415
+ var nativeFont = nativeContext.AquireFont(fontKey);
416
+ var rotationRad = this.rotation * (Math.PI / 180);
417
+ var sin = Math.abs(Math.sin(rotationRad));
418
+ var cos = Math.abs(Math.cos(rotationRad));
419
+ var makeCacheEntry = function (width, height, label) {
420
+ var _a, _b;
421
+ var w = width;
422
+ var h = height;
423
+ if (_this.rotation !== 0) {
424
+ h = width * sin + height * cos;
425
+ w = width * cos + height * sin;
426
+ }
427
+ var cachedLabel = new LabelInfo(undefined, label, undefined, h + ((_a = textStyle.padding) === null || _a === void 0 ? void 0 : _a.top) + (textStyle === null || textStyle === void 0 ? void 0 : textStyle.padding.bottom), w + ((_b = textStyle.padding) === null || _b === void 0 ? void 0 : _b.left) + (textStyle === null || textStyle === void 0 ? void 0 : textStyle.padding.right));
428
+ cachedLabel.textWidth = width;
429
+ cachedLabel.textHeight = height;
430
+ LabelCache_1.labelCache.setLabel(label, _this.styleId, cachedLabel);
431
+ };
432
+ labels.forEach(function (labelText) {
433
+ if (labelText && !labelText.includes("\n")) {
434
+ simpleLabels.push(labelText);
435
+ allLabels += labelText + "\n";
436
+ }
437
+ else {
438
+ nativeFont.CalculateStringBounds(labelText !== null && labelText !== void 0 ? labelText : "", textBounds, 0);
439
+ makeCacheEntry(textBounds.m_fWidth, textBounds.m_fHeight, labelText);
440
+ }
441
+ });
442
+ if (simpleLabels.length > 0) {
443
+ nativeFont.CalculateStringBounds(allLabels !== null && allLabels !== void 0 ? allLabels : "", textBounds, 2);
444
+ for (var i = 0; i < simpleLabels.length; i++) {
445
+ var label = simpleLabels[i];
446
+ var bounds = textBounds.GetLineBounds(i);
447
+ makeCacheEntry(bounds.m_fWidth, bounds.m_fHeight - bounds.m_fOffsetY, label);
448
+ }
449
+ }
450
+ };
344
451
  /**
345
452
  * This method creates the text style to be stored in the label cache.
346
453
  * When useSharedCache = true, the label cache will generate a new styleId if this style does not match any existing style.
@@ -350,7 +457,7 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
350
457
  */
351
458
  LabelProviderBase2D.prototype.getCachedStyle = function () {
352
459
  var axis = this.parentAxis;
353
- return __assign(__assign({}, axis.dpiAdjustedLabelStyle), { rotation: this.rotation, providerId: this.useSharedCache ? undefined : this.providerId });
460
+ return __assign(__assign({}, axis.dpiAdjustedLabelStyle), { rotation: this.rotation, providerId: this.useSharedCache ? (this.useNativeText ? "native" : undefined) : this.providerId });
354
461
  };
355
462
  LabelProviderBase2D.prototype.clearCache = function () {
356
463
  if (this.useCache) {
@@ -359,8 +466,8 @@ var LabelProviderBase2D = /** @class */ (function (_super) {
359
466
  LabelCache_1.labelCache.freeStyle(this.styleId);
360
467
  this.styleId = undefined;
361
468
  }
362
- this.tickToText.clear();
363
469
  }
470
+ this.tickToText.clear();
364
471
  };
365
472
  LabelProviderBase2D.prototype.invalidateParent = function () {
366
473
  this.clearCache();
@@ -40,8 +40,9 @@ var LogarithmicLabelProvider = /** @class */ (function (_super) {
40
40
  * @param options Optional parameters of type {@link ILabelOptions} used to configure the axis at instantiation time
41
41
  */
42
42
  function LogarithmicLabelProvider(options) {
43
+ var _this = this;
43
44
  var _a, _b;
44
- var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Scientific, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 1 }, options)) || this;
45
+ _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Scientific, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 1 }, options)) || this;
45
46
  _this.formatLabelProperty = function (dataValue) {
46
47
  return _this.numericFormat === NumericFormat_1.ENumericFormat.Scientific
47
48
  ? _this.applyFormat((0, number_1.toScientific)(dataValue, _this.precision, _this.logarithmicBase))
@@ -41,8 +41,9 @@ var NumericLabelProvider = /** @class */ (function (_super) {
41
41
  * @param options Optional parameters of type {@link ILabelOptions} used to configure the axis at instantiation time
42
42
  */
43
43
  function NumericLabelProvider(options) {
44
+ var _this = this;
44
45
  var _a, _b;
45
- var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Decimal, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 1 }, options)) || this;
46
+ _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Decimal, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 1 }, options)) || this;
46
47
  _this.type = LabelProviderType_1.ELabelProviderType.Numeric;
47
48
  _this.formatLabelProperty = function (dataValue) {
48
49
  return _this.applyFormat((0, number_1.formatNumber)(dataValue, _this.numericFormat, _this.precision));
@@ -40,8 +40,9 @@ var LabelProvider_1 = require("./LabelProvider");
40
40
  var PieLabelProvider = /** @class */ (function (_super) {
41
41
  __extends(PieLabelProvider, _super);
42
42
  function PieLabelProvider(options) {
43
+ var _this = this;
43
44
  var _a, _b;
44
- var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Decimal, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 2 }, options)) || this;
45
+ _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Decimal, labelPrecision: (_b = options === null || options === void 0 ? void 0 : options.labelPrecision) !== null && _b !== void 0 ? _b : 2 }, options)) || this;
45
46
  _this.type = LabelProviderType_1.ELabelProviderType.Pie;
46
47
  _this.formatLabelProperty = function (dataValue) {
47
48
  return _this.applyFormat((0, number_1.formatNumber)(dataValue, _this.numericFormat, _this.precision)) +
@@ -1,15 +1,44 @@
1
1
  import { ELabelProviderType } from "../../../../types/LabelProviderType";
2
2
  import { ENumericFormat } from "../../../../types/NumericFormat";
3
3
  import { LabelProviderBase2D, ILabel2DOptions } from "./LabelProviderBase2D";
4
+ export declare enum ETradeChartLabelFormat {
5
+ Seconds = "Seconds",
6
+ Minutes = "Minutes",
7
+ Days = "Days",
8
+ Months = "Months"
9
+ }
10
+ export interface ISmartDateLabelProviderOptions extends ILabel2DOptions {
11
+ /**
12
+ * Sets whether the first label should be formatted using the wider format (eg Month Day).
13
+ * If false the wider format will only be used when it changes (eg day/month boundary)
14
+ */
15
+ showWiderDateOnFirstLabel?: boolean;
16
+ }
4
17
  /**
5
18
  * The {@link SmartDateLabelProvider} formats Axis Labels and Cursor / Tooltips for {@link NumericAxis} types
6
19
  */
7
20
  export declare class SmartDateLabelProvider extends LabelProviderBase2D {
8
21
  readonly type = ELabelProviderType.SmartDate;
22
+ protected textVariesForSameTick: boolean;
23
+ private prevValue;
24
+ private prevPrevValue;
25
+ private format;
26
+ private showWiderDateOnFirstLabelProperty;
27
+ private firstLabel;
9
28
  /**
10
29
  * Creates an instance of {@link SmartDateLabelProvider}
11
30
  */
12
- constructor(options?: ILabel2DOptions);
31
+ constructor(options?: ISmartDateLabelProviderOptions);
32
+ /**
33
+ * Gets or Sets whether the first label should be formatted using the wider format (eg Month Day).
34
+ * If false the wider format will only be used when it changes (eg day/month boundary)
35
+ */
36
+ get showWiderDateOnFirstLabel(): boolean;
37
+ /**
38
+ * Gets or Sets whether the first label should be formatted using the wider format (eg Month Day).
39
+ * If false the wider format will only be used when it changes (eg day/month boundary)
40
+ */
41
+ set showWiderDateOnFirstLabel(value: boolean);
13
42
  /**
14
43
  * @inheritDoc
15
44
  */
@@ -22,6 +51,7 @@ export declare class SmartDateLabelProvider extends LabelProviderBase2D {
22
51
  get numericFormat(): ENumericFormat;
23
52
  /** @inheritDoc */
24
53
  set numericFormat(value: ENumericFormat);
54
+ private doFormat;
25
55
  private getTradeChartLabelFormat;
26
56
  private formatTradeChartLabel;
27
57
  }
@@ -26,12 +26,11 @@ var __assign = (this && this.__assign) || function () {
26
26
  return __assign.apply(this, arguments);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.SmartDateLabelProvider = void 0;
29
+ exports.SmartDateLabelProvider = exports.ETradeChartLabelFormat = void 0;
30
30
  var LabelProviderType_1 = require("../../../../types/LabelProviderType");
31
31
  var NumericFormat_1 = require("../../../../types/NumericFormat");
32
32
  var date_1 = require("../../../../utils/date");
33
33
  var number_1 = require("../../../../utils/number");
34
- var LabelCache_1 = require("./LabelCache");
35
34
  var LabelProviderBase2D_1 = require("./LabelProviderBase2D");
36
35
  var ETradeChartLabelFormat;
37
36
  (function (ETradeChartLabelFormat) {
@@ -43,7 +42,7 @@ var ETradeChartLabelFormat;
43
42
  ETradeChartLabelFormat["Days"] = "Days";
44
43
  // 2020 ... Jan ... Feb
45
44
  ETradeChartLabelFormat["Months"] = "Months";
46
- })(ETradeChartLabelFormat || (ETradeChartLabelFormat = {}));
45
+ })(ETradeChartLabelFormat = exports.ETradeChartLabelFormat || (exports.ETradeChartLabelFormat = {}));
47
46
  var ONE_HOUR = 60 * 60;
48
47
  var FIVE_DAYS = 60 * 60 * 24 * 5;
49
48
  var FIFTY_DAYS = 60 * 60 * 24 * 50;
@@ -56,18 +55,43 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
56
55
  * Creates an instance of {@link SmartDateLabelProvider}
57
56
  */
58
57
  function SmartDateLabelProvider(options) {
59
- var _a, _b;
60
- var _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Date_DDMMYYYY, cursorLabelFormat: (_b = options === null || options === void 0 ? void 0 : options.cursorLabelFormat) !== null && _b !== void 0 ? _b : NumericFormat_1.ENumericFormat.Date_DDMMYYYY }, options)) || this;
58
+ var _this = this;
59
+ var _a, _b, _c;
60
+ _this = _super.call(this, __assign({ labelFormat: (_a = options === null || options === void 0 ? void 0 : options.labelFormat) !== null && _a !== void 0 ? _a : NumericFormat_1.ENumericFormat.Date_DDMMYYYY, cursorLabelFormat: (_b = options === null || options === void 0 ? void 0 : options.cursorLabelFormat) !== null && _b !== void 0 ? _b : NumericFormat_1.ENumericFormat.Date_DDMMYYYY }, options)) || this;
61
61
  _this.type = LabelProviderType_1.ELabelProviderType.SmartDate;
62
- _this.formatLabelProperty = function (dataValue) {
63
- return _this.applyFormat((0, number_1.formatNumber)(dataValue, _this.numericFormat, _this.precision));
64
- };
62
+ _this.textVariesForSameTick = true;
63
+ _this.showWiderDateOnFirstLabelProperty = true;
64
+ _this.firstLabel = true;
65
+ _this.showWiderDateOnFirstLabelProperty = (_c = options === null || options === void 0 ? void 0 : options.showWiderDateOnFirstLabel) !== null && _c !== void 0 ? _c : _this.showWiderDateOnFirstLabel;
65
66
  _this.formatCursorLabelProperty = function (dataValue) {
66
67
  var _a, _b;
67
68
  return _this.applyFormat((0, number_1.formatNumber)(dataValue, (_a = _this.cursorNumericFormat) !== null && _a !== void 0 ? _a : _this.numericFormat, (_b = _this.cursorPrecision) !== null && _b !== void 0 ? _b : _this.precision));
68
69
  };
70
+ _this.doFormat = _this.doFormat.bind(_this);
71
+ _this.formatLabelProperty = _this.doFormat;
69
72
  return _this;
70
73
  }
74
+ Object.defineProperty(SmartDateLabelProvider.prototype, "showWiderDateOnFirstLabel", {
75
+ /**
76
+ * Gets or Sets whether the first label should be formatted using the wider format (eg Month Day).
77
+ * If false the wider format will only be used when it changes (eg day/month boundary)
78
+ */
79
+ get: function () {
80
+ return this.showWiderDateOnFirstLabelProperty;
81
+ },
82
+ /**
83
+ * Gets or Sets whether the first label should be formatted using the wider format (eg Month Day).
84
+ * If false the wider format will only be used when it changes (eg day/month boundary)
85
+ */
86
+ set: function (value) {
87
+ if (this.showWiderDateOnFirstLabelProperty !== value) {
88
+ this.showWiderDateOnFirstLabelProperty = value;
89
+ this.invalidateParent();
90
+ }
91
+ },
92
+ enumerable: false,
93
+ configurable: true
94
+ });
71
95
  /**
72
96
  * @inheritDoc
73
97
  */
@@ -78,38 +102,22 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
78
102
  * @inheritDoc
79
103
  */
80
104
  SmartDateLabelProvider.prototype.getLabels = function (majorTicks) {
81
- var ticks = majorTicks;
105
+ var first = majorTicks[0];
106
+ var ticksNumber = majorTicks.length;
107
+ var last = majorTicks[ticksNumber - 1];
108
+ // Only convert the values we need
82
109
  if (this.parentAxis.isCategoryAxis) {
83
- var categoryCoordCalc_1 = this.parentAxis.getCurrentCoordinateCalculator(true);
84
- ticks = majorTicks.map(function (tick) { return categoryCoordCalc_1.transformIndexToData(tick); });
110
+ var categoryCoordCalc = this.parentAxis.getCurrentCoordinateCalculator();
111
+ first = categoryCoordCalc.transformIndexToData(first);
112
+ last = categoryCoordCalc.transformIndexToData(last);
85
113
  }
86
- var labels = [];
87
- var ticksNumber = ticks.length;
88
- var timeRange = ticks[ticksNumber - 1] - ticks[0];
89
- var format = this.getTradeChartLabelFormat(timeRange, ticksNumber);
90
- for (var index = 0; index < ticks.length; index++) {
91
- var tick = ticks[index];
92
- var prevValue = index > 0 ? ticks[index - 1] : undefined;
93
- var prevPrevValue = index > 0 ? ticks[index - 2] : undefined;
94
- var text = this.formatTradeChartLabel(format, tick, prevValue, prevPrevValue);
95
- var cachedLabelText = this.tickToText.get(tick);
96
- var cachedLabel = void 0;
97
- if (cachedLabelText && cachedLabelText === text) {
98
- cachedLabel = LabelCache_1.labelCache.getLabel(cachedLabelText, this.styleId);
99
- labels.push(cachedLabelText);
100
- }
101
- else {
102
- this.tickToText.set(tick, text);
103
- var axis = this.parentAxis;
104
- var texture = this.getCachedLabelTexture(text, axis.axisRenderer.textureManager, axis.dpiAdjustedLabelStyle);
105
- if (!texture.textureWidth) {
106
- cachedLabel = new LabelProviderBase2D_1.LabelInfo(tick, text, texture.bitmapTexture, texture.textureHeight, texture.textureWidth);
107
- LabelCache_1.labelCache.setLabel(text, this.styleId, cachedLabel);
108
- }
109
- labels.push(text);
110
- }
111
- }
112
- LabelCache_1.labelCache.pruneCache();
114
+ this.prevPrevValue = undefined;
115
+ this.prevValue = undefined;
116
+ var timeRange = last - first;
117
+ this.firstLabel = true;
118
+ this.format = this.getTradeChartLabelFormat(timeRange, ticksNumber);
119
+ var labels = _super.prototype.getLabels.call(this, majorTicks);
120
+ this.format = undefined;
113
121
  return labels;
114
122
  };
115
123
  Object.defineProperty(SmartDateLabelProvider.prototype, "numericFormat", {
@@ -124,6 +132,18 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
124
132
  enumerable: false,
125
133
  configurable: true
126
134
  });
135
+ SmartDateLabelProvider.prototype.doFormat = function (dataValue) {
136
+ var _a, _b;
137
+ if (this.format) {
138
+ var text = this.formatTradeChartLabel(this.format, dataValue, this.prevValue, this.prevPrevValue);
139
+ this.prevPrevValue = this.prevValue;
140
+ this.prevValue = dataValue;
141
+ return text;
142
+ }
143
+ else {
144
+ return this.applyFormat((0, number_1.formatNumber)(dataValue, (_a = this.cursorNumericFormat) !== null && _a !== void 0 ? _a : this.numericFormat, (_b = this.cursorPrecision) !== null && _b !== void 0 ? _b : this.precision));
145
+ }
146
+ };
127
147
  SmartDateLabelProvider.prototype.getTradeChartLabelFormat = function (timeRange, ticksNumber) {
128
148
  if (timeRange <= ONE_HOUR) {
129
149
  return ETradeChartLabelFormat.Seconds;
@@ -139,10 +159,12 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
139
159
  }
140
160
  };
141
161
  SmartDateLabelProvider.prototype.formatTradeChartLabel = function (tradeChartLabelFormat, value, prevValue, prevPrevValue) {
162
+ var showWider = !this.firstLabel || this.showWiderDateOnFirstLabel;
163
+ this.firstLabel = false;
142
164
  if (tradeChartLabelFormat === ETradeChartLabelFormat.Seconds) {
143
165
  var newDate = prevValue === undefined ||
144
166
  (0, date_1.formatUnixDateToHumanStringMMMDD)(value) !== (0, date_1.formatUnixDateToHumanStringMMMDD)(prevValue);
145
- if (newDate) {
167
+ if (newDate && showWider) {
146
168
  return (0, date_1.formatUnixDateToHumanStringMMMDD)(value);
147
169
  }
148
170
  else {
@@ -152,7 +174,7 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
152
174
  else if (tradeChartLabelFormat === ETradeChartLabelFormat.Minutes) {
153
175
  var newDate = prevValue === undefined ||
154
176
  (0, date_1.formatUnixDateToHumanStringMMMDD)(value) !== (0, date_1.formatUnixDateToHumanStringMMMDD)(prevValue);
155
- if (newDate) {
177
+ if (newDate && showWider) {
156
178
  return (0, date_1.formatUnixDateToHumanStringMMMDD)(value);
157
179
  }
158
180
  else {
@@ -162,7 +184,7 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
162
184
  else if (tradeChartLabelFormat === ETradeChartLabelFormat.Days) {
163
185
  var newMonth = prevValue === undefined ||
164
186
  (0, date_1.formatUnixDateToHumanStringMMM)(value) !== (0, date_1.formatUnixDateToHumanStringMMM)(prevValue);
165
- if (newMonth) {
187
+ if (newMonth && showWider) {
166
188
  return (0, date_1.formatUnixDateToHumanStringMMM)(value);
167
189
  }
168
190
  else {
@@ -172,7 +194,7 @@ var SmartDateLabelProvider = /** @class */ (function (_super) {
172
194
  else if (tradeChartLabelFormat === ETradeChartLabelFormat.Months) {
173
195
  var newYear = prevValue === undefined ||
174
196
  (0, date_1.formatUnixDateToHumanStringYYYY)(value) !== (0, date_1.formatUnixDateToHumanStringYYYY)(prevValue);
175
- if (newYear) {
197
+ if (newYear && showWider) {
176
198
  return (0, date_1.formatUnixDateToHumanStringYYYY)(value);
177
199
  }
178
200
  // If previous label was year, display month label
@@ -65,9 +65,9 @@ export declare class TextLabelProvider extends LabelProviderBase2D {
65
65
  getLabelTextureAsync(labelText: string, textureManager: TextureManager, labelStyle: TTextStyle): Promise<import("../../TextureManager/TextureManager").TTextureObject>;
66
66
  getLabelTexture(labelText: string, textureManager: TextureManager, labelStyle: TTextStyle): import("../../TextureManager/TextureManager").TTextureObject;
67
67
  /**
68
- * Convert the label text to an array of lines
68
+ * Wraps the label text and returns it as a string with newlines
69
69
  */
70
- wrapText(text: string): string[];
70
+ wrapText(text: string | string[]): string;
71
71
  toJSON(): {
72
72
  type: string;
73
73
  options: Required<Omit<import("./LabelProvider").ILabelOptions, never>>;
@@ -71,8 +71,9 @@ var LabelProviderBase2D_1 = require("./LabelProviderBase2D");
71
71
  var TextLabelProvider = /** @class */ (function (_super) {
72
72
  __extends(TextLabelProvider, _super);
73
73
  function TextLabelProvider(options) {
74
+ var _this = this;
74
75
  var _a, _b, _c;
75
- var _this = _super.call(this, options) || this;
76
+ _this = _super.call(this, options) || this;
76
77
  _this.type = LabelProviderType_1.ELabelProviderType.Text;
77
78
  _this.maxLengthProperty = 0;
78
79
  _this.lineSpacingProperty = 1.1;
@@ -80,12 +81,13 @@ var TextLabelProvider = /** @class */ (function (_super) {
80
81
  _this.maxLength = (_b = options === null || options === void 0 ? void 0 : options.maxLength) !== null && _b !== void 0 ? _b : _this.maxLength;
81
82
  _this.lineSpacing = (_c = options === null || options === void 0 ? void 0 : options.lineSpacing) !== null && _c !== void 0 ? _c : _this.lineSpacing;
82
83
  _this.formatLabelProperty = function (dataValue) {
84
+ var _a, _b;
83
85
  if (_this.parentAxis.isCategoryAxis && Array.isArray(_this.labels)) {
84
- var categoryCoordCalc = _this.parentAxis.getCurrentCoordinateCalculator(true);
86
+ var categoryCoordCalc = _this.parentAxis.getCurrentCoordinateCalculator();
85
87
  var index = categoryCoordCalc.transformDataToIndex(dataValue);
86
- return _this.labels[index];
88
+ return _this.wrapText((_a = _this.labels[index]) !== null && _a !== void 0 ? _a : "");
87
89
  }
88
- return _this.labels[dataValue];
90
+ return _this.wrapText((_b = _this.labels[dataValue]) !== null && _b !== void 0 ? _b : "");
89
91
  };
90
92
  _this.formatCursorLabelProperty = _this.formatLabelProperty;
91
93
  return _this;
@@ -152,7 +154,7 @@ var TextLabelProvider = /** @class */ (function (_super) {
152
154
  });
153
155
  TextLabelProvider.prototype.onBeginAxisDraw = function () { };
154
156
  TextLabelProvider.prototype.getLabelWidth = function (ctx, labelText, labelStyle) {
155
- if (this.rotation % 90 === 0 || !this.parentAxis.isHorizontalAxis) {
157
+ if (this.useNativeText || this.rotation % 90 === 0 || !this.parentAxis.isHorizontalAxis) {
156
158
  var cachedlabel = LabelCache_1.labelCache.getLabel(labelText, this.styleId);
157
159
  if (!cachedlabel) {
158
160
  var padding = labelStyle.padding;
@@ -161,7 +163,7 @@ var TextLabelProvider = /** @class */ (function (_super) {
161
163
  return cachedlabel.textureWidth;
162
164
  }
163
165
  else {
164
- var lines = Array.isArray(labelText) ? labelText : this.wrapText(labelText);
166
+ var lines = Array.isArray(labelText) ? labelText : labelText.split("\n");
165
167
  return (lines.length * this.lineSpacing * labelStyle.fontSize +
166
168
  labelStyle.padding.left +
167
169
  labelStyle.padding.right);
@@ -169,7 +171,7 @@ var TextLabelProvider = /** @class */ (function (_super) {
169
171
  };
170
172
  TextLabelProvider.prototype.getLabelTextureAsync = function (labelText, textureManager, labelStyle) {
171
173
  return __awaiter(this, void 0, void 0, function () {
172
- var image, lines;
174
+ var image;
173
175
  return __generator(this, function (_a) {
174
176
  switch (_a.label) {
175
177
  case 0:
@@ -180,9 +182,7 @@ var TextLabelProvider = /** @class */ (function (_super) {
180
182
  case 1:
181
183
  image = _a.sent();
182
184
  return [3 /*break*/, 4];
183
- case 2:
184
- lines = this.wrapText(labelText);
185
- return [4 /*yield*/, TextureWorker_1.textureWorker.measureAndGetImageData(lines, labelStyle, this.rotation, this.lineSpacing)];
185
+ case 2: return [4 /*yield*/, TextureWorker_1.textureWorker.measureAndGetImageData([labelText], labelStyle, this.rotation, this.lineSpacing)];
186
186
  case 3:
187
187
  image = _a.sent();
188
188
  _a.label = 4;
@@ -193,19 +193,16 @@ var TextLabelProvider = /** @class */ (function (_super) {
193
193
  });
194
194
  };
195
195
  TextLabelProvider.prototype.getLabelTexture = function (labelText, textureManager, labelStyle) {
196
- if (Array.isArray(labelText)) {
197
- return textureManager.createTextTexture(labelText, labelStyle, this.rotation, this.lineSpacing);
198
- }
199
- else {
200
- var lines = this.wrapText(labelText);
201
- return textureManager.createTextTexture(lines, labelStyle, this.rotation, this.lineSpacing);
202
- }
196
+ var lines = labelText.split("\n");
197
+ return textureManager.createTextTexture(lines, labelStyle, this.rotation, this.lineSpacing);
203
198
  };
204
199
  /**
205
- * Convert the label text to an array of lines
200
+ * Wraps the label text and returns it as a string with newlines
206
201
  */
207
202
  TextLabelProvider.prototype.wrapText = function (text) {
208
- return (0, exports.wrapText)(text, this.maxLength);
203
+ if (text && Array.isArray(text))
204
+ return text.join("\n");
205
+ return (0, exports.wrapText)(text, this.maxLength).join("\n");
209
206
  };
210
207
  TextLabelProvider.prototype.toJSON = function () {
211
208
  var json = _super.prototype.toJSON.call(this);