@nstudio/ncharts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +129 -0
  3. package/angular/fesm2022/nstudio-ncharts-angular.mjs +1059 -0
  4. package/angular/fesm2022/nstudio-ncharts-angular.mjs.map +1 -0
  5. package/angular/package.json +19 -0
  6. package/angular/types/nstudio-ncharts-angular.d.ts +175 -0
  7. package/charts/bar-chart.android.d.ts +29 -0
  8. package/charts/bar-chart.android.js +235 -0
  9. package/charts/bar-chart.android.js.map +1 -0
  10. package/charts/bar-chart.d.ts +14 -0
  11. package/charts/bar-chart.ios.d.ts +29 -0
  12. package/charts/bar-chart.ios.js +263 -0
  13. package/charts/bar-chart.ios.js.map +1 -0
  14. package/charts/bubble-chart.android.d.ts +26 -0
  15. package/charts/bubble-chart.android.js +189 -0
  16. package/charts/bubble-chart.android.js.map +1 -0
  17. package/charts/bubble-chart.d.ts +9 -0
  18. package/charts/bubble-chart.ios.d.ts +26 -0
  19. package/charts/bubble-chart.ios.js +225 -0
  20. package/charts/bubble-chart.ios.js.map +1 -0
  21. package/charts/candlestick-chart.android.d.ts +26 -0
  22. package/charts/candlestick-chart.android.js +236 -0
  23. package/charts/candlestick-chart.android.js.map +1 -0
  24. package/charts/candlestick-chart.d.ts +9 -0
  25. package/charts/candlestick-chart.ios.d.ts +26 -0
  26. package/charts/candlestick-chart.ios.js +248 -0
  27. package/charts/candlestick-chart.ios.js.map +1 -0
  28. package/charts/combined-chart.android.d.ts +26 -0
  29. package/charts/combined-chart.android.js +524 -0
  30. package/charts/combined-chart.android.js.map +1 -0
  31. package/charts/combined-chart.d.ts +9 -0
  32. package/charts/combined-chart.ios.d.ts +26 -0
  33. package/charts/combined-chart.ios.js +485 -0
  34. package/charts/combined-chart.ios.js.map +1 -0
  35. package/charts/index.android.d.ts +12 -0
  36. package/charts/index.android.js +13 -0
  37. package/charts/index.android.js.map +1 -0
  38. package/charts/index.d.ts +12 -0
  39. package/charts/index.ios.d.ts +12 -0
  40. package/charts/index.ios.js +13 -0
  41. package/charts/index.ios.js.map +1 -0
  42. package/charts/line-chart.android.d.ts +26 -0
  43. package/charts/line-chart.android.js +248 -0
  44. package/charts/line-chart.android.js.map +1 -0
  45. package/charts/line-chart.d.ts +9 -0
  46. package/charts/line-chart.ios.d.ts +26 -0
  47. package/charts/line-chart.ios.js +278 -0
  48. package/charts/line-chart.ios.js.map +1 -0
  49. package/charts/pie-chart.android.d.ts +24 -0
  50. package/charts/pie-chart.android.js +241 -0
  51. package/charts/pie-chart.android.js.map +1 -0
  52. package/charts/pie-chart.d.ts +9 -0
  53. package/charts/pie-chart.ios.d.ts +24 -0
  54. package/charts/pie-chart.ios.js +380 -0
  55. package/charts/pie-chart.ios.js.map +1 -0
  56. package/charts/radar-chart.android.d.ts +21 -0
  57. package/charts/radar-chart.android.js +217 -0
  58. package/charts/radar-chart.android.js.map +1 -0
  59. package/charts/radar-chart.d.ts +9 -0
  60. package/charts/radar-chart.ios.d.ts +21 -0
  61. package/charts/radar-chart.ios.js +241 -0
  62. package/charts/radar-chart.ios.js.map +1 -0
  63. package/charts/scatter-chart.android.d.ts +26 -0
  64. package/charts/scatter-chart.android.js +220 -0
  65. package/charts/scatter-chart.android.js.map +1 -0
  66. package/charts/scatter-chart.d.ts +9 -0
  67. package/charts/scatter-chart.ios.d.ts +26 -0
  68. package/charts/scatter-chart.ios.js +242 -0
  69. package/charts/scatter-chart.ios.js.map +1 -0
  70. package/charts/utils.d.ts +21 -0
  71. package/charts/utils.js +99 -0
  72. package/charts/utils.js.map +1 -0
  73. package/common.d.ts +300 -0
  74. package/common.js +464 -0
  75. package/common.js.map +1 -0
  76. package/index.android.d.ts +7 -0
  77. package/index.android.js +10 -0
  78. package/index.android.js.map +1 -0
  79. package/index.d.ts +14 -0
  80. package/index.ios.d.ts +7 -0
  81. package/index.ios.js +10 -0
  82. package/index.ios.js.map +1 -0
  83. package/nativescript.config.ts +14 -0
  84. package/nativescript.webpack.js +35 -0
  85. package/package.json +114 -0
  86. package/platforms/android/include.gradle +14 -0
  87. package/react/index.d.ts +6 -0
  88. package/react/index.js +6 -0
  89. package/react/index.js.map +1 -0
  90. package/react/register-elements.d.ts +1 -0
  91. package/react/register-elements.js +19 -0
  92. package/react/register-elements.js.map +1 -0
  93. package/solid/index.d.ts +6 -0
  94. package/solid/index.js +6 -0
  95. package/solid/index.js.map +1 -0
  96. package/solid/register-elements.d.ts +1 -0
  97. package/solid/register-elements.js +19 -0
  98. package/solid/register-elements.js.map +1 -0
  99. package/svelte/index.d.ts +6 -0
  100. package/svelte/index.js +6 -0
  101. package/svelte/index.js.map +1 -0
  102. package/svelte/register-elements.d.ts +1 -0
  103. package/svelte/register-elements.js +19 -0
  104. package/svelte/register-elements.js.map +1 -0
  105. package/types.d.ts +713 -0
  106. package/types.js +7 -0
  107. package/types.js.map +1 -0
  108. package/vue/index.d.ts +6 -0
  109. package/vue/index.js +6 -0
  110. package/vue/index.js.map +1 -0
  111. package/vue/register-elements.d.ts +1 -0
  112. package/vue/register-elements.js +19 -0
  113. package/vue/register-elements.js.map +1 -0
