@nativescript-community/ui-chart 2.0.7 → 2.0.11
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/animation/ChartAnimator.d.ts +61 -0
- package/animation/ChartAnimator.js +95 -0
- package/animation/ChartAnimator.js.map +1 -0
- package/animation/Tween.d.ts +4 -0
- package/animation/Tween.js +25 -0
- package/animation/Tween.js.map +1 -0
- package/buffer/AbstractBuffer.d.ts +40 -0
- package/buffer/AbstractBuffer.js +49 -0
- package/buffer/AbstractBuffer.js.map +1 -0
- package/buffer/BarBuffer.d.ts +15 -0
- package/buffer/BarBuffer.js +109 -0
- package/buffer/BarBuffer.js.map +1 -0
- package/buffer/HorizontalBarBuffer.d.ts +6 -0
- package/buffer/HorizontalBarBuffer.js +81 -0
- package/buffer/HorizontalBarBuffer.js.map +1 -0
- package/charts/BarChart.d.ts +96 -0
- package/charts/BarChart.js +143 -0
- package/charts/BarChart.js.map +1 -0
- package/charts/BarLineChartBase.d.ts +583 -0
- package/charts/BarLineChartBase.js +1231 -0
- package/charts/BarLineChartBase.js.map +1 -0
- package/charts/BubbleChart.d.ts +27 -0
- package/charts/BubbleChart.js +20 -0
- package/charts/BubbleChart.js.map +1 -0
- package/charts/CandleStickChart.d.ts +29 -0
- package/charts/CandleStickChart.js +19 -0
- package/charts/CandleStickChart.js.map +1 -0
- package/charts/Chart.d.ts +498 -0
- package/charts/Chart.js +799 -0
- package/charts/Chart.js.map +1 -0
- package/charts/CombinedChart.d.ts +78 -0
- package/charts/CombinedChart.js +119 -0
- package/charts/CombinedChart.js.map +1 -0
- package/charts/HorizontalBarChart.d.ts +54 -0
- package/charts/HorizontalBarChart.js +180 -0
- package/charts/HorizontalBarChart.js.map +1 -0
- package/charts/LineChart.d.ts +20 -0
- package/charts/LineChart.js +19 -0
- package/charts/LineChart.js.map +1 -0
- package/charts/PieChart.d.ts +247 -0
- package/charts/PieChart.js +453 -0
- package/charts/PieChart.js.map +1 -0
- package/charts/PieRadarChartBase.d.ts +130 -0
- package/charts/PieRadarChartBase.js +360 -0
- package/charts/PieRadarChartBase.js.map +1 -0
- package/charts/RadarChart.d.ts +101 -0
- package/charts/RadarChart.js +172 -0
- package/charts/RadarChart.js.map +1 -0
- package/charts/ScatterChart.d.ts +36 -0
- package/charts/ScatterChart.js +31 -0
- package/charts/ScatterChart.js.map +1 -0
- package/charts/index.d.ts +9 -0
- package/charts/index.js +10 -0
- package/charts/index.js.map +1 -0
- package/components/AxisBase.d.ts +299 -0
- package/components/AxisBase.js +352 -0
- package/components/AxisBase.js.map +1 -0
- package/components/ComponentBase.d.ts +60 -0
- package/components/ComponentBase.js +77 -0
- package/components/ComponentBase.js.map +1 -0
- package/components/Description.d.ts +22 -0
- package/components/Description.js +21 -0
- package/components/Description.js.map +1 -0
- package/components/IMarker.d.ts +39 -0
- package/components/IMarker.js +2 -0
- package/components/IMarker.js.map +1 -0
- package/components/Legend.d.ts +198 -0
- package/components/Legend.js +386 -0
- package/components/Legend.js.map +1 -0
- package/components/LegendEntry.d.ts +50 -0
- package/components/LegendEntry.js +51 -0
- package/components/LegendEntry.js.map +1 -0
- package/components/LimitLine.d.ts +55 -0
- package/components/LimitLine.js +62 -0
- package/components/LimitLine.js.map +1 -0
- package/components/MarkerImage.d.ts +1 -0
- package/components/MarkerImage.js +97 -0
- package/components/MarkerImage.js.map +1 -0
- package/components/XAxis.d.ts +55 -0
- package/components/XAxis.js +59 -0
- package/components/XAxis.js.map +1 -0
- package/components/YAxis.d.ts +135 -0
- package/components/YAxis.js +205 -0
- package/components/YAxis.js.map +1 -0
- package/data/BarData.d.ts +39 -0
- package/data/BarData.js +126 -0
- package/data/BarData.js.map +1 -0
- package/data/BarDataSet.d.ts +47 -0
- package/data/BarDataSet.js +109 -0
- package/data/BarDataSet.js.map +1 -0
- package/data/BarEntry.d.ts +11 -0
- package/data/BarEntry.js +2 -0
- package/data/BarEntry.js.map +1 -0
- package/data/BarLineScatterCandleBubbleData.d.ts +10 -0
- package/data/BarLineScatterCandleBubbleData.js +9 -0
- package/data/BarLineScatterCandleBubbleData.js.map +1 -0
- package/data/BarLineScatterCandleBubbleDataSet.d.ts +17 -0
- package/data/BarLineScatterCandleBubbleDataSet.js +18 -0
- package/data/BarLineScatterCandleBubbleDataSet.js.map +1 -0
- package/data/BaseDataSet.d.ts +180 -0
- package/data/BaseDataSet.js +220 -0
- package/data/BaseDataSet.js.map +1 -0
- package/data/BaseEntry.d.ts +10 -0
- package/data/BaseEntry.js +2 -0
- package/data/BaseEntry.js.map +1 -0
- package/data/BubbleData.d.ts +12 -0
- package/data/BubbleData.js +15 -0
- package/data/BubbleData.js.map +1 -0
- package/data/BubbleDataSet.d.ts +18 -0
- package/data/BubbleDataSet.js +36 -0
- package/data/BubbleDataSet.js.map +1 -0
- package/data/BubbleEntry.d.ts +5 -0
- package/data/BubbleEntry.js +2 -0
- package/data/BubbleEntry.js.map +1 -0
- package/data/CandleData.d.ts +5 -0
- package/data/CandleData.js +4 -0
- package/data/CandleData.js.map +1 -0
- package/data/CandleDataSet.d.ts +76 -0
- package/data/CandleDataSet.js +116 -0
- package/data/CandleDataSet.js.map +1 -0
- package/data/CandleEntry.d.ts +11 -0
- package/data/CandleEntry.js +2 -0
- package/data/CandleEntry.js.map +1 -0
- package/data/ChartData.d.ts +320 -0
- package/data/ChartData.js +702 -0
- package/data/ChartData.js.map +1 -0
- package/data/CombinedData.d.ts +61 -0
- package/data/CombinedData.js +153 -0
- package/data/CombinedData.js.map +1 -0
- package/data/DataSet.d.ts +98 -0
- package/data/DataSet.js +424 -0
- package/data/DataSet.js.map +1 -0
- package/data/Entry.d.ts +3 -0
- package/data/Entry.js +2 -0
- package/data/Entry.js.map +1 -0
- package/data/LineData.d.ts +10 -0
- package/data/LineData.js +9 -0
- package/data/LineData.js.map +1 -0
- package/data/LineDataSet.d.ts +106 -0
- package/data/LineDataSet.js +148 -0
- package/data/LineDataSet.js.map +1 -0
- package/data/LineRadarDataSet.d.ts +32 -0
- package/data/LineRadarDataSet.js +29 -0
- package/data/LineRadarDataSet.js.map +1 -0
- package/data/LineScatterCandleRadarDataSet.d.ts +36 -0
- package/data/LineScatterCandleRadarDataSet.js +44 -0
- package/data/LineScatterCandleRadarDataSet.js.map +1 -0
- package/data/PieData.d.ts +39 -0
- package/data/PieData.js +55 -0
- package/data/PieData.js.map +1 -0
- package/data/PieDataSet.d.ts +52 -0
- package/data/PieDataSet.js +54 -0
- package/data/PieDataSet.js.map +1 -0
- package/data/PieEntry.d.ts +7 -0
- package/data/PieEntry.js +2 -0
- package/data/PieEntry.js.map +1 -0
- package/data/RadarData.d.ts +17 -0
- package/data/RadarData.js +15 -0
- package/data/RadarData.js.map +1 -0
- package/data/RadarDataSet.d.ts +14 -0
- package/data/RadarDataSet.js +20 -0
- package/data/RadarDataSet.js.map +1 -0
- package/data/RadarEntry.d.ts +3 -0
- package/data/RadarEntry.js +2 -0
- package/data/RadarEntry.js.map +1 -0
- package/data/ScatterData.d.ts +9 -0
- package/data/ScatterData.js +17 -0
- package/data/ScatterData.js.map +1 -0
- package/data/ScatterDataSet.d.ts +40 -0
- package/data/ScatterDataSet.js +61 -0
- package/data/ScatterDataSet.js.map +1 -0
- package/formatter/DefaultAxisValueFormatter.d.ts +23 -0
- package/formatter/DefaultAxisValueFormatter.js +30 -0
- package/formatter/DefaultAxisValueFormatter.js.map +1 -0
- package/formatter/DefaultFillFormatter.d.ts +6 -0
- package/formatter/DefaultFillFormatter.js +29 -0
- package/formatter/DefaultFillFormatter.js.map +1 -0
- package/formatter/DefaultValueFormatter.d.ts +3 -0
- package/formatter/DefaultValueFormatter.js +4 -0
- package/formatter/DefaultValueFormatter.js.map +1 -0
- package/formatter/IAxisValueFormatter.d.ts +23 -0
- package/formatter/IAxisValueFormatter.js +2 -0
- package/formatter/IAxisValueFormatter.js.map +1 -0
- package/formatter/IFillFormatter.d.ts +30 -0
- package/formatter/IFillFormatter.js +2 -0
- package/formatter/IFillFormatter.js.map +1 -0
- package/formatter/IValueFormatter.d.ts +25 -0
- package/formatter/IValueFormatter.js +2 -0
- package/formatter/IValueFormatter.js.map +1 -0
- package/formatter/ValueFormatter.d.ts +81 -0
- package/formatter/ValueFormatter.js +90 -0
- package/formatter/ValueFormatter.js.map +1 -0
- package/highlight/BarHighlighter.d.ts +33 -0
- package/highlight/BarHighlighter.js +89 -0
- package/highlight/BarHighlighter.js.map +1 -0
- package/highlight/ChartHighlighter.d.ts +102 -0
- package/highlight/ChartHighlighter.js +220 -0
- package/highlight/ChartHighlighter.js.map +1 -0
- package/highlight/CombinedHighlighter.d.ts +17 -0
- package/highlight/CombinedHighlighter.js +59 -0
- package/highlight/CombinedHighlighter.js.map +1 -0
- package/highlight/Highlight.d.ts +69 -0
- package/highlight/Highlight.js +8 -0
- package/highlight/Highlight.js.map +1 -0
- package/highlight/HorizontalBarHighlighter.d.ts +10 -0
- package/highlight/HorizontalBarHighlighter.js +54 -0
- package/highlight/HorizontalBarHighlighter.js.map +1 -0
- package/highlight/IHighlighter.d.ts +15 -0
- package/highlight/IHighlighter.js +2 -0
- package/highlight/IHighlighter.js.map +1 -0
- package/highlight/PieHighlighter.d.ts +9 -0
- package/highlight/PieHighlighter.js +21 -0
- package/highlight/PieHighlighter.js.map +1 -0
- package/highlight/PieRadarHighlighter.d.ts +25 -0
- package/highlight/PieRadarHighlighter.js +33 -0
- package/highlight/PieRadarHighlighter.js.map +1 -0
- package/highlight/RadarHighlighter.d.ts +20 -0
- package/highlight/RadarHighlighter.js +59 -0
- package/highlight/RadarHighlighter.js.map +1 -0
- package/index.d.ts +11 -0
- package/index.js +15 -0
- package/index.js.map +1 -0
- package/interfaces/dataprovider/BarDataProvider.d.ts +9 -0
- package/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.d.ts +19 -0
- package/interfaces/dataprovider/BubbleDataProvider.d.ts +6 -0
- package/interfaces/dataprovider/CandleDataProvider.d.ts +6 -0
- package/interfaces/dataprovider/ChartInterface.d.ts +60 -0
- package/interfaces/dataprovider/CombinedDataProvider.d.ts +13 -0
- package/interfaces/dataprovider/LineDataProvider.d.ts +9 -0
- package/interfaces/dataprovider/ScatterDataProvider.d.ts +6 -0
- package/interfaces/datasets/IBarDataSet.d.ts +47 -0
- package/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.d.ts +12 -0
- package/interfaces/datasets/IBubbleDataSet.d.ts +19 -0
- package/interfaces/datasets/ICandleDataSet.d.ts +81 -0
- package/interfaces/datasets/IDataSet.d.ts +385 -0
- package/interfaces/datasets/ILineDataSet.d.ts +67 -0
- package/interfaces/datasets/ILineRadarDataSet.d.ts +35 -0
- package/interfaces/datasets/ILineScatterCandleRadarDataSet.d.ts +32 -0
- package/interfaces/datasets/IPieDataSet.d.ts +49 -0
- package/interfaces/datasets/IRadarDataSet.d.ts +21 -0
- package/interfaces/datasets/IScatterDataSet.d.ts +37 -0
- package/jobs/AnimatedMoveViewJob.d.ts +15 -0
- package/jobs/AnimatedMoveViewJob.js +42 -0
- package/jobs/AnimatedMoveViewJob.js.map +1 -0
- package/jobs/AnimatedViewPortJob.d.ts +31 -0
- package/jobs/AnimatedViewPortJob.js +52 -0
- package/jobs/AnimatedViewPortJob.js.map +1 -0
- package/jobs/AnimatedZoomJob.d.ts +23 -0
- package/jobs/AnimatedZoomJob.js +63 -0
- package/jobs/AnimatedZoomJob.js.map +1 -0
- package/jobs/MoveViewJob.d.ts +14 -0
- package/jobs/MoveViewJob.js +36 -0
- package/jobs/MoveViewJob.js.map +1 -0
- package/jobs/ViewPortJob.d.ts +13 -0
- package/jobs/ViewPortJob.js +14 -0
- package/jobs/ViewPortJob.js.map +1 -0
- package/jobs/ZoomJob.d.ts +15 -0
- package/jobs/ZoomJob.js +48 -0
- package/jobs/ZoomJob.js.map +1 -0
- package/listener/BarLineChartTouchListener.d.ts +187 -0
- package/listener/BarLineChartTouchListener.js +544 -0
- package/listener/BarLineChartTouchListener.js.map +1 -0
- package/listener/ChartTouchListener.d.ts +69 -0
- package/listener/ChartTouchListener.js +81 -0
- package/listener/ChartTouchListener.js.map +1 -0
- package/listener/PieRadarChartTouchListener.d.ts +100 -0
- package/listener/PieRadarChartTouchListener.js +282 -0
- package/listener/PieRadarChartTouchListener.js.map +1 -0
- package/model/GradientColor.d.ts +9 -0
- package/model/GradientColor.js +19 -0
- package/model/GradientColor.js.map +1 -0
- package/package.json +9 -2
- package/renderer/AxisRenderer.d.ts +103 -0
- package/renderer/AxisRenderer.js +215 -0
- package/renderer/AxisRenderer.js.map +1 -0
- package/renderer/BarChartRenderer.d.ts +40 -0
- package/renderer/BarChartRenderer.js +362 -0
- package/renderer/BarChartRenderer.js.map +1 -0
- package/renderer/BarLineScatterCandleBubbleRenderer.d.ts +57 -0
- package/renderer/BarLineScatterCandleBubbleRenderer.js +63 -0
- package/renderer/BarLineScatterCandleBubbleRenderer.js.map +1 -0
- package/renderer/BubbleChartRenderer.d.ts +22 -0
- package/renderer/BubbleChartRenderer.js +204 -0
- package/renderer/BubbleChartRenderer.js.map +1 -0
- package/renderer/CandleStickChartRenderer.d.ts +18 -0
- package/renderer/CandleStickChartRenderer.js +268 -0
- package/renderer/CandleStickChartRenderer.js.map +1 -0
- package/renderer/CombinedChartRenderer.d.ts +40 -0
- package/renderer/CombinedChartRenderer.js +133 -0
- package/renderer/CombinedChartRenderer.js.map +1 -0
- package/renderer/DataRenderer.d.ts +103 -0
- package/renderer/DataRenderer.js +110 -0
- package/renderer/DataRenderer.js.map +1 -0
- package/renderer/HorizontalBarChartRenderer.d.ts +20 -0
- package/renderer/HorizontalBarChartRenderer.js +303 -0
- package/renderer/HorizontalBarChartRenderer.js.map +1 -0
- package/renderer/LegendRenderer.d.ts +54 -0
- package/renderer/LegendRenderer.js +336 -0
- package/renderer/LegendRenderer.js.map +1 -0
- package/renderer/LineChartRenderer.d.ts +100 -0
- package/renderer/LineChartRenderer.js +745 -0
- package/renderer/LineChartRenderer.js.map +1 -0
- package/renderer/LineRadarRenderer.d.ts +30 -0
- package/renderer/LineRadarRenderer.js +76 -0
- package/renderer/LineRadarRenderer.js.map +1 -0
- package/renderer/LineScatterCandleRadarRenderer.d.ts +20 -0
- package/renderer/LineScatterCandleRadarRenderer.js +45 -0
- package/renderer/LineScatterCandleRadarRenderer.js.map +1 -0
- package/renderer/PieChartRenderer.d.ts +86 -0
- package/renderer/PieChartRenderer.js +714 -0
- package/renderer/PieChartRenderer.js.map +1 -0
- package/renderer/RadarChartRenderer.d.ts +33 -0
- package/renderer/RadarChartRenderer.js +290 -0
- package/renderer/RadarChartRenderer.js.map +1 -0
- package/renderer/Renderer.d.ts +13 -0
- package/renderer/Renderer.js +11 -0
- package/renderer/Renderer.js.map +1 -0
- package/renderer/ScatterChartRenderer.d.ts +16 -0
- package/renderer/ScatterChartRenderer.js +147 -0
- package/renderer/ScatterChartRenderer.js.map +1 -0
- package/renderer/XAxisRenderer.d.ts +58 -0
- package/renderer/XAxisRenderer.js +458 -0
- package/renderer/XAxisRenderer.js.map +1 -0
- package/renderer/XAxisRendererHorizontalBarChart.d.ts +31 -0
- package/renderer/XAxisRendererHorizontalBarChart.js +264 -0
- package/renderer/XAxisRendererHorizontalBarChart.js.map +1 -0
- package/renderer/XAxisRendererRadarChart.d.ts +17 -0
- package/renderer/XAxisRendererRadarChart.js +51 -0
- package/renderer/XAxisRendererRadarChart.js.map +1 -0
- package/renderer/YAxisRenderer.d.ts +60 -0
- package/renderer/YAxisRenderer.js +379 -0
- package/renderer/YAxisRenderer.js.map +1 -0
- package/renderer/YAxisRendererHorizontalBarChart.d.ts +33 -0
- package/renderer/YAxisRendererHorizontalBarChart.js +258 -0
- package/renderer/YAxisRendererHorizontalBarChart.js.map +1 -0
- package/renderer/YAxisRendererRadarChart.d.ts +14 -0
- package/renderer/YAxisRendererRadarChart.js +180 -0
- package/renderer/YAxisRendererRadarChart.js.map +1 -0
- package/renderer/scatter/ChevronDownShapeRenderer.d.ts +11 -0
- package/renderer/scatter/ChevronDownShapeRenderer.js +15 -0
- package/renderer/scatter/ChevronDownShapeRenderer.js.map +1 -0
- package/renderer/scatter/ChevronUpShapeRenderer.d.ts +11 -0
- package/renderer/scatter/ChevronUpShapeRenderer.js +15 -0
- package/renderer/scatter/ChevronUpShapeRenderer.js.map +1 -0
- package/renderer/scatter/CircleShapeRenderer.d.ts +11 -0
- package/renderer/scatter/CircleShapeRenderer.js +31 -0
- package/renderer/scatter/CircleShapeRenderer.js.map +1 -0
- package/renderer/scatter/CrossShapeRenderer.d.ts +11 -0
- package/renderer/scatter/CrossShapeRenderer.js +15 -0
- package/renderer/scatter/CrossShapeRenderer.js.map +1 -0
- package/renderer/scatter/IShapeRenderer.d.ts +20 -0
- package/renderer/scatter/IShapeRenderer.js +2 -0
- package/renderer/scatter/IShapeRenderer.js.map +1 -0
- package/renderer/scatter/SquareShapeRenderer.d.ts +11 -0
- package/renderer/scatter/SquareShapeRenderer.js +31 -0
- package/renderer/scatter/SquareShapeRenderer.js.map +1 -0
- package/renderer/scatter/TriangleShapeRenderer.d.ts +12 -0
- package/renderer/scatter/TriangleShapeRenderer.js +43 -0
- package/renderer/scatter/TriangleShapeRenderer.js.map +1 -0
- package/renderer/scatter/XShapeRenderer.d.ts +11 -0
- package/renderer/scatter/XShapeRenderer.js +15 -0
- package/renderer/scatter/XShapeRenderer.js.map +1 -0
- package/utils/ColorTemplate.d.ts +34 -0
- package/utils/ColorTemplate.js +51 -0
- package/utils/ColorTemplate.js.map +1 -0
- package/utils/HorizontalViewPortHandler.d.ts +6 -0
- package/utils/HorizontalViewPortHandler.js +7 -0
- package/utils/HorizontalViewPortHandler.js.map +1 -0
- package/utils/MPPointD.d.ts +5 -0
- package/utils/MPPointF.d.ts +7 -0
- package/utils/MPSize.d.ts +7 -0
- package/utils/ObjectPool.d.ts +81 -0
- package/utils/ObjectPool.js +183 -0
- package/utils/ObjectPool.js.map +1 -0
- package/utils/Transformer.d.ts +175 -0
- package/utils/Transformer.js +356 -0
- package/utils/Transformer.js.map +1 -0
- package/utils/TransformerHorizontalBarChart.d.ts +14 -0
- package/utils/TransformerHorizontalBarChart.js +30 -0
- package/utils/TransformerHorizontalBarChart.js.map +1 -0
- package/utils/Utils.d.ts +203 -0
- package/utils/Utils.js +653 -0
- package/utils/Utils.js.map +1 -0
- package/utils/ViewPortHandler.d.ts +299 -0
- package/utils/ViewPortHandler.js +585 -0
- package/utils/ViewPortHandler.js.map +1 -0
- package/utils/colors/colorful.d.ts +1 -0
- package/utils/colors/colorful.js +2 -0
- package/utils/colors/colorful.js.map +1 -0
- package/utils/colors/joyful.d.ts +1 -0
- package/utils/colors/joyful.js +2 -0
- package/utils/colors/joyful.js.map +1 -0
- package/utils/colors/liberty.d.ts +1 -0
- package/utils/colors/liberty.js +2 -0
- package/utils/colors/liberty.js.map +1 -0
- package/utils/colors/material.d.ts +1 -0
- package/utils/colors/material.js +2 -0
- package/utils/colors/material.js.map +1 -0
- package/utils/colors/pastel.d.ts +1 -0
- package/utils/colors/pastel.js +2 -0
- package/utils/colors/pastel.js.map +1 -0
- package/utils/colors/vordiplom.d.ts +1 -0
- package/utils/colors/vordiplom.js +2 -0
- package/utils/colors/vordiplom.js.map +1 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EasingFunction } from './Tween';
|
|
2
|
+
export { EasingFunction };
|
|
3
|
+
export declare class ChartAnimator {
|
|
4
|
+
/** object that is updated upon animation update */
|
|
5
|
+
private mListener;
|
|
6
|
+
/** The phase of drawn values on the y-axis. 0 - 1 */
|
|
7
|
+
protected mPhaseY: number;
|
|
8
|
+
/** The phase of drawn values on the x-axis. 0 - 1 */
|
|
9
|
+
protected mPhaseX: number;
|
|
10
|
+
constructor(listener?: (state: any) => void);
|
|
11
|
+
private startAnim;
|
|
12
|
+
private startXAnim;
|
|
13
|
+
private startYAnim;
|
|
14
|
+
/**
|
|
15
|
+
* Animates values along the X axis.
|
|
16
|
+
*
|
|
17
|
+
* @param durationMillis animation duration
|
|
18
|
+
* @param easing EasingFunction
|
|
19
|
+
*/
|
|
20
|
+
animateX(durationMillis: any, easing?: EasingFunction): void;
|
|
21
|
+
/**
|
|
22
|
+
* Animates values along both the X and Y axes.
|
|
23
|
+
*
|
|
24
|
+
* @param durationMillisX animation duration along the X axis
|
|
25
|
+
* @param durationMillisY animation duration along the Y axis
|
|
26
|
+
* @param easingX EasingFunction for the X axis
|
|
27
|
+
* @param easingY EasingFunction for the Y axis
|
|
28
|
+
*/
|
|
29
|
+
animateXY(durationMillisX: any, durationMillisY: any, easingX?: EasingFunction, easingY?: EasingFunction): void;
|
|
30
|
+
/**
|
|
31
|
+
* Animates values along the Y axis.
|
|
32
|
+
*
|
|
33
|
+
* @param durationMillis animation duration
|
|
34
|
+
* @param easing EasingFunction
|
|
35
|
+
*/
|
|
36
|
+
animateY(durationMillis: any, easing?: EasingFunction): void;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the Y axis phase of the animation.
|
|
39
|
+
*
|
|
40
|
+
* @return let value of {@link #mPhaseY}
|
|
41
|
+
*/
|
|
42
|
+
get phaseY(): number;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the Y axis phase of the animation.
|
|
45
|
+
*
|
|
46
|
+
* @param phase let value between 0 - 1
|
|
47
|
+
*/
|
|
48
|
+
set phaseY(phase: number);
|
|
49
|
+
/**
|
|
50
|
+
* Gets the X axis phase of the animation.
|
|
51
|
+
*
|
|
52
|
+
* @return let value of {@link #mPhaseX}
|
|
53
|
+
*/
|
|
54
|
+
get phaseX(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Sets the X axis phase of the animation.
|
|
57
|
+
*
|
|
58
|
+
* @param phase let value between 0 - 1
|
|
59
|
+
*/
|
|
60
|
+
set phaseX(phase: number);
|
|
61
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Tween } from './Tween';
|
|
2
|
+
function clamp(value) {
|
|
3
|
+
return Math.min(1, Math.max(0, value));
|
|
4
|
+
}
|
|
5
|
+
export class ChartAnimator {
|
|
6
|
+
constructor(listener) {
|
|
7
|
+
/** The phase of drawn values on the y-axis. 0 - 1 */
|
|
8
|
+
this.mPhaseY = 1;
|
|
9
|
+
/** The phase of drawn values on the x-axis. 0 - 1 */
|
|
10
|
+
this.mPhaseX = 1;
|
|
11
|
+
this.mListener = listener;
|
|
12
|
+
}
|
|
13
|
+
startAnim(duration, easing, listener) {
|
|
14
|
+
const anim = new Tween({
|
|
15
|
+
onRender: listener
|
|
16
|
+
});
|
|
17
|
+
anim.tween({ value: 0 }, { value: 1 }, duration);
|
|
18
|
+
return anim;
|
|
19
|
+
}
|
|
20
|
+
startXAnim(duration, easing, listener) {
|
|
21
|
+
return this.startAnim(duration, easing, (state) => {
|
|
22
|
+
this.phaseX = state.value;
|
|
23
|
+
listener?.(state);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
startYAnim(duration, easing, listener) {
|
|
27
|
+
return this.startAnim(duration, easing, (state) => {
|
|
28
|
+
this.phaseY = state.value;
|
|
29
|
+
listener?.(state);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Animates values along the X axis.
|
|
34
|
+
*
|
|
35
|
+
* @param durationMillis animation duration
|
|
36
|
+
* @param easing EasingFunction
|
|
37
|
+
*/
|
|
38
|
+
animateX(durationMillis, easing) {
|
|
39
|
+
this.startXAnim(durationMillis, easing, this.mListener);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Animates values along both the X and Y axes.
|
|
43
|
+
*
|
|
44
|
+
* @param durationMillisX animation duration along the X axis
|
|
45
|
+
* @param durationMillisY animation duration along the Y axis
|
|
46
|
+
* @param easingX EasingFunction for the X axis
|
|
47
|
+
* @param easingY EasingFunction for the Y axis
|
|
48
|
+
*/
|
|
49
|
+
animateXY(durationMillisX, durationMillisY, easingX, easingY) {
|
|
50
|
+
this.startXAnim(durationMillisX, easingX, durationMillisX > durationMillisY ? this.mListener : undefined);
|
|
51
|
+
this.startYAnim(durationMillisY, easingY || easingX, durationMillisX > durationMillisY ? undefined : this.mListener);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Animates values along the Y axis.
|
|
55
|
+
*
|
|
56
|
+
* @param durationMillis animation duration
|
|
57
|
+
* @param easing EasingFunction
|
|
58
|
+
*/
|
|
59
|
+
animateY(durationMillis, easing) {
|
|
60
|
+
this.startYAnim(durationMillis, easing, this.mListener);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets the Y axis phase of the animation.
|
|
64
|
+
*
|
|
65
|
+
* @return let value of {@link #mPhaseY}
|
|
66
|
+
*/
|
|
67
|
+
get phaseY() {
|
|
68
|
+
return this.mPhaseY;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sets the Y axis phase of the animation.
|
|
72
|
+
*
|
|
73
|
+
* @param phase let value between 0 - 1
|
|
74
|
+
*/
|
|
75
|
+
set phaseY(phase) {
|
|
76
|
+
this.mPhaseY = clamp(phase);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Gets the X axis phase of the animation.
|
|
80
|
+
*
|
|
81
|
+
* @return let value of {@link #mPhaseX}
|
|
82
|
+
*/
|
|
83
|
+
get phaseX() {
|
|
84
|
+
return this.mPhaseX;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Sets the X axis phase of the animation.
|
|
88
|
+
*
|
|
89
|
+
* @param phase let value between 0 - 1
|
|
90
|
+
*/
|
|
91
|
+
set phaseX(phase) {
|
|
92
|
+
this.mPhaseX = clamp(phase);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=ChartAnimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartAnimator.js","sourceRoot":"","sources":["../../../src/ui-chart/animation/ChartAnimator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhD,SAAS,KAAK,CAAC,KAAK;IAChB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,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,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;;OAOG;IACI,SAAS,CAAC,eAAe,EAAE,eAAe,EAAE,OAAwB,EAAE,OAAwB;QACjG,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC1G,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,OAAO,IAAI,OAAO,EAAE,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzH,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,cAAc,EAAE,MAAuB;QACnD,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM,CAAC,KAAK;QACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM,CAAC,KAAK;QACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;CACJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { time } from '@nativescript/core/profiling';
|
|
2
|
+
import { cancelAnimationFrame, requestAnimationFrame } from '@nativescript/core/animation-frame';
|
|
3
|
+
import { AdditiveTweening } from '@nativescript-community/additween';
|
|
4
|
+
if (!global.window) {
|
|
5
|
+
global.window = {
|
|
6
|
+
requestAnimationFrame,
|
|
7
|
+
cancelAnimationFrame,
|
|
8
|
+
performance: {
|
|
9
|
+
now: time
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
else if (!global.window.requestAnimationFrame) {
|
|
14
|
+
global.window.requestAnimationFrame = requestAnimationFrame;
|
|
15
|
+
global.window.cancelAnimationFrame = cancelAnimationFrame;
|
|
16
|
+
if (!global.window.performance) {
|
|
17
|
+
//@ts-ignore
|
|
18
|
+
global.window.performance = {
|
|
19
|
+
now: time
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class Tween extends AdditiveTweening {
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Tween.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tween.js","sourceRoot":"","sources":["../../../src/ui-chart/animation/Tween.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAkB,MAAM,mCAAmC,CAAC;AAErF,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,MAAM,GAAG;QACZ,qBAAqB;QACrB,oBAAoB;QACpB,WAAW,EAAE;YACT,GAAG,EAAE,IAAI;SACZ;KACG,CAAC;AACb,CAAC;KAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IAC5D,MAAM,CAAC,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC7B,YAAY;QACZ,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG;YACxB,GAAG,EAAE,IAAI;SACZ,CAAC;IACN,CAAC;AACL,CAAC;AAED,MAAM,OAAO,KAAwC,SAAQ,gBAAmB;CAAG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare abstract class AbstractBuffer<T> {
|
|
2
|
+
protected index: number;
|
|
3
|
+
protected phaseX: number;
|
|
4
|
+
protected phaseY: number;
|
|
5
|
+
protected from: number;
|
|
6
|
+
protected to: number;
|
|
7
|
+
buffer: any;
|
|
8
|
+
/**
|
|
9
|
+
* Initialization with buffer-size.
|
|
10
|
+
*
|
|
11
|
+
* @param size
|
|
12
|
+
*/
|
|
13
|
+
constructor(size: number);
|
|
14
|
+
/** limits the drawing on the x-axis */
|
|
15
|
+
limitFrom(from: number): void;
|
|
16
|
+
/** limits the drawing on the x-axis */
|
|
17
|
+
limitTo(to: number): void;
|
|
18
|
+
/**
|
|
19
|
+
* Resets the buffer index to 0 and makes the buffer reusable.
|
|
20
|
+
*/
|
|
21
|
+
reset(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the size (length) of the buffer array.
|
|
24
|
+
*/
|
|
25
|
+
get length(): any;
|
|
26
|
+
/**
|
|
27
|
+
* Set the phases used for animations.
|
|
28
|
+
*
|
|
29
|
+
* @param phaseX
|
|
30
|
+
* @param phaseY
|
|
31
|
+
*/
|
|
32
|
+
setPhases(phaseX: any, phaseY: any): void;
|
|
33
|
+
/**
|
|
34
|
+
* Builds up the buffer with the provided data and resets the buffer-index
|
|
35
|
+
* after feed-completion. This needs to run FAST.
|
|
36
|
+
*
|
|
37
|
+
* @param data
|
|
38
|
+
*/
|
|
39
|
+
abstract feed(data: any): any;
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Utils } from '../utils/Utils';
|
|
2
|
+
export class AbstractBuffer {
|
|
3
|
+
/**
|
|
4
|
+
* Initialization with buffer-size.
|
|
5
|
+
*
|
|
6
|
+
* @param size
|
|
7
|
+
*/
|
|
8
|
+
constructor(size) {
|
|
9
|
+
this.index = 0;
|
|
10
|
+
this.buffer = Utils.getTempArray(size);
|
|
11
|
+
}
|
|
12
|
+
/** limits the drawing on the x-axis */
|
|
13
|
+
limitFrom(from) {
|
|
14
|
+
if (from < 0) {
|
|
15
|
+
from = 0;
|
|
16
|
+
}
|
|
17
|
+
this.from = from;
|
|
18
|
+
}
|
|
19
|
+
/** limits the drawing on the x-axis */
|
|
20
|
+
limitTo(to) {
|
|
21
|
+
if (to < 0) {
|
|
22
|
+
to = 0;
|
|
23
|
+
}
|
|
24
|
+
this.to = to;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resets the buffer index to 0 and makes the buffer reusable.
|
|
28
|
+
*/
|
|
29
|
+
reset() {
|
|
30
|
+
this.index = 0;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns the size (length) of the buffer array.
|
|
34
|
+
*/
|
|
35
|
+
get length() {
|
|
36
|
+
return this.buffer.length;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Set the phases used for animations.
|
|
40
|
+
*
|
|
41
|
+
* @param phaseX
|
|
42
|
+
* @param phaseY
|
|
43
|
+
*/
|
|
44
|
+
setPhases(phaseX, phaseY) {
|
|
45
|
+
this.phaseX = phaseX;
|
|
46
|
+
this.phaseY = phaseY;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=AbstractBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractBuffer.js","sourceRoot":"","sources":["../../../src/ui-chart/buffer/AbstractBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,MAAM,OAAgB,cAAc;IAShC;;;;OAIG;IACH,YAAY,IAAY;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,uCAAuC;IAChC,SAAS,CAAC,IAAY;QACzB,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YACX,IAAI,GAAG,CAAC,CAAC;QACb,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,uCAAuC;IAChC,OAAO,CAAC,EAAU;QACrB,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACT,EAAE,GAAG,CAAC,CAAC;QACX,CAAC;QACD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,KAAK;QACR,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CASJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractBuffer } from './AbstractBuffer';
|
|
2
|
+
import { IBarDataSet } from '../interfaces/datasets/IBarDataSet';
|
|
3
|
+
export declare class BarBuffer extends AbstractBuffer<IBarDataSet> {
|
|
4
|
+
dataSetIndex: number;
|
|
5
|
+
dataSetCount: number;
|
|
6
|
+
containsStacks: boolean;
|
|
7
|
+
inverted: boolean;
|
|
8
|
+
/** width of the bar on the x-axis, in values (not pixels) */
|
|
9
|
+
barWidth: number;
|
|
10
|
+
yAxisMin: number;
|
|
11
|
+
yAxisMax: number;
|
|
12
|
+
constructor(size: number, dataSetCount: number, containsStacks: boolean);
|
|
13
|
+
protected addBar(left: any, top: any, right: any, bottom: any): void;
|
|
14
|
+
feed(data: IBarDataSet): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AbstractBuffer } from './AbstractBuffer';
|
|
2
|
+
export class BarBuffer extends AbstractBuffer {
|
|
3
|
+
constructor(size, dataSetCount, containsStacks) {
|
|
4
|
+
super(size);
|
|
5
|
+
this.dataSetIndex = 0;
|
|
6
|
+
this.dataSetCount = 1;
|
|
7
|
+
this.containsStacks = false;
|
|
8
|
+
this.inverted = false;
|
|
9
|
+
/** width of the bar on the x-axis, in values (not pixels) */
|
|
10
|
+
this.barWidth = 1;
|
|
11
|
+
this.yAxisMin = 0;
|
|
12
|
+
this.yAxisMax = 0;
|
|
13
|
+
this.dataSetCount = dataSetCount;
|
|
14
|
+
this.containsStacks = containsStacks;
|
|
15
|
+
}
|
|
16
|
+
addBar(left, top, right, bottom) {
|
|
17
|
+
this.buffer[this.index++] = left;
|
|
18
|
+
this.buffer[this.index++] = top;
|
|
19
|
+
this.buffer[this.index++] = right;
|
|
20
|
+
this.buffer[this.index++] = bottom;
|
|
21
|
+
}
|
|
22
|
+
feed(data) {
|
|
23
|
+
const size = data.entryCount * this.phaseX;
|
|
24
|
+
const barWidthHalf = this.barWidth / 2;
|
|
25
|
+
const yKey = data.yProperty;
|
|
26
|
+
for (let i = 0; i < size; i++) {
|
|
27
|
+
const e = data.getEntryForIndex(i);
|
|
28
|
+
if (!e) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const x = data.getEntryXValue(e, i);
|
|
32
|
+
let y = e[yKey];
|
|
33
|
+
const vals = e.yVals;
|
|
34
|
+
if (!this.containsStacks || !vals || vals.length === 0) {
|
|
35
|
+
if (y === undefined || y === null) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const left = x - barWidthHalf;
|
|
39
|
+
const right = x + barWidthHalf;
|
|
40
|
+
let bottom, top;
|
|
41
|
+
if (this.inverted) {
|
|
42
|
+
bottom = y >= 0 ? y : this.yAxisMax <= 0 ? this.yAxisMax : 0;
|
|
43
|
+
top = y <= 0 ? y : this.yAxisMin >= 0 ? this.yAxisMin : 0;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
top = y >= 0 ? y : this.yAxisMax <= 0 ? this.yAxisMax : 0;
|
|
47
|
+
bottom = y <= 0 ? y : this.yAxisMin >= 0 ? this.yAxisMin : 0;
|
|
48
|
+
}
|
|
49
|
+
// multiply the height of the rect with the phase
|
|
50
|
+
if (top > 0) {
|
|
51
|
+
top = bottom + this.phaseY * (top - bottom);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
bottom = top + this.phaseY * (bottom - top);
|
|
55
|
+
}
|
|
56
|
+
if (left !== right && top !== bottom) {
|
|
57
|
+
this.addBar(left, top, right, bottom);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
let posY = 0;
|
|
62
|
+
let negY = -e.negativeSum;
|
|
63
|
+
let yStart = 0;
|
|
64
|
+
// fill the stack
|
|
65
|
+
for (let k = 0; k < vals.length; k++) {
|
|
66
|
+
const value = vals[k];
|
|
67
|
+
if (value === 0.0 && (posY === 0.0 || negY === 0.0)) {
|
|
68
|
+
// Take care of the situation of a 0.0 value, which overlaps a non-zero bar
|
|
69
|
+
y = value;
|
|
70
|
+
yStart = y;
|
|
71
|
+
}
|
|
72
|
+
else if (value >= 0.0) {
|
|
73
|
+
y = posY;
|
|
74
|
+
yStart = posY + value;
|
|
75
|
+
posY = yStart;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
y = negY;
|
|
79
|
+
yStart = negY + Math.abs(value);
|
|
80
|
+
negY += Math.abs(value);
|
|
81
|
+
}
|
|
82
|
+
const left = x - barWidthHalf;
|
|
83
|
+
const right = x + barWidthHalf;
|
|
84
|
+
let bottom, top;
|
|
85
|
+
if (this.inverted) {
|
|
86
|
+
bottom = y >= yStart ? y : yStart;
|
|
87
|
+
top = y <= yStart ? y : yStart;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
top = y >= yStart ? y : yStart;
|
|
91
|
+
bottom = y <= yStart ? y : yStart;
|
|
92
|
+
}
|
|
93
|
+
// multiply the height of the rect with the phase
|
|
94
|
+
if (top > 0) {
|
|
95
|
+
top = bottom + this.phaseY * (top - bottom);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
bottom = top + this.phaseY * (bottom - top);
|
|
99
|
+
}
|
|
100
|
+
if (left !== right && top !== bottom) {
|
|
101
|
+
this.addBar(left, top, right, bottom);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
this.reset();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=BarBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarBuffer.js","sourceRoot":"","sources":["../../../src/ui-chart/buffer/BarBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,OAAO,SAAU,SAAQ,cAA2B;IAYtD,YAAY,IAAY,EAAE,YAAoB,EAAE,cAAuB;QACnE,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,iBAAY,GAAG,CAAC,CAAC;QACjB,iBAAY,GAAG,CAAC,CAAC;QACjB,mBAAc,GAAG,KAAK,CAAC;QACvB,aAAQ,GAAG,KAAK,CAAC;QAEjB,6DAA6D;QAC7D,aAAQ,GAAG,CAAC,CAAC;QAEb,aAAQ,GAAG,CAAC,CAAC;QACb,aAAQ,GAAG,CAAC,CAAC;QAIT,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;IAES,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE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AAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACtC,CAAC;oBAED,iDAAiD;oBACjD,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;wBACV,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;oBAChD,CAAC;yBAAM,CAAC;wBACJ,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;oBAChD,CAAC;oBAED,IAAI,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;wBACnC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;oBAC1C,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BarBuffer } from './BarBuffer';
|
|
2
|
+
import { IBarDataSet } from '../interfaces/datasets/IBarDataSet';
|
|
3
|
+
export declare class HorizontalBarBuffer extends BarBuffer {
|
|
4
|
+
constructor(size: number, dataSetCount: number, containsStacks: boolean);
|
|
5
|
+
feed(data: IBarDataSet): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BarBuffer } from './BarBuffer';
|
|
2
|
+
export class HorizontalBarBuffer extends BarBuffer {
|
|
3
|
+
constructor(size, dataSetCount, containsStacks) {
|
|
4
|
+
super(size, dataSetCount, containsStacks);
|
|
5
|
+
}
|
|
6
|
+
feed(data) {
|
|
7
|
+
const size = data.entryCount * this.phaseX;
|
|
8
|
+
const barWidthHalf = this.barWidth / 2;
|
|
9
|
+
const yKey = data.yProperty;
|
|
10
|
+
for (let i = 0; i < size; i++) {
|
|
11
|
+
const e = data.getEntryForIndex(i);
|
|
12
|
+
if (!e) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const x = data.getEntryXValue(e, i);
|
|
16
|
+
let y = e[yKey];
|
|
17
|
+
const vals = e.yVals;
|
|
18
|
+
if (!this.containsStacks || !vals) {
|
|
19
|
+
const bottom = x - barWidthHalf;
|
|
20
|
+
const top = x + barWidthHalf;
|
|
21
|
+
let left, right;
|
|
22
|
+
if (this.inverted) {
|
|
23
|
+
left = y >= 0 ? y : this.yAxisMax <= 0 ? this.yAxisMax : 0;
|
|
24
|
+
right = y <= 0 ? y : this.yAxisMin >= 0 ? this.yAxisMin : 0;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
right = y >= 0 ? y : this.yAxisMax <= 0 ? this.yAxisMax : 0;
|
|
28
|
+
left = y <= 0 ? y : this.yAxisMin >= 0 ? this.yAxisMin : 0;
|
|
29
|
+
}
|
|
30
|
+
// multiply the height of the rect with the phase
|
|
31
|
+
if (right > 0) {
|
|
32
|
+
right = left + this.phaseY * (right - left);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
left = right + this.phaseY * (left - right);
|
|
36
|
+
}
|
|
37
|
+
this.addBar(left, top, right, bottom);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
let posY = 0;
|
|
41
|
+
let negY = -e.negativeSum;
|
|
42
|
+
let yStart = 0;
|
|
43
|
+
// fill the stack
|
|
44
|
+
for (let k = 0; k < vals.length; k++) {
|
|
45
|
+
const value = vals[k];
|
|
46
|
+
if (value >= 0) {
|
|
47
|
+
y = posY;
|
|
48
|
+
yStart = posY + value;
|
|
49
|
+
posY = yStart;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
y = negY;
|
|
53
|
+
yStart = negY + Math.abs(value);
|
|
54
|
+
negY += Math.abs(value);
|
|
55
|
+
}
|
|
56
|
+
const bottom = x - barWidthHalf;
|
|
57
|
+
const top = x + barWidthHalf;
|
|
58
|
+
let left, right;
|
|
59
|
+
if (this.inverted) {
|
|
60
|
+
left = y >= yStart ? y : yStart;
|
|
61
|
+
right = y <= yStart ? y : yStart;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
right = y >= yStart ? y : yStart;
|
|
65
|
+
left = y <= yStart ? y : yStart;
|
|
66
|
+
}
|
|
67
|
+
// multiply the height of the rect with the phase
|
|
68
|
+
if (right > 0) {
|
|
69
|
+
right = left + this.phaseY * (right - left);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
left = right + this.phaseY * (left - right);
|
|
73
|
+
}
|
|
74
|
+
this.addBar(left, top, right, bottom);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.reset();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=HorizontalBarBuffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalBarBuffer.js","sourceRoot":"","sources":["../../../src/ui-chart/buffer/HorizontalBarBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAC9C,YAAY,IAAY,EAAE,YAAoB,EAAE,cAAuB;QACnE,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IAC9C,CAAC;IAEM,IAAI,CAAC,IAAiB;QACzB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;YACnC,IAAI,CA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IAAI,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;wBAChC,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACrC,CAAC;yBAAM,CAAC;wBACJ,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;wBACjC,IAAI,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;oBACpC,CAAC;oBAED,iDAAiD;oBACjD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;wBACZ,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;oBAChD,CAAC;yBAAM,CAAC;wBACJ,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;oBAChD,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC1C,CAAC;YACL,CAAC;QACL,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { BarLineChartBase } from './BarLineChartBase';
|
|
2
|
+
import { BarData } from '../data/BarData';
|
|
3
|
+
import { BarEntry } from '../data/BarEntry';
|
|
4
|
+
import { BarDataProvider } from '../interfaces/dataprovider/BarDataProvider';
|
|
5
|
+
import { Entry } from '../data/Entry';
|
|
6
|
+
import { BarDataSet } from '../data/BarDataSet';
|
|
7
|
+
import { Highlight } from '../highlight/Highlight';
|
|
8
|
+
import { BarChartRenderer } from '../renderer/BarChartRenderer';
|
|
9
|
+
import { Canvas, Paint, RectF } from '@nativescript-community/ui-canvas';
|
|
10
|
+
import { IBarDataSet } from '../interfaces/datasets/IBarDataSet';
|
|
11
|
+
import { BaseCustomRenderer } from '../renderer/DataRenderer';
|
|
12
|
+
export interface CustomRenderer extends BaseCustomRenderer {
|
|
13
|
+
drawBar?: (c: Canvas, e: BarEntry, dataSet: IBarDataSet, left: number, top: number, right: number, bottom: number, paint: Paint) => void;
|
|
14
|
+
drawHighlight?: (c: Canvas, e: Highlight, left: number, top: number, right: number, bottom: number, paint: Paint) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare class BarChart extends BarLineChartBase<Entry, BarDataSet, BarData> implements BarDataProvider {
|
|
17
|
+
protected mRenderer: BarChartRenderer;
|
|
18
|
+
/**
|
|
19
|
+
* Set this to true to make the highlight operation full-bar oriented, false to make it highlight single values (relevant
|
|
20
|
+
* only for stacked). If enabled, highlighting operations will highlight the whole bar, even if only a single stack entry
|
|
21
|
+
* was tapped.
|
|
22
|
+
* Default: false
|
|
23
|
+
*
|
|
24
|
+
* @param enabled
|
|
25
|
+
*/
|
|
26
|
+
highlightFullBarEnabled: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Adds half of the bar width to each side of the x-axis range in order to allow the bars of the barchart to be
|
|
29
|
+
* fully displayed.
|
|
30
|
+
* Default: false
|
|
31
|
+
*/
|
|
32
|
+
fitBars: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* if set to true, all values are drawn above their bars, instead of below their top
|
|
35
|
+
*/
|
|
36
|
+
drawValueAboveBarEnabled: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* if set to true, a grey area is drawn behind each bar that indicates the maximum value
|
|
39
|
+
*/
|
|
40
|
+
drawBarShadowEnabled: boolean;
|
|
41
|
+
customRenderer: CustomRenderer;
|
|
42
|
+
protected init(): void;
|
|
43
|
+
protected calcMinMax(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
|
|
46
|
+
* point
|
|
47
|
+
* inside the BarChart.
|
|
48
|
+
*
|
|
49
|
+
* @param x
|
|
50
|
+
* @param y
|
|
51
|
+
* @return
|
|
52
|
+
*/
|
|
53
|
+
getHighlightsByTouchPoint(x: number, y: number): Highlight<Entry>[];
|
|
54
|
+
/**
|
|
55
|
+
* Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
|
|
56
|
+
* point
|
|
57
|
+
* inside the BarChart.
|
|
58
|
+
*
|
|
59
|
+
* @param x
|
|
60
|
+
* @param y
|
|
61
|
+
* @return
|
|
62
|
+
*/
|
|
63
|
+
getHighlightByTouchPoint(x: number, y: number): Highlight;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be
|
|
66
|
+
* found in the charts data.
|
|
67
|
+
*
|
|
68
|
+
* @param e
|
|
69
|
+
* @return
|
|
70
|
+
*/
|
|
71
|
+
getBarBounds(e: BarEntry): RectF;
|
|
72
|
+
/**
|
|
73
|
+
* Highlights the value at the given x-value in the given DataSet. Provide
|
|
74
|
+
* -1 as the dataSetIndex to undo all highlighting.
|
|
75
|
+
*
|
|
76
|
+
* @param x
|
|
77
|
+
* @param dataSetIndex
|
|
78
|
+
* @param stackIndex the index inside the stack - only relevant for stacked entries
|
|
79
|
+
* @param callListener
|
|
80
|
+
*/
|
|
81
|
+
highlightValue(x: number, dataSetIndex: number, stackIndex: number, callListener?: boolean): void;
|
|
82
|
+
get barData(): BarData;
|
|
83
|
+
/**
|
|
84
|
+
* Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries.
|
|
85
|
+
* Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified
|
|
86
|
+
* by the parameters.
|
|
87
|
+
* Calls notifyDataSetChanged() afterwards.
|
|
88
|
+
*
|
|
89
|
+
* @param fromX the starting polet on the x-axis where the grouping should begin
|
|
90
|
+
* @param groupSpace the space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1
|
|
91
|
+
* @param barSpace the space between individual bars in values (not pixels) e.g. 0.1 for bar width 1
|
|
92
|
+
* @param centered whether to group bar around x values or between (default is false)
|
|
93
|
+
* @param groupCondensed whether to condensed grouped bar (no space for "0" bars)
|
|
94
|
+
*/
|
|
95
|
+
groupBars(fromX: any, groupSpace: any, barSpace: any, centered?: any, groupCondensed?: any): void;
|
|
96
|
+
}
|