scichart 2.2.2417 → 3.0.0-beta.224
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.
- package/Builder/buildDataSeries.d.ts +16 -1
- package/Builder/buildDataSeries.js +24 -1
- package/Builder/buildSeries.d.ts +60 -3
- package/Builder/buildSeries.js +28 -1
- package/Builder/buildSurface.d.ts +28 -2
- package/Builder/buildSurface.js +53 -31
- package/Builder/chartBuilder.d.ts +20 -7
- package/Builder/chartBuilder.js +37 -3
- package/Charting/ChartModifiers/ChartModifierBase.d.ts +21 -0
- package/Charting/ChartModifiers/ChartModifierBase.js +12 -0
- package/Charting/ChartModifiers/ChartModifierBase2D.js +2 -1
- package/Charting/ChartModifiers/CursorModifier.d.ts +83 -10
- package/Charting/ChartModifiers/CursorModifier.js +147 -58
- package/Charting/ChartModifiers/DataPointSelectionModifier.js +2 -1
- package/Charting/ChartModifiers/LegendModifier.js +2 -1
- package/Charting/ChartModifiers/ModifierMouseArgs.d.ts +6 -1
- package/Charting/ChartModifiers/ModifierMouseArgs.js +13 -3
- package/Charting/ChartModifiers/MouseWheelZoomModifier.d.ts +2 -2
- package/Charting/ChartModifiers/MouseWheelZoomModifier.js +16 -4
- package/Charting/ChartModifiers/OverviewRangeSelectionModifier.d.ts +2 -1
- package/Charting/ChartModifiers/OverviewRangeSelectionModifier.js +8 -4
- package/Charting/ChartModifiers/PinchZoomModifier.js +2 -1
- package/Charting/ChartModifiers/RolloverModifier.d.ts +40 -0
- package/Charting/ChartModifiers/RolloverModifier.js +40 -3
- package/Charting/ChartModifiers/RubberBandXyZoomModifier.js +2 -1
- package/Charting/ChartModifiers/SeriesSelectionModifier.js +2 -1
- package/Charting/ChartModifiers/XAxisDragModifier.d.ts +1 -1
- package/Charting/ChartModifiers/XAxisDragModifier.js +2 -1
- package/Charting/ChartModifiers/YAxisDragModifier.d.ts +1 -1
- package/Charting/ChartModifiers/YAxisDragModifier.js +2 -1
- package/Charting/ChartModifiers/ZoomExtentsModifier.js +2 -1
- package/Charting/ChartModifiers/ZoomPanModifier.js +2 -1
- package/Charting/ChartModifiers/constants.d.ts +3 -1
- package/Charting/ChartModifiers/constants.js +2 -0
- package/Charting/Drawing/BatchRenderContext.d.ts +6 -0
- package/Charting/Drawing/BatchRenderContext.js +40 -0
- package/Charting/Drawing/RenderSurface.d.ts +2 -1
- package/Charting/Drawing/RenderSurface.js +3 -2
- package/Charting/Drawing/WebGlRenderContext2D.d.ts +19 -4
- package/Charting/Drawing/WebGlRenderContext2D.js +70 -41
- package/Charting/LayoutManager/BaseCenteredAxisLayoutStrategy.js +2 -1
- package/Charting/LayoutManager/BottomAlignedInnerAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/CentralAxesLayoutManager.js +2 -1
- package/Charting/LayoutManager/LayoutManager.d.ts +2 -1
- package/Charting/LayoutManager/LayoutManager.js +6 -5
- package/Charting/LayoutManager/LeftAlignedInnerAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/RightAlignedInnerAxisLayoutStrategy.js +1 -1
- package/Charting/LayoutManager/TopAlignedInnerAxisLayoutStrategy.js +1 -1
- package/Charting/Model/BaseDataSeries.d.ts +10 -1
- package/Charting/Model/BaseDataSeries.js +9 -8
- package/Charting/Model/BaseHeatmapDataSeries.d.ts +18 -5
- package/Charting/Model/BaseHeatmapDataSeries.js +21 -13
- package/Charting/Model/ChartData/SeriesInfo.d.ts +6 -0
- package/Charting/Model/ChartData/SeriesInfo.js +5 -0
- package/Charting/Model/ChartData/XyySeriesInfo.d.ts +2 -0
- package/Charting/Model/ChartData/XyySeriesInfo.js +2 -0
- package/Charting/Model/DataDistributionCalculator/DataDistributionCalculator.js +4 -3
- package/Charting/Model/Filters/HlcCustomFilter.js +12 -9
- package/Charting/Model/Filters/HlcFilterBase.js +2 -1
- package/Charting/Model/Filters/HlcScaleOffsetFilter.js +2 -1
- package/Charting/Model/Filters/OhlcCustomFilter.js +12 -9
- package/Charting/Model/Filters/OhlcScaleOffsetFilter.js +2 -1
- package/Charting/Model/Filters/XyCustomFilter.js +12 -9
- package/Charting/Model/Filters/XyFilterBase.d.ts +14 -5
- package/Charting/Model/Filters/XyFilterBase.js +47 -15
- package/Charting/Model/Filters/XyMovingAverageFilter.js +2 -1
- package/Charting/Model/Filters/XyRatioFilter.js +2 -1
- package/Charting/Model/Filters/XyScaleOffsetFilter.js +2 -1
- package/Charting/Model/Filters/XyyCustomFilter.js +12 -9
- package/Charting/Model/Filters/XyyFilterBase.js +2 -1
- package/Charting/Model/Filters/XyyScaleOffsetFilter.js +2 -1
- package/Charting/Model/Filters/XyzCustomFilter.js +12 -9
- package/Charting/Model/Filters/XyzFilterBase.js +2 -1
- package/Charting/Model/Filters/XyzScaleOffsetFilter.js +2 -1
- package/Charting/Model/IDataSeries.d.ts +9 -1
- package/Charting/Model/IDataSeries.js +8 -0
- package/Charting/Model/NonUniformHeatmapDataSeries.d.ts +112 -0
- package/Charting/Model/NonUniformHeatmapDataSeries.js +261 -0
- package/Charting/Model/PaletteFactory.d.ts +40 -4
- package/Charting/Model/PaletteFactory.js +37 -11
- package/Charting/Model/XyTextDataSeries.d.ts +121 -0
- package/Charting/Model/XyTextDataSeries.js +274 -0
- package/Charting/Numerics/CoordinateCalculators/CoordinateCalculatorBase.d.ts +1 -1
- package/Charting/Numerics/Resamplers/ExtremeResamplerHelper.js +1 -1
- package/Charting/Services/RenderPassData.d.ts +15 -5
- package/Charting/Services/RenderPassData.js +27 -5
- package/Charting/Services/SciChartRenderer.d.ts +2 -1
- package/Charting/Services/SciChartRenderer.js +92 -29
- package/Charting/Themes/IThemeProvider.d.ts +61 -0
- package/Charting/Themes/IThemeProvider.js +67 -1
- package/Charting/Themes/SciChartJSDarkTheme.d.ts +4 -0
- package/Charting/Themes/SciChartJSDarkTheme.js +6 -2
- package/Charting/Themes/SciChartJSDarkv2Theme.js +3 -0
- package/Charting/Themes/SciChartJSLightTheme.d.ts +8 -0
- package/Charting/Themes/SciChartJSLightTheme.js +8 -0
- package/Charting/Themes/SciChartJsNavyTheme.d.ts +10 -0
- package/Charting/Themes/SciChartJsNavyTheme.js +49 -0
- package/Charting/Visuals/Annotations/AdornerLayer.js +4 -8
- package/Charting/Visuals/Annotations/AnnotationBase.d.ts +80 -7
- package/Charting/Visuals/Annotations/AnnotationBase.js +238 -28
- package/Charting/Visuals/Annotations/AnnotationClickEventArgs.d.ts +11 -0
- package/Charting/Visuals/Annotations/AnnotationClickEventArgs.js +12 -0
- package/Charting/Visuals/Annotations/AxisMarkerAnnotation.d.ts +1 -0
- package/Charting/Visuals/Annotations/AxisMarkerAnnotation.js +18 -19
- package/Charting/Visuals/Annotations/BoxAnnotation.d.ts +1 -0
- package/Charting/Visuals/Annotations/BoxAnnotation.js +69 -67
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.d.ts +2 -2
- package/Charting/Visuals/Annotations/CursorTooltipSvgAnnotation.js +20 -20
- package/Charting/Visuals/Annotations/CustomAnnotation.d.ts +1 -1
- package/Charting/Visuals/Annotations/CustomAnnotation.js +3 -2
- package/Charting/Visuals/Annotations/HorizontalLineAnnotation.js +6 -3
- package/Charting/Visuals/Annotations/IAdornerProvider.d.ts +12 -0
- package/Charting/Visuals/Annotations/IAnnotation.d.ts +9 -0
- package/Charting/Visuals/Annotations/IAnnotation.js +9 -0
- package/Charting/Visuals/Annotations/LineAnnotation.d.ts +1 -0
- package/Charting/Visuals/Annotations/LineAnnotation.js +29 -35
- package/Charting/Visuals/Annotations/NativeTextAnnotation.d.ts +193 -0
- package/Charting/Visuals/Annotations/NativeTextAnnotation.js +536 -0
- package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.d.ts +4 -2
- package/Charting/Visuals/Annotations/OverviewCustomResizableAnnotation.js +19 -14
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.d.ts +2 -2
- package/Charting/Visuals/Annotations/RolloverLegendSvgAnnotation.js +9 -8
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.d.ts +2 -2
- package/Charting/Visuals/Annotations/RolloverMarkerSvgAnnotation.js +6 -6
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.d.ts +2 -2
- package/Charting/Visuals/Annotations/RolloverTooltipSvgAnnotation.js +16 -17
- package/Charting/Visuals/Annotations/SvgAnnotationBase.d.ts +13 -2
- package/Charting/Visuals/Annotations/SvgAnnotationBase.js +34 -42
- package/Charting/Visuals/Annotations/TextAnnotation.d.ts +2 -2
- package/Charting/Visuals/Annotations/TextAnnotation.js +41 -22
- package/Charting/Visuals/Annotations/VerticalLineAnnotation.js +6 -3
- package/Charting/Visuals/Annotations/annotationHelpers.d.ts +6 -6
- package/Charting/Visuals/Annotations/annotationHelpers.js +7 -6
- package/Charting/Visuals/Annotations/constants.d.ts +13 -1
- package/Charting/Visuals/Annotations/constants.js +12 -0
- package/Charting/Visuals/Axis/AxisBase2D.d.ts +24 -4
- package/Charting/Visuals/Axis/AxisBase2D.js +115 -38
- package/Charting/Visuals/Axis/AxisCore.d.ts +10 -5
- package/Charting/Visuals/Axis/AxisCore.js +11 -10
- package/Charting/Visuals/Axis/AxisRenderer.js +114 -20
- package/Charting/Visuals/Axis/CategoryAxis.js +2 -1
- package/Charting/Visuals/Axis/CategoryAxisBase.d.ts +15 -15
- package/Charting/Visuals/Axis/CategoryAxisBase.js +14 -12
- package/Charting/Visuals/Axis/DateTimeNumericAxis.js +2 -1
- package/Charting/Visuals/Axis/DeltaCalculator/DateTimeDeltaCalculator.js +2 -1
- package/Charting/Visuals/Axis/LabelProvider/DateLabelProvider.js +2 -1
- package/Charting/Visuals/Axis/LabelProvider/LabelCache.js +2 -0
- package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.d.ts +14 -0
- package/Charting/Visuals/Axis/LabelProvider/LabelProviderBase2D.js +140 -33
- package/Charting/Visuals/Axis/LabelProvider/LogarithmicLabelProvider.js +2 -1
- package/Charting/Visuals/Axis/LabelProvider/NumericLabelProvider.js +2 -1
- package/Charting/Visuals/Axis/LabelProvider/PieLabelProvider.js +2 -1
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.d.ts +31 -1
- package/Charting/Visuals/Axis/LabelProvider/SmartDateLabelProvider.js +64 -42
- package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.d.ts +2 -2
- package/Charting/Visuals/Axis/LabelProvider/TextLabelProvider.js +16 -19
- package/Charting/Visuals/Axis/LogarithmicAxis.js +9 -6
- package/Charting/Visuals/Axis/NumericAxis.js +3 -3
- package/Charting/Visuals/Axis/constants.d.ts +1 -0
- package/Charting/Visuals/Axis/constants.js +1 -0
- package/Charting/Visuals/HeatmapLegend.d.ts +95 -0
- package/Charting/Visuals/HeatmapLegend.js +192 -0
- package/Charting/Visuals/Helpers/NativeObject.d.ts +15 -2
- package/Charting/Visuals/Helpers/NativeObject.js +72 -6
- package/Charting/Visuals/I2DSurfaceOptions.d.ts +46 -0
- package/Charting/Visuals/PointMarkers/BasePointMarker.d.ts +5 -0
- package/Charting/Visuals/PointMarkers/BasePointMarker.js +28 -0
- package/Charting/Visuals/PointMarkers/IPointMarker.d.ts +8 -0
- package/Charting/Visuals/RenderableSeries/Animations/BandAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/BandAnimationStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/BubbleAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/CandlestickAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/CandlestickAnimationStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/ColumnAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/ColumnAnimationStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/CustomPointMarkerStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/FadeAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/LineAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/MountainAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/MountainAnimationStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/OhlcAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/OhlcAnimationStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/PointMarkerStyle.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/ScaleAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/ScatterAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.d.ts +8 -2
- package/Charting/Visuals/RenderableSeries/Animations/SeriesAnimation.js +3 -3
- package/Charting/Visuals/RenderableSeries/Animations/WaveAnimation.js +2 -1
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/BaseBandRenderableSeries.js +42 -10
- package/Charting/Visuals/RenderableSeries/BaseHeatmapRenderableSeries.d.ts +128 -0
- package/Charting/Visuals/RenderableSeries/BaseHeatmapRenderableSeries.js +201 -0
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.d.ts +26 -0
- package/Charting/Visuals/RenderableSeries/BaseLineRenderableSeries.js +39 -3
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/BaseMountainRenderableSeries.js +17 -2
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.d.ts +2 -0
- package/Charting/Visuals/RenderableSeries/BaseOhlcRenderableSeries.js +15 -2
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.d.ts +10 -0
- package/Charting/Visuals/RenderableSeries/BaseRenderableSeries.js +93 -17
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.d.ts +8 -1
- package/Charting/Visuals/RenderableSeries/BaseStackedCollection.js +21 -1
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/BaseStackedRenderableSeries.js +4 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BandSeriesDataLabelProvider.d.ts +43 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BandSeriesDataLabelProvider.js +142 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.d.ts +92 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BaseDataLabelProvider.js +129 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.d.ts +17 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/BubbleSeriesDataLabelProvider.js +62 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.d.ts +47 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/ColumnSeriesDataLabelProvider.js +125 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/ContoursDataLabelProvider.d.ts +71 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/ContoursDataLabelProvider.js +221 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelLayoutManager.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelLayoutManager.js +2 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.d.ts +208 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelProvider.js +410 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.d.ts +40 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/DataLabelState.js +141 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/HeatMapDataLabelProvider.d.ts +63 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/HeatMapDataLabelProvider.js +198 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/LineSeriesDataLabelProvider.d.ts +35 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/LineSeriesDataLabelProvider.js +92 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/NonUniformHeatmapDataLabelProvider.d.ts +12 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/NonUniformHeatmapDataLabelProvider.js +134 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.d.ts +56 -0
- package/Charting/Visuals/RenderableSeries/DataLabels/TextDataLabelProvider.js +167 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.d.ts +0 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BandSeriesDrawingProvider.js +1 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BaseSeriesDrawingProvider.js +47 -40
- package/Charting/Visuals/RenderableSeries/DrawingProviders/BubbleSeriesDrawingProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.d.ts +1 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ColumnSeriesDrawingProvider.js +18 -5
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.d.ts +0 -1
- package/Charting/Visuals/RenderableSeries/DrawingProviders/ErrorSeriesDrawingProvider.js +14 -27
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.d.ts +17 -4
- package/Charting/Visuals/RenderableSeries/DrawingProviders/LineSeriesDrawingProvider.js +34 -11
- package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.d.ts +36 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.js +493 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.d.ts +5 -2
- package/Charting/Visuals/RenderableSeries/DrawingProviders/PointMarkerDrawingProvider.js +8 -5
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformContoursDrawingProvider.js +4 -4
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/DrawingProviders/UniformHeatmapDrawingProvider.js +15 -4
- package/Charting/Visuals/RenderableSeries/FastBandRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.d.ts +21 -0
- package/Charting/Visuals/RenderableSeries/FastBubbleRenderableSeries.js +40 -4
- package/Charting/Visuals/RenderableSeries/FastCandlestickRenderableSeries.d.ts +2 -0
- package/Charting/Visuals/RenderableSeries/FastCandlestickRenderableSeries.js +18 -3
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.d.ts +36 -2
- package/Charting/Visuals/RenderableSeries/FastColumnRenderableSeries.js +77 -8
- package/Charting/Visuals/RenderableSeries/FastErrorBarsRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/FastImpulseRenderableSeries.js +16 -4
- package/Charting/Visuals/RenderableSeries/FastLineRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/FastMountainRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/FastOhlcRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/FastTextRenderableSeries.d.ts +17 -0
- package/Charting/Visuals/RenderableSeries/FastTextRenderableSeries.js +45 -0
- package/Charting/Visuals/RenderableSeries/HeatmapColorMap.js +3 -2
- package/Charting/Visuals/RenderableSeries/HitTest/BandSeriesHitTestProvider.js +35 -5
- package/Charting/Visuals/RenderableSeries/HitTest/BaseHitTestProvider.js +17 -1
- package/Charting/Visuals/RenderableSeries/HitTest/HitTestInfo.d.ts +8 -0
- package/Charting/Visuals/RenderableSeries/HitTest/MountainSeriesHitTestProvider.js +7 -1
- package/Charting/Visuals/RenderableSeries/HitTest/NonUniformHeatmapHitTestProvider.d.ts +20 -0
- package/Charting/Visuals/RenderableSeries/HitTest/NonUniformHeatmapHitTestProvider.js +86 -0
- package/Charting/Visuals/RenderableSeries/HitTest/TextSeriesHitTestProvider.d.ts +6 -0
- package/Charting/Visuals/RenderableSeries/HitTest/TextSeriesHitTestProvider.js +56 -0
- package/Charting/Visuals/RenderableSeries/HitTest/UniformHeatmapHitTestProvider.js +1 -1
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.d.ts +7 -1
- package/Charting/Visuals/RenderableSeries/HitTest/hitTestHelpers.js +34 -2
- package/Charting/Visuals/RenderableSeries/IBaseRenderableSeriesOptions.d.ts +6 -1
- package/Charting/Visuals/RenderableSeries/IRenderableSeries.d.ts +12 -0
- package/Charting/Visuals/RenderableSeries/NonUniformHeatmapRenderableSeries.d.ts +74 -0
- package/Charting/Visuals/RenderableSeries/NonUniformHeatmapRenderableSeries.js +99 -0
- package/Charting/Visuals/RenderableSeries/ShaderEffect.js +2 -2
- package/Charting/Visuals/RenderableSeries/SplineBandRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.d.ts +2 -3
- package/Charting/Visuals/RenderableSeries/SplineLineRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/SplineMountainRenderableSeries.js +2 -1
- package/Charting/Visuals/RenderableSeries/StackedColumnCollection.js +2 -1
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.d.ts +3 -0
- package/Charting/Visuals/RenderableSeries/StackedColumnRenderableSeries.js +13 -2
- package/Charting/Visuals/RenderableSeries/StackedMountainCollection.js +4 -1
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.d.ts +7 -0
- package/Charting/Visuals/RenderableSeries/StackedMountainRenderableSeries.js +33 -9
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/UniformContoursRenderableSeries.js +7 -1
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.d.ts +2 -75
- package/Charting/Visuals/RenderableSeries/UniformHeatmapRenderableSeries.js +8 -130
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.d.ts +5 -0
- package/Charting/Visuals/RenderableSeries/XyScatterRenderableSeries.js +7 -1
- package/Charting/Visuals/RenderableSeries/constants.d.ts +5 -1
- package/Charting/Visuals/RenderableSeries/constants.js +4 -0
- package/Charting/Visuals/RubberBandSvgRect/RubberBandSvgRect.js +3 -3
- package/Charting/Visuals/SciChartDefaults.d.ts +4 -0
- package/Charting/Visuals/SciChartDefaults.js +4 -0
- package/Charting/Visuals/SciChartOverview.js +5 -3
- package/Charting/Visuals/SciChartPieSurface/PieSegment/IPieSegment.d.ts +4 -0
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.d.ts +13 -0
- package/Charting/Visuals/SciChartPieSurface/PieSegment/PieSegment.js +22 -4
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.d.ts +2 -1
- package/Charting/Visuals/SciChartPieSurface/PieSegment/constants.js +1 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.d.ts +5 -0
- package/Charting/Visuals/SciChartPieSurface/SciChartPieSurface.js +17 -19
- package/Charting/Visuals/SciChartSurface.d.ts +225 -7
- package/Charting/Visuals/SciChartSurface.js +782 -28
- package/Charting/Visuals/SciChartSurfaceBase.d.ts +16 -1
- package/Charting/Visuals/SciChartSurfaceBase.js +34 -2
- package/Charting/Visuals/TextureManager/CanvasTexture.js +1 -1
- package/Charting/Visuals/TextureManager/DpiHelper.js +3 -7
- package/Charting/Visuals/TextureManager/TextureManager.d.ts +11 -0
- package/Charting/Visuals/TextureManager/TextureManager.js +37 -1
- package/Charting/Visuals/createMaster.js +7 -10
- package/Charting/Visuals/createSingle.js +2 -0
- package/Charting/Visuals/licenseManager2D.js +9 -9
- package/Charting/Visuals/sciChartInitCommon.js +16 -12
- package/Charting3D/CameraController.d.ts +5 -0
- package/Charting3D/CameraController.js +6 -0
- package/Charting3D/ChartModifiers/ResetCamera3DModifier.js +2 -1
- package/Charting3D/Visuals/Axis/AxisBase3D.js +7 -5
- package/Charting3D/Visuals/Axis/NumericAxis3D.js +2 -1
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.d.ts +4 -0
- package/Charting3D/Visuals/Primitives/ScatterPointsSceneEntity.js +7 -0
- package/Charting3D/Visuals/Primitives/SurfaceMeshSceneEntity.js +6 -4
- package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.d.ts +7 -2
- package/Charting3D/Visuals/RenderableSeries/BaseRenderableSeries3D.js +3 -2
- package/Charting3D/Visuals/RenderableSeries/SurfaceMesh/SurfaceMeshRenderableSeries3D.d.ts +0 -5
- package/Charting3D/Visuals/RenderableSeries/SurfaceMesh/SurfaceMeshRenderableSeries3D.js +12 -11
- package/Charting3D/Visuals/SciChart3DSurface.d.ts +2 -2
- package/Charting3D/Visuals/SciChart3DSurface.js +18 -11
- package/Charting3D/Visuals/createMaster3d.js +10 -18
- package/Charting3D/Visuals/createSingle3d.js +12 -10
- package/Core/Animations/GenericAnimation.d.ts +2 -0
- package/Core/Animations/GenericAnimation.js +3 -0
- package/Core/Animations/NumberRangeAnimator.js +7 -2
- package/Core/BuildStamp.d.ts +1 -1
- package/Core/BuildStamp.js +2 -2
- package/Core/Mouse/MouseManager.d.ts +20 -0
- package/Core/Mouse/MouseManager.js +199 -30
- package/README.md +91 -403
- package/_wasm/scichart.browser.js +1 -1
- package/_wasm/scichart2d.data +0 -0
- package/_wasm/scichart2d.js +280 -267
- package/_wasm/scichart2d.wasm +0 -0
- package/_wasm/scichart3d.data +0 -0
- package/_wasm/scichart3d.js +280 -268
- package/_wasm/scichart3d.wasm +0 -0
- package/constants/performanceWarnings.d.ts +2 -0
- package/constants/performanceWarnings.js +3 -1
- package/package.json +2 -2
- package/types/AutoColorMode.d.ts +9 -0
- package/types/AutoColorMode.js +13 -0
- package/types/BaseType.d.ts +3 -1
- package/types/BaseType.js +2 -0
- package/types/DataLabelProviderType.d.ts +15 -0
- package/types/DataLabelProviderType.js +19 -0
- package/types/DataLabelSkipMode.d.ts +21 -0
- package/types/DataLabelSkipMode.js +25 -0
- package/types/DefaultRenderLayer.d.ts +10 -0
- package/types/DefaultRenderLayer.js +14 -0
- package/types/SeriesType.d.ts +7 -1
- package/types/SeriesType.js +6 -0
- package/types/SvgClippingMode.d.ts +17 -0
- package/types/SvgClippingMode.js +21 -0
- package/types/TDataLabelStyle.d.ts +16 -0
- package/types/TDataLabelStyle.js +2 -0
- package/types/TSciChart.d.ts +214 -118
- package/types/TSciChart3D.d.ts +104 -70
- package/types/TextPosition.d.ts +17 -0
- package/types/TextPosition.js +39 -0
- package/types/ThemeProviderType.d.ts +3 -1
- package/types/ThemeProviderType.js +2 -0
- package/utils/ccall/appendDoubleVectorFromJsArray.d.ts +10 -1
- package/utils/ccall/appendDoubleVectorFromJsArray.js +24 -1
- package/utils/memoize.d.ts +1 -0
- package/utils/memoize.js +26 -0
- package/utils/number.d.ts +1 -0
- package/utils/number.js +5 -1
- package/utils/parseColor.d.ts +2 -0
- package/utils/parseColor.js +3 -3
- package/utils/text.d.ts +5 -0
- package/utils/text.js +48 -0
- package/utils/translate.d.ts +8 -0
- package/utils/translate.js +27 -5
- package/utils/zeroArray2D.d.ts +5 -0
- package/utils/zeroArray2D.js +5 -0
|
@@ -20,6 +20,7 @@ var Deleter_1 = require("../../../../Core/Deleter");
|
|
|
20
20
|
var SeriesType_1 = require("../../../../types/SeriesType");
|
|
21
21
|
var Pen2DCache_1 = require("../../../Drawing/Pen2DCache");
|
|
22
22
|
var WebGlRenderContext2D_1 = require("../../../Drawing/WebGlRenderContext2D");
|
|
23
|
+
var BaseLineRenderableSeries_1 = require("../BaseLineRenderableSeries");
|
|
23
24
|
var constants_1 = require("../constants");
|
|
24
25
|
var BaseSeriesDrawingProvider_1 = require("./BaseSeriesDrawingProvider");
|
|
25
26
|
/**
|
|
@@ -34,8 +35,8 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
34
35
|
* access to our WebGL2 Engine and WebAssembly numerical methods
|
|
35
36
|
* @param parentSeries the parent {@link FastLineRenderableSeries} which this drawing provider is attached to
|
|
36
37
|
*/
|
|
37
|
-
function LineSeriesDrawingProvider(webAssemblyContext, parentSeries) {
|
|
38
|
-
var _this = _super.call(this, webAssemblyContext, parentSeries) || this;
|
|
38
|
+
function LineSeriesDrawingProvider(webAssemblyContext, parentSeries, ySelector, xSelector) {
|
|
39
|
+
var _this = _super.call(this, webAssemblyContext, parentSeries, ySelector, xSelector) || this;
|
|
39
40
|
_this.linesPenCache = new Pen2DCache_1.Pen2DCache(webAssemblyContext);
|
|
40
41
|
_this.args = new webAssemblyContext.SCRTLineDrawingParams();
|
|
41
42
|
return _this;
|
|
@@ -60,18 +61,36 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
60
61
|
propertyName === constants_1.PROPERTY.PALETTE_PROVIDER ||
|
|
61
62
|
propertyName === constants_1.PROPERTY.OPACITY ||
|
|
62
63
|
propertyName === constants_1.PROPERTY.STROKE_DASH_ARRAY) {
|
|
63
|
-
var _a = this.parentSeries, stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
|
|
64
|
-
|
|
64
|
+
var _a = this.getProperties(this.parentSeries), stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
|
|
65
|
+
if (stroke) {
|
|
66
|
+
(0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity !== null && opacity !== void 0 ? opacity : 1, strokeDashArray);
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
};
|
|
70
|
+
/** A mapping function to get the pen properties from the parent series */
|
|
71
|
+
LineSeriesDrawingProvider.prototype.getProperties = function (parentSeries) {
|
|
72
|
+
var stroke = parentSeries.stroke, strokeThickness = parentSeries.strokeThickness, opacity = parentSeries.opacity, strokeDashArray = parentSeries.strokeDashArray, isDigitalLine = parentSeries.isDigitalLine, drawNaNAs = parentSeries.drawNaNAs, lineType = parentSeries.lineType;
|
|
73
|
+
return {
|
|
74
|
+
stroke: stroke,
|
|
75
|
+
strokeThickness: strokeThickness,
|
|
76
|
+
opacity: opacity,
|
|
77
|
+
strokeDashArray: strokeDashArray,
|
|
78
|
+
isDigitalLine: isDigitalLine,
|
|
79
|
+
drawNaNAs: drawNaNAs,
|
|
80
|
+
lineType: lineType,
|
|
81
|
+
containsNaN: undefined
|
|
82
|
+
};
|
|
83
|
+
};
|
|
67
84
|
/**
|
|
68
85
|
* @inheritDoc
|
|
69
86
|
*/
|
|
70
87
|
LineSeriesDrawingProvider.prototype.onAttachSeries = function () {
|
|
71
88
|
_super.prototype.onAttachSeries.call(this);
|
|
72
89
|
this.nativeDrawingProvider = new this.webAssemblyContext.SCRTLineSeriesDrawingProvider();
|
|
73
|
-
var _a = this.parentSeries, stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
|
|
74
|
-
|
|
90
|
+
var _a = this.getProperties(this.parentSeries), stroke = _a.stroke, strokeThickness = _a.strokeThickness, opacity = _a.opacity, strokeDashArray = _a.strokeDashArray;
|
|
91
|
+
if (stroke) {
|
|
92
|
+
(0, Pen2DCache_1.createPenInCache)(this.linesPenCache, stroke, strokeThickness, opacity !== null && opacity !== void 0 ? opacity : 1, strokeDashArray);
|
|
93
|
+
}
|
|
75
94
|
};
|
|
76
95
|
/**
|
|
77
96
|
* @inheritDoc
|
|
@@ -84,27 +103,31 @@ var LineSeriesDrawingProvider = /** @class */ (function (_super) {
|
|
|
84
103
|
* @inheritDoc
|
|
85
104
|
*/
|
|
86
105
|
LineSeriesDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
|
|
106
|
+
var _a = this.getProperties(this.parentSeries), stroke = _a.stroke, isDigitalLine = _a.isDigitalLine, lineType = _a.lineType, drawNaNAs = _a.drawNaNAs, containsNaNOverride = _a.containsNaN;
|
|
87
107
|
var linesPen = (0, Pen2DCache_1.getScrtPenFromCache)(this.linesPenCache);
|
|
88
|
-
if (!linesPen) {
|
|
108
|
+
if (!linesPen || !stroke) {
|
|
89
109
|
return;
|
|
90
110
|
}
|
|
91
111
|
var pointSeries = renderPassData.pointSeries;
|
|
92
112
|
var containsNaN = this.parentSeries.dataSeries.dataDistributionCalculator.containsNaN;
|
|
113
|
+
containsNaN = containsNaNOverride !== null && containsNaNOverride !== void 0 ? containsNaNOverride : containsNaN;
|
|
93
114
|
this.args.Reset();
|
|
94
115
|
this.args.SetLinesPen(linesPen);
|
|
95
|
-
this.args.isDigitalLine =
|
|
116
|
+
this.args.isDigitalLine = isDigitalLine || lineType !== BaseLineRenderableSeries_1.ELineType.Normal;
|
|
117
|
+
this.args.drawDigitalVertical = lineType !== BaseLineRenderableSeries_1.ELineType.DigitalNoEdge;
|
|
118
|
+
this.args.digitalYX = lineType === BaseLineRenderableSeries_1.ELineType.DigitalYX;
|
|
96
119
|
this.args.forceShaderMethod = true;
|
|
97
120
|
this.args.containsNaN = containsNaN;
|
|
98
121
|
this.args.lineGaps = containsNaN
|
|
99
|
-
?
|
|
122
|
+
? drawNaNAs === WebGlRenderContext2D_1.ELineDrawMode.DiscontinuousLine
|
|
100
123
|
? this.webAssemblyContext.SCRTLineGapMode.DrawGaps
|
|
101
124
|
: this.webAssemblyContext.SCRTLineGapMode.CloseGaps
|
|
102
125
|
: this.webAssemblyContext.SCRTLineGapMode.Default;
|
|
103
126
|
this.args.verticalChart = renderPassData.isVerticalChart;
|
|
104
127
|
var isCategoryAxis = renderPassData.xCoordinateCalculator.isCategoryCoordinateCalculator;
|
|
105
|
-
var xValues = pointSeries
|
|
128
|
+
var xValues = this.xSelector(pointSeries);
|
|
106
129
|
var xDrawValues = isCategoryAxis ? pointSeries.indexes : xValues;
|
|
107
|
-
var yDrawValues = pointSeries
|
|
130
|
+
var yDrawValues = this.ySelector(pointSeries);
|
|
108
131
|
var isSplineLineSeries = this.parentSeries.type === SeriesType_1.ESeriesType.SplineLineSeries && xValues.size() > 1;
|
|
109
132
|
if (isSplineLineSeries) {
|
|
110
133
|
var spline = this.parentSeries;
|
package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TSciChart } from "../../../../types/TSciChart";
|
|
2
|
+
import { WebGlRenderContext2D } from "../../../Drawing/WebGlRenderContext2D";
|
|
3
|
+
import { RenderPassData } from "../../../Services/RenderPassData";
|
|
4
|
+
import { NonUniformHeatmapRenderableSeries } from "../NonUniformHeatmapRenderableSeries";
|
|
5
|
+
import { BaseSeriesDrawingProvider } from "./BaseSeriesDrawingProvider";
|
|
6
|
+
/**
|
|
7
|
+
* Used internally - a drawing provider performs drawing for a {@link NonUniformHeatmapRenderableSeries} using
|
|
8
|
+
* our WebAssembly WebGL rendering engine
|
|
9
|
+
*/
|
|
10
|
+
export declare class NonUniformHeatmapDrawingProvider extends BaseSeriesDrawingProvider<NonUniformHeatmapRenderableSeries> {
|
|
11
|
+
private heatTextureCache;
|
|
12
|
+
private colorDataVector;
|
|
13
|
+
private colorGradientScale;
|
|
14
|
+
private getMemoizedHeatmapTexture;
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of the {@link UniformHeatmapDrawingProvider}
|
|
17
|
+
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
|
|
18
|
+
* access to our WebGL2 Engine and WebAssembly numerical methods
|
|
19
|
+
* @param parentSeries the parent {@link UniformHeatmapRenderableSeries} which this drawing provider is attached to
|
|
20
|
+
*/
|
|
21
|
+
constructor(webAssemblyContext: TSciChart, parentSeries: NonUniformHeatmapRenderableSeries);
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
delete(): void;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
onSeriesPropertyChange(propertyName: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
draw(renderContext: WebGlRenderContext2D, renderPassData: RenderPassData): void;
|
|
34
|
+
private drawHeatmapInTypescript;
|
|
35
|
+
private calculateHeatmapTexture;
|
|
36
|
+
}
|
package/Charting/Visuals/RenderableSeries/DrawingProviders/NonUniformHeatmapDrawingProvider.js
ADDED
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
+
t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.NonUniformHeatmapDrawingProvider = void 0;
|
|
30
|
+
var Deleter_1 = require("../../../../Core/Deleter");
|
|
31
|
+
var NumberRange_1 = require("../../../../Core/NumberRange");
|
|
32
|
+
var Rect_1 = require("../../../../Core/Rect");
|
|
33
|
+
var colorUtil_1 = require("../../../../utils/colorUtil");
|
|
34
|
+
var memoize_1 = require("../../../../utils/memoize");
|
|
35
|
+
var parseColor_1 = require("../../../../utils/parseColor");
|
|
36
|
+
var TextureCache_1 = require("../../../Drawing/TextureCache");
|
|
37
|
+
var BaseHeatmapRenderableSeries_1 = require("../BaseHeatmapRenderableSeries");
|
|
38
|
+
var constants_1 = require("../constants");
|
|
39
|
+
var BaseSeriesDrawingProvider_1 = require("./BaseSeriesDrawingProvider");
|
|
40
|
+
// TODO figure out if other value is needed
|
|
41
|
+
var precision = 100;
|
|
42
|
+
/**
|
|
43
|
+
* Used internally - a drawing provider performs drawing for a {@link NonUniformHeatmapRenderableSeries} using
|
|
44
|
+
* our WebAssembly WebGL rendering engine
|
|
45
|
+
*/
|
|
46
|
+
var NonUniformHeatmapDrawingProvider = /** @class */ (function (_super) {
|
|
47
|
+
__extends(NonUniformHeatmapDrawingProvider, _super);
|
|
48
|
+
/**
|
|
49
|
+
* Creates an instance of the {@link UniformHeatmapDrawingProvider}
|
|
50
|
+
* @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
|
|
51
|
+
* access to our WebGL2 Engine and WebAssembly numerical methods
|
|
52
|
+
* @param parentSeries the parent {@link UniformHeatmapRenderableSeries} which this drawing provider is attached to
|
|
53
|
+
*/
|
|
54
|
+
function NonUniformHeatmapDrawingProvider(webAssemblyContext, parentSeries) {
|
|
55
|
+
var _this = _super.call(this, webAssemblyContext, parentSeries) || this;
|
|
56
|
+
_this.heatTextureCache = new TextureCache_1.TextureCache(webAssemblyContext);
|
|
57
|
+
_this.colorDataVector = new webAssemblyContext.UIntVector();
|
|
58
|
+
_this.onSeriesPropertyChange(constants_1.PROPERTY.DATA_SERIES);
|
|
59
|
+
_this.onSeriesPropertyChange(constants_1.PROPERTY.COLOR_MAP);
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
NonUniformHeatmapDrawingProvider.prototype.delete = function () {
|
|
66
|
+
this.colorDataVector = (0, Deleter_1.deleteSafe)(this.colorDataVector);
|
|
67
|
+
this.heatTextureCache = (0, Deleter_1.deleteSafe)(this.heatTextureCache);
|
|
68
|
+
_super.prototype.delete.call(this);
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
NonUniformHeatmapDrawingProvider.prototype.onSeriesPropertyChange = function (propertyName) {
|
|
74
|
+
var recreateGradientColorScale =
|
|
75
|
+
// TODO this handles data updating using setZValue, consider invalidating colorData cache instead
|
|
76
|
+
propertyName === constants_1.PROPERTY.DATA_SERIES ||
|
|
77
|
+
propertyName === constants_1.PROPERTY.COLOR_MAP ||
|
|
78
|
+
propertyName.includes(BaseHeatmapRenderableSeries_1.COLOR_MAP_PREFIX) ||
|
|
79
|
+
propertyName === constants_1.PROPERTY.OPACITY;
|
|
80
|
+
if (recreateGradientColorScale) {
|
|
81
|
+
// TODO check case when colormap is passed via setter
|
|
82
|
+
this.colorGradientScale = createColorMap(this.parentSeries.colorMap.gradientStops, precision);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @inheritDoc
|
|
87
|
+
*/
|
|
88
|
+
NonUniformHeatmapDrawingProvider.prototype.draw = function (renderContext, renderPassData) {
|
|
89
|
+
var isVerticalChart = renderPassData.isVerticalChart;
|
|
90
|
+
var dataSeries = this.parentSeries.dataSeries;
|
|
91
|
+
var seriesViewRect = this.parentSeries.parentSurface.seriesViewRect;
|
|
92
|
+
var colorMap = this.parentSeries.colorMap;
|
|
93
|
+
var colorGradientScale = this.colorGradientScale;
|
|
94
|
+
var zValues = dataSeries.getZValues();
|
|
95
|
+
var xIndexRange = dataSeries.getXIndicesRange(new NumberRange_1.NumberRange(renderPassData.xCoordinateCalculator.visibleMin, renderPassData.xCoordinateCalculator.visibleMax), false);
|
|
96
|
+
var yIndexRange = dataSeries.getYIndicesRange(new NumberRange_1.NumberRange(renderPassData.yCoordinateCalculator.visibleMin, renderPassData.yCoordinateCalculator.visibleMax), false);
|
|
97
|
+
var xMinValue = dataSeries.getXValue(xIndexRange.min);
|
|
98
|
+
var xMaxValue = dataSeries.getXValue(xIndexRange.max);
|
|
99
|
+
var yMinValue = dataSeries.getYValue(yIndexRange.min);
|
|
100
|
+
var yMaxValue = dataSeries.getYValue(yIndexRange.max);
|
|
101
|
+
var isXFlipped = !renderPassData.xCoordinateCalculator.hasFlippedCoordinates;
|
|
102
|
+
var isYFlipped = renderPassData.yCoordinateCalculator.hasFlippedCoordinates;
|
|
103
|
+
var heatmapStartX = renderPassData.xCoordinateCalculator.getCoordinate(isXFlipped ? xMaxValue : xMinValue);
|
|
104
|
+
var heatmapEndX = renderPassData.xCoordinateCalculator.getCoordinate(isXFlipped ? xMinValue : xMaxValue);
|
|
105
|
+
var heatmapStartY = renderPassData.yCoordinateCalculator.getCoordinate(!isYFlipped ? yMaxValue : yMinValue);
|
|
106
|
+
var heatmapEndY = renderPassData.yCoordinateCalculator.getCoordinate(!isYFlipped ? yMinValue : yMaxValue);
|
|
107
|
+
// clipped size
|
|
108
|
+
var heatmapWidth = Math.ceil(Math.abs(heatmapStartX - heatmapEndX));
|
|
109
|
+
var heatmapHeight = Math.ceil(Math.abs(heatmapStartY - heatmapEndY));
|
|
110
|
+
var isOverflow = heatmapWidth <= 0 || heatmapHeight <= 0;
|
|
111
|
+
var isOutViewport = heatmapStartX > (isVerticalChart ? seriesViewRect.height : seriesViewRect.width) ||
|
|
112
|
+
heatmapStartY > (isVerticalChart ? seriesViewRect.width : seriesViewRect.height) ||
|
|
113
|
+
heatmapEndX < 0 ||
|
|
114
|
+
heatmapEndY < 0;
|
|
115
|
+
if (!isOutViewport && !isOverflow) {
|
|
116
|
+
var horCellRange = xIndexRange;
|
|
117
|
+
var vertCellRange = yIndexRange;
|
|
118
|
+
var horStartInd = isXFlipped ? horCellRange.max - 1 : horCellRange.min;
|
|
119
|
+
var vertStartInd = isYFlipped ? vertCellRange.min : vertCellRange.max - 1;
|
|
120
|
+
var horInc = isXFlipped ? -1 : 1;
|
|
121
|
+
var vertInc = isYFlipped ? 1 : -1;
|
|
122
|
+
if (isVerticalChart) {
|
|
123
|
+
horStartInd = !isXFlipped ? horCellRange.max - 1 : horCellRange.min;
|
|
124
|
+
horInc = !isXFlipped ? -1 : 1;
|
|
125
|
+
}
|
|
126
|
+
var horCellCount = horCellRange.diff;
|
|
127
|
+
var vertCellCount = vertCellRange.diff;
|
|
128
|
+
var nativeContext = renderContext.getNativeContext();
|
|
129
|
+
this.drawHeatmapInTypescript(nativeContext, dataSeries.xCellOffsets, dataSeries.yCellOffsets, zValues, renderPassData.xCoordinateCalculator, renderPassData.yCoordinateCalculator, {
|
|
130
|
+
horCellCount: horCellCount,
|
|
131
|
+
vertCellCount: vertCellCount,
|
|
132
|
+
arrayWidth: dataSeries.arrayWidth,
|
|
133
|
+
arrayHeight: dataSeries.arrayHeight,
|
|
134
|
+
opacity: this.parentSeries.opacity,
|
|
135
|
+
colorGradientScale: colorGradientScale,
|
|
136
|
+
colorMin: colorMap.minimum,
|
|
137
|
+
colorMax: colorMap.maximum,
|
|
138
|
+
horStartInd: horStartInd,
|
|
139
|
+
vertStartInd: vertStartInd,
|
|
140
|
+
horInc: horInc,
|
|
141
|
+
vertInc: vertInc,
|
|
142
|
+
isVerticalChart: isVerticalChart,
|
|
143
|
+
heatmapStartX: heatmapStartX,
|
|
144
|
+
heatmapStartY: heatmapStartY,
|
|
145
|
+
heatmapWidth: heatmapWidth,
|
|
146
|
+
heatmapHeight: heatmapHeight,
|
|
147
|
+
// TS specific
|
|
148
|
+
xCellSizes: dataSeries.xCellSizes,
|
|
149
|
+
yCellSizes: dataSeries.yCellSizes,
|
|
150
|
+
seriesViewRect: seriesViewRect
|
|
151
|
+
});
|
|
152
|
+
// Draft code for porting to the native drawing provider
|
|
153
|
+
// const nativeZValues = new this.webAssemblyContext.SCRTDoubleVector();
|
|
154
|
+
// const flattenedZValues = ([] as number[]).concat.apply([], zValues);
|
|
155
|
+
// appendDoubleVectorFromJsArray(this.webAssemblyContext, nativeZValues, flattenedZValues);
|
|
156
|
+
// this.drawHeatmapNative(
|
|
157
|
+
// nativeContext,
|
|
158
|
+
// nativeXOffsets,
|
|
159
|
+
// nativeYOffsets,
|
|
160
|
+
// nativeZValues,
|
|
161
|
+
// renderPassData.xCoordinateCalculator,
|
|
162
|
+
// renderPassData.yCoordinateCalculator,
|
|
163
|
+
// {
|
|
164
|
+
// _horCellCount,
|
|
165
|
+
// _vertCellCount,
|
|
166
|
+
// arrayWidth: dataSeries.arrayWidth,
|
|
167
|
+
// arrayHeight: dataSeries.arrayHeight,
|
|
168
|
+
// _horCellOffsets,
|
|
169
|
+
// _vertCellOffsets,
|
|
170
|
+
// opacity: this.parentSeries.opacity,
|
|
171
|
+
// colorGradientScale,
|
|
172
|
+
// colorMin: colorMap.minimum,
|
|
173
|
+
// colorMax: colorMap.maximum,
|
|
174
|
+
// _horStartInd,
|
|
175
|
+
// _vertStartInd,
|
|
176
|
+
// _horInc,
|
|
177
|
+
// _vertInc,
|
|
178
|
+
// isVerticalChart,
|
|
179
|
+
// }
|
|
180
|
+
// );
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
NonUniformHeatmapDrawingProvider.prototype.drawHeatmapInTypescript = function (nativeContext, xSpacings, ySpacings, zValues, xCalc, yCalc, params) {
|
|
184
|
+
// create color data from zValues
|
|
185
|
+
// create texture and fill it with pixel color data based on spacings
|
|
186
|
+
var horStartInd = params.horStartInd, horInc = params.horInc, vertStartInd = params.vertStartInd, vertInc = params.vertInc, horCellCount = params.horCellCount, vertCellCount = params.vertCellCount, heatmapStartX = params.heatmapStartX, heatmapStartY = params.heatmapStartY, heatmapWidth = params.heatmapWidth, heatmapHeight = params.heatmapHeight, opacity = params.opacity, colorGradientScale = params.colorGradientScale, colorMin = params.colorMin, colorMax = params.colorMax, isVerticalChart = params.isVerticalChart, arrayWidth = params.arrayWidth, arrayHeight = params.arrayHeight, xCellSizes = params.xCellSizes, yCellSizes = params.yCellSizes, seriesViewRect = params.seriesViewRect;
|
|
187
|
+
var seriesXRangeMin = xSpacings[0];
|
|
188
|
+
var seriesXRangeMax = xSpacings[xSpacings.length - 1];
|
|
189
|
+
var seriesYRangeMin = ySpacings[0];
|
|
190
|
+
var seriesYRangeMax = ySpacings[ySpacings.length - 1];
|
|
191
|
+
var xMinValue = Math.max(seriesXRangeMin, xCalc.visibleMin);
|
|
192
|
+
var xMaxValue = Math.min(seriesXRangeMax, xCalc.visibleMax);
|
|
193
|
+
var yMinValue = Math.max(seriesYRangeMin, yCalc.visibleMin);
|
|
194
|
+
var yMaxValue = Math.min(seriesYRangeMax, yCalc.visibleMax);
|
|
195
|
+
var hasFlippedX = !xCalc.hasFlippedCoordinates;
|
|
196
|
+
var hasFlippedY = yCalc.hasFlippedCoordinates;
|
|
197
|
+
var xMinCoordinate = xCalc.getCoordinate(hasFlippedX ? xMaxValue : xMinValue);
|
|
198
|
+
var xMaxCoordinate = xCalc.getCoordinate(hasFlippedX ? xMinValue : xMaxValue);
|
|
199
|
+
var yMinCoordinate = yCalc.getCoordinate(hasFlippedY ? yMaxValue : yMinValue);
|
|
200
|
+
var yMaxCoordinate = yCalc.getCoordinate(hasFlippedY ? yMinValue : yMaxValue);
|
|
201
|
+
var visibleTextureWidth = Math.ceil(Math.abs(xMinCoordinate - xMaxCoordinate));
|
|
202
|
+
var visibleTextureHeight = Math.ceil(Math.abs(yMinCoordinate - yMaxCoordinate));
|
|
203
|
+
var heatmapRect = new Rect_1.Rect(heatmapStartX, heatmapStartY, heatmapWidth, heatmapHeight);
|
|
204
|
+
// calculates cell offsets in pixels from cell sizes
|
|
205
|
+
var _a = calculateOffsets(heatmapRect, isVerticalChart, xCellSizes, yCellSizes, horStartInd, horCellCount, horInc, vertStartInd, vertCellCount, vertInc, seriesViewRect), horCellOffsets = _a.horCellOffsets, vertCellOffsets = _a.vertCellOffsets;
|
|
206
|
+
var texture = this.calculateHeatmapTexture({
|
|
207
|
+
xStartInd: horStartInd,
|
|
208
|
+
textureWidth: visibleTextureWidth,
|
|
209
|
+
xInc: horInc,
|
|
210
|
+
yStartInd: vertStartInd,
|
|
211
|
+
textureHeight: visibleTextureHeight,
|
|
212
|
+
yInc: vertInc,
|
|
213
|
+
zValues: zValues,
|
|
214
|
+
webAssemblyContext: this.webAssemblyContext,
|
|
215
|
+
colorMap: colorGradientScale,
|
|
216
|
+
opacity: opacity,
|
|
217
|
+
horCellCount: horCellCount,
|
|
218
|
+
vertCellCount: vertCellCount,
|
|
219
|
+
horCellOffsets: horCellOffsets,
|
|
220
|
+
vertCellOffsets: vertCellOffsets,
|
|
221
|
+
colorMin: colorMin,
|
|
222
|
+
colorMax: colorMax,
|
|
223
|
+
arrayWidth: arrayWidth,
|
|
224
|
+
arrayHeight: arrayHeight,
|
|
225
|
+
fillValuesOutOfRange: this.parentSeries.fillValuesOutOfRange,
|
|
226
|
+
useInterpolation: this.parentSeries.useLinearTextureFiltering
|
|
227
|
+
});
|
|
228
|
+
if (isVerticalChart) {
|
|
229
|
+
nativeContext.PushMatrix();
|
|
230
|
+
nativeContext.PushState();
|
|
231
|
+
nativeContext.Rotate(-90);
|
|
232
|
+
var xTrans = hasFlippedX ? -xMinCoordinate : -visibleTextureWidth - xMinCoordinate;
|
|
233
|
+
nativeContext.Translate(xTrans, 0);
|
|
234
|
+
var x = hasFlippedX ? 0 : visibleTextureWidth;
|
|
235
|
+
var width = hasFlippedX ? visibleTextureWidth : 0;
|
|
236
|
+
var y = yMinCoordinate;
|
|
237
|
+
var height = yMaxCoordinate;
|
|
238
|
+
nativeContext.DrawTexture(texture, x - visibleTextureWidth, y - visibleTextureHeight, visibleTextureWidth, visibleTextureHeight);
|
|
239
|
+
// Uniform Heatmap approach
|
|
240
|
+
// nativeContext.DrawTexture(texture, x, y, width, height);
|
|
241
|
+
nativeContext.PopMatrix();
|
|
242
|
+
nativeContext.PopState();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
// TODO figure out why yMaxCoordinate is used here
|
|
246
|
+
nativeContext.DrawTexture(texture, xMinCoordinate, yMaxCoordinate, visibleTextureWidth, visibleTextureHeight);
|
|
247
|
+
};
|
|
248
|
+
// TODO probably this is overcomplicated
|
|
249
|
+
NonUniformHeatmapDrawingProvider.prototype.calculateHeatmapTexture = function (colorDataParams) {
|
|
250
|
+
if (!this.getMemoizedHeatmapTexture) {
|
|
251
|
+
// checks if arguments have changed by value/reference equality for each argument
|
|
252
|
+
// except horizontal and vertical offsets, where arrays are compared per value
|
|
253
|
+
var customCompare = function (_a, _b) {
|
|
254
|
+
var _c = _a, _d = _c[0], currentHorCellOffsets = _d.horCellOffsets, currVertCellOffsets = _d.vertCellOffsets, restCurrArgs = __rest(_d, ["horCellOffsets", "vertCellOffsets"]);
|
|
255
|
+
var _e = _b[0], prevHorCellOffsets = _e.horCellOffsets, prevVertCellOffsets = _e.vertCellOffsets, restPrevArgs = __rest(_e, ["horCellOffsets", "vertCellOffsets"]);
|
|
256
|
+
return (areArraysEqual(Object.values(restCurrArgs), Object.values(restPrevArgs)) &&
|
|
257
|
+
areArraysEqual(currentHorCellOffsets, prevHorCellOffsets) &&
|
|
258
|
+
areArraysEqual(currVertCellOffsets, prevVertCellOffsets));
|
|
259
|
+
};
|
|
260
|
+
this.getMemoizedHeatmapTexture = (0, memoize_1.memoize)(calculateHeatmapTexture, customCompare);
|
|
261
|
+
}
|
|
262
|
+
var areArraysEqual = function (arr1, arr2) {
|
|
263
|
+
return !arr1.some(function (value, index) { return value !== arr2[index]; });
|
|
264
|
+
};
|
|
265
|
+
return this.getMemoizedHeatmapTexture(colorDataParams, this.colorDataVector, this.heatTextureCache);
|
|
266
|
+
};
|
|
267
|
+
return NonUniformHeatmapDrawingProvider;
|
|
268
|
+
}(BaseSeriesDrawingProvider_1.BaseSeriesDrawingProvider));
|
|
269
|
+
exports.NonUniformHeatmapDrawingProvider = NonUniformHeatmapDrawingProvider;
|
|
270
|
+
var getColorDataForTexture = function (params, _colorData) {
|
|
271
|
+
var xStartInd = params.xStartInd, textureWidth = params.textureWidth, xInc = params.xInc, yStartInd = params.yStartInd, textureHeight = params.textureHeight, yInc = params.yInc, zValues = params.zValues, webAssemblyContext = params.webAssemblyContext, colorMap = params.colorMap, opacity = params.opacity, horCellCount = params.horCellCount, vertCellCount = params.vertCellCount, horCellOffsets = params.horCellOffsets, vertCellOffsets = params.vertCellOffsets, colorMin = params.colorMin, colorMax = params.colorMax, arrayWidth = params.arrayWidth, arrayHeight = params.arrayHeight, fillValuesOutOfRange = params.fillValuesOutOfRange;
|
|
272
|
+
// const _colorData = new webAssemblyContext.UIntVector();
|
|
273
|
+
_colorData.resize(textureWidth * textureHeight, 0);
|
|
274
|
+
// const _colorData = Array.from(Array(textureWidth * textureHeight));
|
|
275
|
+
var yOffsetInd = 0;
|
|
276
|
+
var yCellEnd = vertCellOffsets[yOffsetInd];
|
|
277
|
+
var cachedColors = new Array(horCellCount);
|
|
278
|
+
var hasCachedColors = false;
|
|
279
|
+
var xCellIndex = xStartInd;
|
|
280
|
+
var yCellIndex = yStartInd;
|
|
281
|
+
var color;
|
|
282
|
+
for (var y = 0; y < textureHeight; y++) {
|
|
283
|
+
var xOffsetInd = 0;
|
|
284
|
+
var xCellEnd = horCellOffsets[xOffsetInd];
|
|
285
|
+
if (y > yCellEnd) {
|
|
286
|
+
// New cell - need to refill the cache
|
|
287
|
+
hasCachedColors = false;
|
|
288
|
+
// Get the end coord of the next cell and a color for it
|
|
289
|
+
yOffsetInd++;
|
|
290
|
+
yCellEnd = vertCellOffsets[yOffsetInd];
|
|
291
|
+
// If yCellEnd falls inside a pixel, reiterate and get the next color
|
|
292
|
+
var yDiff = y - yCellEnd;
|
|
293
|
+
if (yDiff > Number.EPSILON && Math.floor(yCellEnd) + 1 === y) {
|
|
294
|
+
y--;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (hasCachedColors) {
|
|
299
|
+
// Get color cached on previous iteration
|
|
300
|
+
color = cachedColors[xOffsetInd];
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
xCellIndex = xStartInd + xOffsetInd * xInc;
|
|
304
|
+
yCellIndex = yStartInd + yOffsetInd * yInc;
|
|
305
|
+
color = getColor(yCellIndex, xCellIndex, colorMap, opacity, zValues, webAssemblyContext, colorMin, colorMax, arrayWidth, arrayHeight, fillValuesOutOfRange);
|
|
306
|
+
// New cell - refill the cache
|
|
307
|
+
cachedColors[xOffsetInd] = color;
|
|
308
|
+
}
|
|
309
|
+
for (var x = 0; x < textureWidth; x++) {
|
|
310
|
+
if (x > xCellEnd) {
|
|
311
|
+
// Get the end coord of the next cell and a color for it
|
|
312
|
+
xOffsetInd++;
|
|
313
|
+
xCellEnd = horCellOffsets[xOffsetInd];
|
|
314
|
+
// If xCellEnd falls inside a pixel, reiterate and get the next color
|
|
315
|
+
var xDiff = x - xCellEnd;
|
|
316
|
+
if (xDiff > Number.EPSILON && Math.floor(xCellEnd) + 1 === x) {
|
|
317
|
+
x--;
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
if (hasCachedColors) {
|
|
321
|
+
// Get color cached on previous iteration
|
|
322
|
+
color = cachedColors[xOffsetInd];
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
xCellIndex = xStartInd + xOffsetInd * xInc;
|
|
326
|
+
color = getColor(yCellIndex, xCellIndex, colorMap, opacity, zValues, webAssemblyContext, colorMin, colorMax, arrayWidth, arrayHeight, fillValuesOutOfRange);
|
|
327
|
+
cachedColors[xOffsetInd] = color;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// Fill a texture pixel
|
|
331
|
+
// _colorData[y * textureWidth + x] = color;
|
|
332
|
+
_colorData.set(y * textureWidth + x, color);
|
|
333
|
+
}
|
|
334
|
+
hasCachedColors = true;
|
|
335
|
+
}
|
|
336
|
+
return _colorData;
|
|
337
|
+
};
|
|
338
|
+
var getColor = function (yIndex, xIndex, colorPalette, opacity,
|
|
339
|
+
// zValues: SCRTDoubleVector,
|
|
340
|
+
zValues, webAssemblyContext, colorMin, colorMax, arrayWidth, arrayHeight, fillValuesOutOfRange) {
|
|
341
|
+
// TODO is this check needed?
|
|
342
|
+
if (yIndex >= arrayHeight || xIndex >= arrayWidth) {
|
|
343
|
+
// transparent
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
// const zValue = zValues.get(yIndex * arrayWidth + xIndex);
|
|
347
|
+
var zValue = zValues[yIndex][xIndex];
|
|
348
|
+
var cellColor = getCellColor(zValue, colorPalette, colorMin, colorMax, fillValuesOutOfRange, webAssemblyContext);
|
|
349
|
+
return (0, colorUtil_1.uintArgbColorMultiplyOpacity)(cellColor, opacity);
|
|
350
|
+
};
|
|
351
|
+
/** @ignore */
|
|
352
|
+
var getCellColor = function (value, _colorMap, colorMin, colorMax, fillValuesOutOfRange, webAssemblyContext) {
|
|
353
|
+
if (isNaN(value)) {
|
|
354
|
+
// transparent
|
|
355
|
+
return 0;
|
|
356
|
+
}
|
|
357
|
+
// comment from the original C# code
|
|
358
|
+
// TODO move this to DataSeries.GetZAsDoubles(min, max) to avoid it here
|
|
359
|
+
if (fillValuesOutOfRange) {
|
|
360
|
+
// Clip to ColorMap.Min, Max
|
|
361
|
+
value = value < colorMin ? colorMin : value;
|
|
362
|
+
value = value > colorMax ? colorMax : value;
|
|
363
|
+
}
|
|
364
|
+
else if (value < colorMin || value > colorMax) {
|
|
365
|
+
// transparent
|
|
366
|
+
return 0;
|
|
367
|
+
}
|
|
368
|
+
var _scaleFactor = (precision - 1) / Math.abs(colorMax - colorMin);
|
|
369
|
+
var colorMapValue = (value - colorMin) * _scaleFactor;
|
|
370
|
+
// Round to the nearest integer
|
|
371
|
+
var colorIndex = Math.floor(colorMapValue + Math.sign(value) * 0.5);
|
|
372
|
+
colorIndex = webAssemblyContext.NumberUtil.Constrain(colorIndex, 0, _colorMap.length - 1);
|
|
373
|
+
return _colorMap[colorIndex];
|
|
374
|
+
};
|
|
375
|
+
// TODO configure precision
|
|
376
|
+
var createColorMap = function (gradientStops, precision) {
|
|
377
|
+
var colorMap = Array.from(Array(precision));
|
|
378
|
+
var count = gradientStops.length;
|
|
379
|
+
var first = gradientStops[0].offset;
|
|
380
|
+
var last = gradientStops[gradientStops.length - 1].offset;
|
|
381
|
+
var diff = last - first;
|
|
382
|
+
var change = diff / (precision - 1);
|
|
383
|
+
// let prevColor = ApplyOpacity(gradientStops[0].color, _opacity);
|
|
384
|
+
var prevColor = gradientStops[0].color;
|
|
385
|
+
var prevOffset = gradientStops[0].offset;
|
|
386
|
+
var nextColor = prevColor;
|
|
387
|
+
var nextOffset = prevOffset;
|
|
388
|
+
if (count > 1) {
|
|
389
|
+
// nextColor = ApplyOpacity(gradientStops[1].color, _opacity);
|
|
390
|
+
nextColor = gradientStops[1].color;
|
|
391
|
+
nextOffset = gradientStops[1].offset;
|
|
392
|
+
}
|
|
393
|
+
diff = nextOffset - prevOffset;
|
|
394
|
+
var offsetInd = 0;
|
|
395
|
+
for (var i = 0; i < precision; ++i) {
|
|
396
|
+
var offset = first + i * change;
|
|
397
|
+
if (offset >= nextOffset) {
|
|
398
|
+
offsetInd++;
|
|
399
|
+
prevOffset = nextOffset;
|
|
400
|
+
prevColor = nextColor;
|
|
401
|
+
if (offsetInd + 1 < count) {
|
|
402
|
+
// nextColor = ApplyOpacity(gradientStops[offsetInd + 1].color, _opacity);
|
|
403
|
+
nextColor = gradientStops[offsetInd + 1].color;
|
|
404
|
+
nextOffset = gradientStops[offsetInd + 1].offset;
|
|
405
|
+
}
|
|
406
|
+
diff = nextOffset - prevOffset;
|
|
407
|
+
}
|
|
408
|
+
var color = void 0;
|
|
409
|
+
if (prevColor === nextColor || diff <= Number.EPSILON) {
|
|
410
|
+
color = Number.parseInt((0, parseColor_1.parseColorToHexStringArgb)(nextColor), 16);
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
var coef = (offset - prevOffset) / diff;
|
|
414
|
+
color = getInterpolatedColor(prevColor, nextColor, coef);
|
|
415
|
+
}
|
|
416
|
+
colorMap[i] = color;
|
|
417
|
+
}
|
|
418
|
+
return colorMap;
|
|
419
|
+
};
|
|
420
|
+
var getInterpolatedColor = function (htmlColor1, htmlColor2, coef) {
|
|
421
|
+
var color1 = (0, parseColor_1.parseColorToTArgb)(htmlColor1);
|
|
422
|
+
var color2 = (0, parseColor_1.parseColorToTArgb)(htmlColor2);
|
|
423
|
+
var a1 = color1.opacity;
|
|
424
|
+
var a2 = color2.opacity;
|
|
425
|
+
var r1 = color1.red;
|
|
426
|
+
var r2 = color2.red;
|
|
427
|
+
var g1 = color1.green;
|
|
428
|
+
var g2 = color2.green;
|
|
429
|
+
var b1 = color1.blue;
|
|
430
|
+
var b2 = color2.blue;
|
|
431
|
+
var r = r1 + Math.floor((r2 - r1) * coef);
|
|
432
|
+
var g = g1 + Math.floor((g2 - g1) * coef);
|
|
433
|
+
var b = b1 + Math.floor((b2 - b1) * coef);
|
|
434
|
+
var a = a1 + Math.floor((a2 - a1) * coef);
|
|
435
|
+
return Number.parseInt("0x" + (0, parseColor_1.toHex)(a) + (0, parseColor_1.toHex)(r) + (0, parseColor_1.toHex)(g) + (0, parseColor_1.toHex)(b), 16);
|
|
436
|
+
// return (a << 24) | (r << 16) | (g << 8) | b;
|
|
437
|
+
};
|
|
438
|
+
var calculateOffsets = function (heatmapRect, isVerticalChart, xCellSizes, yCellSizes, horStartInd, horCellCount, horInc, vertStartInd, vertCellCount, vertInc, seriesViewRect) {
|
|
439
|
+
// TODO can be optimized - no need to recalculate these offsets at every redraw
|
|
440
|
+
// TODO can be optimized for large heatmaps - skip cells that
|
|
441
|
+
// falls within a single pixel & count them for the iteration in ComputeColorMap()
|
|
442
|
+
// Find heatmap cells positions
|
|
443
|
+
var offsetX = heatmapRect.left < 0 ? -heatmapRect.left : 0;
|
|
444
|
+
var offsetY = heatmapRect.top < 0 ? -heatmapRect.top : 0;
|
|
445
|
+
if (isVerticalChart) {
|
|
446
|
+
// consider that heatmap texture is rotated
|
|
447
|
+
offsetX = heatmapRect.right > seriesViewRect.bottom ? heatmapRect.right - seriesViewRect.bottom : 0;
|
|
448
|
+
}
|
|
449
|
+
// Horizontal offsets == X offsets on texture, vertical offsets == Y offsets on texture
|
|
450
|
+
var horCellOffsets = calculateCellCoordinates(xCellSizes, heatmapRect.width, horStartInd, horCellCount, horInc, -offsetX);
|
|
451
|
+
var vertCellOffsets = calculateCellCoordinates(yCellSizes, heatmapRect.height, vertStartInd, vertCellCount, vertInc, -offsetY);
|
|
452
|
+
return { horCellOffsets: horCellOffsets, vertCellOffsets: vertCellOffsets };
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* Calculates absolute coordinates of the heatmap cells
|
|
456
|
+
* @param inputArr relative cell sizes
|
|
457
|
+
* @param dimension texture size
|
|
458
|
+
* @param startInd
|
|
459
|
+
* @param count
|
|
460
|
+
* @param inc
|
|
461
|
+
* @param offset
|
|
462
|
+
* @returns
|
|
463
|
+
*/
|
|
464
|
+
var calculateCellCoordinates = function (inputArr, dimension, startInd, count, inc, offset) {
|
|
465
|
+
// Find a stretch coef
|
|
466
|
+
var sum = 0;
|
|
467
|
+
var ind = startInd;
|
|
468
|
+
for (var i = 0; i < count; i++, ind += inc) {
|
|
469
|
+
sum += inputArr[ind];
|
|
470
|
+
}
|
|
471
|
+
var coef = 1 / sum;
|
|
472
|
+
var offsets = new Array(count);
|
|
473
|
+
var length = offset;
|
|
474
|
+
for (var i = 0; i < count - 1; i++) {
|
|
475
|
+
var index = i * inc + startInd;
|
|
476
|
+
var cellSize = inputArr[index] * coef * dimension;
|
|
477
|
+
length = length + cellSize;
|
|
478
|
+
offsets[i] = length;
|
|
479
|
+
}
|
|
480
|
+
offsets[count - 1] = dimension + offset;
|
|
481
|
+
return offsets;
|
|
482
|
+
};
|
|
483
|
+
var calculateHeatmapTexture = function (colorDataParams, intVector, heatTextureCache) {
|
|
484
|
+
var textureWidth = colorDataParams.textureWidth, textureHeight = colorDataParams.textureHeight, webAssemblyContext = colorDataParams.webAssemblyContext, useInterpolation = colorDataParams.useInterpolation;
|
|
485
|
+
// calculate colors from zValues
|
|
486
|
+
// per pixel colors
|
|
487
|
+
var colorArray = getColorDataForTexture(colorDataParams, intVector);
|
|
488
|
+
// create and fill texture
|
|
489
|
+
var texture = heatTextureCache.create(textureWidth, textureHeight, webAssemblyContext.eTSRTextureFormat.TSR_TEXTUREFORMAT_A8B8G8R8);
|
|
490
|
+
webAssemblyContext.SCRTSetTextureLinearSamplerEnabled(texture, useInterpolation);
|
|
491
|
+
webAssemblyContext.SCRTFillTextureAbgr(texture, textureWidth, textureHeight, colorArray);
|
|
492
|
+
return texture;
|
|
493
|
+
};
|
|
@@ -3,6 +3,7 @@ import { WebGlRenderContext2D } from "../../../Drawing/WebGlRenderContext2D";
|
|
|
3
3
|
import { IPointMetadata } from "../../../Model/IPointMetadata";
|
|
4
4
|
import { IPointSeries } from "../../../Model/PointSeries/IPointSeries";
|
|
5
5
|
import { RenderPassData } from "../../../Services/RenderPassData";
|
|
6
|
+
import { IPointMarker } from "../../PointMarkers/IPointMarker";
|
|
6
7
|
import { IRenderableSeries } from "../IRenderableSeries";
|
|
7
8
|
import { ISpline } from "../ISpline";
|
|
8
9
|
import { BaseSeriesDrawingProvider } from "./BaseSeriesDrawingProvider";
|
|
@@ -12,7 +13,6 @@ import { BaseSeriesDrawingProvider } from "./BaseSeriesDrawingProvider";
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class PointMarkerDrawingProvider extends BaseSeriesDrawingProvider<IRenderableSeries> {
|
|
14
15
|
private nativeDrawingProvider;
|
|
15
|
-
private ySelector;
|
|
16
16
|
private ySplineValuesSelector;
|
|
17
17
|
private xAnimationPointMarkerValues;
|
|
18
18
|
private yAnimationPointMarkerValues;
|
|
@@ -25,11 +25,14 @@ export declare class PointMarkerDrawingProvider extends BaseSeriesDrawingProvide
|
|
|
25
25
|
* @param ySelector an optional Y-selector for choosing which y-values to use for drawing points
|
|
26
26
|
* @param ySplineSelector an optional selector for choosing which y-animation values to use for drawing points
|
|
27
27
|
*/
|
|
28
|
-
constructor(webAssemblyContext: TSciChart, parentSeries: IRenderableSeries, ySelector?: (ps: IPointSeries) => SCRTDoubleVector, ySplineSelector?: (rs: ISpline) => SCRTDoubleVector);
|
|
28
|
+
constructor(webAssemblyContext: TSciChart, parentSeries: IRenderableSeries, ySelector?: (ps: IPointSeries) => SCRTDoubleVector, ySplineSelector?: (rs: ISpline) => SCRTDoubleVector, xSelector?: (ps: IPointSeries) => SCRTDoubleVector);
|
|
29
29
|
/**
|
|
30
30
|
* @inheritDoc
|
|
31
31
|
*/
|
|
32
32
|
onSeriesPropertyChange(propertyName: string): void;
|
|
33
|
+
getProperties(parentSeries: IRenderableSeries): {
|
|
34
|
+
pointMarker?: IPointMarker;
|
|
35
|
+
};
|
|
33
36
|
/**
|
|
34
37
|
* @inheritDoc
|
|
35
38
|
*/
|