package/common.d.ts ADDED
@@ -0,0 +1,300 @@
1
+ import { View, Property, Color } from '@nativescript/core';
2
+ import type { ChartAnimation, LegendConfig, XAxisConfig, YAxisConfigDual, YAxisConfig, ChartDescription, MarkerConfig, Highlight, LineChartData, BarChartData, PieChartData, ScatterChartData, BubbleChartData, CandleChartData, RadarChartData, CombinedChartData, ChartColor } from './types';
3
+ export * from './types';
4
+ /**
5
+ * Global configuration for @nstudio/ncharts
6
+ */
7
+ export declare class NCharts {
8
+ /**
9
+ * Enable debug logging for the ncharts plugin.
10
+ * Set to true to see detailed console logs.
11
+ * @default false
12
+ */
13
+ static debug: boolean;
14
+ }
15
+ /**
16
+ * Internal logging helper - only logs when NCharts.debug is true
17
+ */
18
+ export declare function nchartsLog(...args: any[]): void;
19
+ /**
20
+ * Internal error logging helper - only logs when NCharts.debug is true
21
+ */
22
+ export declare function nchartsError(...args: any[]): void;
23
+ /**
24
+ * Convert ChartColor to native Color
25
+ */
26
+ export declare function parseColor(color: ChartColor | undefined): Color | undefined;
27
+ /**
28
+ * Convert ChartColor to platform-specific format
29
+ * Android: ARGB integer
30
+ * iOS: UIColor (handled by Color class)
31
+ */
32
+ export declare function toPlatformColor(color: ChartColor | undefined): any;
33
+ /**
34
+ * Base class for all chart views
35
+ * Provides common functionality shared across all chart types
36
+ */
37
+ export declare abstract class ChartViewBase extends View {
38
+ protected _nativeChart: any;
39
+ /** Animation configuration */
40
+ animation: ChartAnimation | undefined;
41
+ /** Chart background color */
42
+ chartBackgroundColor: ChartColor | undefined;
43
+ /** Chart grid background color */
44
+ chartGridBackgroundColor: ChartColor | undefined;
45
+ /** Enable logging */
46
+ logEnabled: boolean;
47
+ /** Text displayed when no data */
48
+ noDataText: string;
49
+ /** Color of no data text */
50
+ noDataTextColor: ChartColor | undefined;
51
+ /** Enable touch gestures */
52
+ touchEnabled: boolean;
53
+ /** Enable drag deceleration */
54
+ dragDecelerationEnabled: boolean;
55
+ /** Drag deceleration friction (0-1) */
56
+ dragDecelerationFrictionCoef: number;
57
+ /** Enable highlight on tap */
58
+ highlightPerTapEnabled: boolean;
59
+ /** Chart description */
60
+ chartDescription: ChartDescription | undefined;
61
+ /** Legend configuration */
62
+ legend: LegendConfig | undefined;
63
+ /** X-axis configuration */
64
+ xAxis: XAxisConfig | undefined;
65
+ /** Marker configuration */
66
+ marker: MarkerConfig | undefined;
67
+ /** Highlighted values */
68
+ highlights: Highlight[] | undefined;
69
+ /** Select event name */
70
+ static selectEvent: string;
71
+ /** Deselect event name */
72
+ static deselectEvent: string;
73
+ /** Gesture event name */
74
+ static gestureEvent: string;
75
+ /**
76
+ * Get the native chart instance
77
+ */
78
+ abstract get nativeChart(): any;
79
+ /**
80
+ * Apply data to the chart
81
+ */
82
+ abstract applyData(): void;
83
+ /**
84
+ * Animate chart
85
+ */
86
+ animate(animation?: ChartAnimation): void;
87
+ /**
88
+ * Highlight values programmatically
89
+ */
90
+ highlightValues(highlights: Highlight[] | null): void;
91
+ /**
92
+ * Clear all highlights
93
+ */
94
+ clearHighlights(): void;
95
+ /**
96
+ * Invalidate and redraw chart
97
+ */
98
+ invalidate(): void;
99
+ protected abstract _applyAnimation(animation: ChartAnimation): void;
100
+ protected abstract _applyHighlights(highlights: Highlight[] | null): void;
101
+ protected abstract _invalidateChart(): void;
102
+ protected abstract _applyLegend(legend: LegendConfig): void;
103
+ protected abstract _applyXAxis(xAxis: XAxisConfig): void;
104
+ protected abstract _applyDescription(description: ChartDescription): void;
105
+ protected abstract _applyMarker(marker: MarkerConfig): void;
106
+ protected onAnimationChange(): void;
107
+ protected onLegendChange(): void;
108
+ protected onXAxisChange(): void;
109
+ protected onDescriptionChange(): void;
110
+ protected onMarkerChange(): void;
111
+ protected onHighlightsChange(): void;
112
+ }
113
+ /**
114
+ * Base class for Line, Bar, Scatter, Bubble, Candlestick, Combined charts
115
+ */
116
+ export declare abstract class BarLineChartViewBase extends ChartViewBase {
117
+ /** Maximum highlight distance */
118
+ maxHighlightDistance: number;
119
+ /** Draw grid background */
120
+ drawGridBackground: boolean;
121
+ /** Grid background color */
122
+ gridBackgroundColor: ChartColor | undefined;
123
+ /** Draw chart borders */
124
+ drawBorders: boolean;
125
+ /** Border color */
126
+ borderColor: ChartColor | undefined;
127
+ /** Border width */
128
+ borderWidth: number;
129
+ /** Minimum offset from edges */
130
+ minOffset: number;
131
+ /** Maximum visible value count */
132
+ maxVisibleValueCount: number;
133
+ /** Auto scale min/max */
134
+ autoScaleMinMaxEnabled: boolean;
135
+ /** Keep position on rotation */
136
+ keepPositionOnRotation: boolean;
137
+ /** Enable highlight on drag */
138
+ highlightPerDragEnabled: boolean;
139
+ /** Enable scaling */
140
+ scaleEnabled: boolean;
141
+ /** Enable X-axis scaling */
142
+ scaleXEnabled: boolean;
143
+ /** Enable Y-axis scaling */
144
+ scaleYEnabled: boolean;
145
+ /** Enable dragging */
146
+ dragEnabled: boolean;
147
+ /** Enable pinch zoom */
148
+ pinchZoom: boolean;
149
+ /** Enable double tap zoom */
150
+ doubleTapToZoomEnabled: boolean;
151
+ /** Y-axis configuration */
152
+ yAxis: YAxisConfigDual | undefined;
153
+ protected abstract _applyYAxis(yAxis: YAxisConfigDual): void;
154
+ protected onYAxisChange(): void;
155
+ /**
156
+ * Move view to specific X value
157
+ */
158
+ moveViewToX(xValue: number): void;
159
+ /**
160
+ * Move view to specific X,Y value
161
+ */
162
+ moveViewTo(xValue: number, yValue: number, axisDependency?: 'LEFT' | 'RIGHT'): void;
163
+ /**
164
+ * Center view on specific X,Y value
165
+ */
166
+ centerViewTo(xValue: number, yValue: number, axisDependency?: 'LEFT' | 'RIGHT'): void;
167
+ /**
168
+ * Zoom to specific scale and position
169
+ */
170
+ zoom(scaleX: number, scaleY: number, xValue: number, yValue: number, axisDependency?: 'LEFT' | 'RIGHT'): void;
171
+ /**
172
+ * Reset zoom to original
173
+ */
174
+ fitScreen(): void;
175
+ protected abstract _moveViewToX(xValue: number): void;
176
+ protected abstract _moveViewTo(xValue: number, yValue: number, axisDependency: string): void;
177
+ protected abstract _centerViewTo(xValue: number, yValue: number, axisDependency: string): void;
178
+ protected abstract _zoom(scaleX: number, scaleY: number, xValue: number, yValue: number, axisDependency: string): void;
179
+ protected abstract _fitScreen(): void;
180
+ }
181
+ /**
182
+ * Base class for Pie and Radar charts
183
+ */
184
+ export declare abstract class PieRadarChartViewBase extends ChartViewBase {
185
+ /** Rotation angle */
186
+ rotationAngle: number;
187
+ /** Enable rotation */
188
+ rotationEnabled: boolean;
189
+ /** Minimum offset */
190
+ minOffset: number;
191
+ }
192
+ /**
193
+ * Line Chart
194
+ */
195
+ export declare abstract class LineChartBase extends BarLineChartViewBase {
196
+ data: LineChartData | undefined;
197
+ }
198
+ /**
199
+ * Bar Chart
200
+ */
201
+ export declare abstract class BarChartBase extends BarLineChartViewBase {
202
+ data: BarChartData | undefined;
203
+ }
204
+ /**
205
+ * Horizontal Bar Chart
206
+ */
207
+ export declare abstract class HorizontalBarChartBase extends BarLineChartViewBase {
208
+ data: BarChartData | undefined;
209
+ }
210
+ /**
211
+ * Pie Chart
212
+ */
213
+ export declare abstract class PieChartBase extends PieRadarChartViewBase {
214
+ data: PieChartData | undefined;
215
+ /** Draw hole in center */
216
+ drawHole: boolean;
217
+ /** Hole radius as percentage */
218
+ holeRadius: number;
219
+ /** Transparent circle radius */
220
+ transparentCircleRadius: number;
221
+ /** Hole color */
222
+ holeColor: ChartColor | undefined;
223
+ /** Transparent circle color */
224
+ transparentCircleColor: ChartColor | undefined;
225
+ /** Draw center text */
226
+ drawCenterText: boolean;
227
+ /** Center text */
228
+ centerText: string;
229
+ /** Center text color */
230
+ centerTextColor: ChartColor | undefined;
231
+ /** Center text size */
232
+ centerTextSize: number;
233
+ /** Draw slice labels */
234
+ drawSliceText: boolean;
235
+ /** Slice label text size */
236
+ sliceTextSize: number;
237
+ /** Slice label text color */
238
+ sliceTextColor: ChartColor | undefined;
239
+ /** Use percentage values */
240
+ usePercentValues: boolean;
241
+ /** Maximum angle */
242
+ maxAngle: number;
243
+ }
244
+ /**
245
+ * Scatter Chart
246
+ */
247
+ export declare abstract class ScatterChartBase extends BarLineChartViewBase {
248
+ data: ScatterChartData | undefined;
249
+ }
250
+ /**
251
+ * Bubble Chart
252
+ */
253
+ export declare abstract class BubbleChartBase extends BarLineChartViewBase {
254
+ data: BubbleChartData | undefined;
255
+ }
256
+ /**
257
+ * Candlestick Chart
258
+ */
259
+ export declare abstract class CandleStickChartBase extends BarLineChartViewBase {
260
+ data: CandleChartData | undefined;
261
+ }
262
+ /**
263
+ * Radar Chart
264
+ */
265
+ export declare abstract class RadarChartBase extends PieRadarChartViewBase {
266
+ data: RadarChartData | undefined;
267
+ /** Y-axis configuration */
268
+ yAxis: YAxisConfig | undefined;
269
+ /** Draw web lines */
270
+ drawWeb: boolean;
271
+ /** Web line width */
272
+ webLineWidth: number;
273
+ /** Web line width inner */
274
+ webLineWidthInner: number;
275
+ /** Web alpha (0-255) */
276
+ webAlpha: number;
277
+ /** Web color */
278
+ webColor: ChartColor | undefined;
279
+ /** Web color inner */
280
+ webColorInner: ChartColor | undefined;
281
+ /** Skip web line count */
282
+ skipWebLineCount: number;
283
+ }
284
+ /**
285
+ * Combined Chart
286
+ */
287
+ export declare abstract class CombinedChartBase extends BarLineChartViewBase {
288
+ data: CombinedChartData | undefined;
289
+ }
290
+ export declare const dataProperty: Property<ChartViewBase, any>;
291
+ export declare const animationProperty: Property<ChartViewBase, ChartAnimation>;
292
+ export declare const legendProperty: Property<ChartViewBase, LegendConfig>;
293
+ export declare const xAxisProperty: Property<ChartViewBase, XAxisConfig>;
294
+ export declare const yAxisProperty: Property<BarLineChartViewBase, YAxisConfigDual>;
295
+ export declare const chartDescriptionProperty: Property<ChartViewBase, ChartDescription>;
296
+ export declare const markerProperty: Property<ChartViewBase, MarkerConfig>;
297
+ export declare const highlightsProperty: Property<ChartViewBase, Highlight[]>;
298
+ export declare const drawHoleProperty: Property<PieChartBase, boolean>;
299
+ export declare const holeRadiusProperty: Property<PieChartBase, number>;
300
+ export declare const rotationAngleProperty: Property<PieRadarChartViewBase, number>;