@xplortech/apollo-data 0.0.3-draft.64d0fa1

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 (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -0
  3. package/dist/apollo-data/apollo-data.esm.js +1 -0
  4. package/dist/apollo-data/index.esm.js +1 -0
  5. package/dist/apollo-data/p-Bb2nY-Tf.js +2 -0
  6. package/dist/apollo-data/p-DQuL1Twl.js +1 -0
  7. package/dist/apollo-data/p-e6584598.entry.js +11 -0
  8. package/dist/cjs/apollo-data-bar-chart_2.cjs.entry.js +68368 -0
  9. package/dist/cjs/apollo-data.cjs.js +25 -0
  10. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  11. package/dist/cjs/index-Cl7HgRm0.js +1198 -0
  12. package/dist/cjs/index.cjs.js +7 -0
  13. package/dist/cjs/loader.cjs.js +13 -0
  14. package/dist/collection/apollo-data-base.js +38 -0
  15. package/dist/collection/collection-manifest.json +13 -0
  16. package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +367 -0
  17. package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +479 -0
  18. package/dist/collection/examples/apollo-data-bar.examples.js +160 -0
  19. package/dist/collection/examples/apollo-data-donut.examples.js +100 -0
  20. package/dist/collection/examples/index.js +2 -0
  21. package/dist/collection/index.js +10 -0
  22. package/dist/collection/utils/code-generator.js +240 -0
  23. package/dist/collection/utils/constants.js +2 -0
  24. package/dist/collection/utils/utils.js +3 -0
  25. package/dist/components/apollo-data-bar-chart.d.ts +11 -0
  26. package/dist/components/apollo-data-bar-chart.js +1 -0
  27. package/dist/components/apollo-data-donut-chart.d.ts +11 -0
  28. package/dist/components/apollo-data-donut-chart.js +1 -0
  29. package/dist/components/index.d.ts +35 -0
  30. package/dist/components/index.js +1 -0
  31. package/dist/components/p-7XF5Cax8.js +11 -0
  32. package/dist/components/p-Dws5s-Xe.js +1 -0
  33. package/dist/esm/apollo-data-bar-chart_2.entry.js +68365 -0
  34. package/dist/esm/apollo-data.js +21 -0
  35. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  36. package/dist/esm/index-Bb2nY-Tf.js +1190 -0
  37. package/dist/esm/index.js +5 -0
  38. package/dist/esm/loader.js +11 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/types/apollo-data-base.d.ts +7 -0
  42. package/dist/types/components/apollo-data-bar/apollo-data-bar.d.ts +298 -0
  43. package/dist/types/components/apollo-data-donut/apollo-data-donut.d.ts +533 -0
  44. package/dist/types/components.d.ts +102 -0
  45. package/dist/types/examples/apollo-data-bar.examples.d.ts +12 -0
  46. package/dist/types/examples/apollo-data-donut.examples.d.ts +11 -0
  47. package/dist/types/examples/index.d.ts +2 -0
  48. package/dist/types/index.d.ts +11 -0
  49. package/dist/types/stencil-public-runtime.d.ts +1839 -0
  50. package/dist/types/utils/code-generator.d.ts +12 -0
  51. package/dist/types/utils/constants.d.ts +2 -0
  52. package/dist/types/utils/utils.d.ts +1 -0
  53. package/loader/cdn.js +1 -0
  54. package/loader/index.cjs.js +1 -0
  55. package/loader/index.d.ts +24 -0
  56. package/loader/index.es2017.js +1 -0
  57. package/loader/index.js +2 -0
  58. package/package.json +92 -0
  59. package/src/examples/apollo-data-bar.examples.ts +172 -0
  60. package/src/examples/apollo-data-donut.examples.ts +118 -0
  61. package/src/examples/index.ts +2 -0
@@ -0,0 +1,533 @@
1
+ import { ComponentInterface } from '../../stencil-public-runtime';
2
+ import { ApolloBase } from '../../apollo-data-base';
3
+ export interface DonutDataItem {
4
+ category: string;
5
+ value: number;
6
+ }
7
+ export interface DonutSpec {
8
+ colorSet?: string[];
9
+ prefix?: string;
10
+ suffix?: string;
11
+ centerText?: string;
12
+ }
13
+ interface DonutDataItemValues extends DonutDataItem {
14
+ order: number;
15
+ }
16
+ export declare class ApolloDataDonutChart extends ApolloBase<DonutDataItem[], DonutSpec> implements ComponentInterface {
17
+ el: HTMLElement;
18
+ /**
19
+ * Array of data items to display in the donut chart. Each item represents a segment with category and value.
20
+ * @property {string} category - Category name for the data segment
21
+ * @property {number} value - Numeric value for the donut chart segment
22
+ */
23
+ adData: string | DonutDataItem[];
24
+ /**
25
+ * Optional specification object for customizing the chart appearance
26
+ * @property {string[]} [colorSet] - Array of color hex codes for chart segments
27
+ * @property {string} [preffix] - A string added at the start of another string, like $ or a currency symbol.
28
+ * @property {string} [suffix] - A string added at the end of another string, like %, kg or a currency symbol.
29
+ * @property {string} [centerText] - A label string rendered at the center of the view.
30
+ */
31
+ adSpec: string | DonutSpec;
32
+ private categories;
33
+ private dataValues;
34
+ private totalRevenue;
35
+ private chartColors;
36
+ private defaultChartColors;
37
+ private defaultCenterText;
38
+ componentDidRender(): Promise<void>;
39
+ protected getViewData(data: DonutDataItem[], spec?: DonutSpec): Promise<{
40
+ $schema: string;
41
+ description: string;
42
+ height: number;
43
+ signals: ({
44
+ name: string;
45
+ update: string;
46
+ value?: undefined;
47
+ on?: undefined;
48
+ } | {
49
+ name: string;
50
+ value: any;
51
+ on: {
52
+ events: {
53
+ type: string;
54
+ markname: string;
55
+ };
56
+ update: string;
57
+ }[];
58
+ update?: undefined;
59
+ })[];
60
+ width: {
61
+ signal: string;
62
+ };
63
+ data: ({
64
+ name: string;
65
+ values: DonutDataItemValues[];
66
+ transform: ({
67
+ type: string;
68
+ fields: string[];
69
+ ops: string[];
70
+ as: string[];
71
+ expr?: undefined;
72
+ sort?: undefined;
73
+ field?: undefined;
74
+ } | {
75
+ type: string;
76
+ as: string;
77
+ expr: string;
78
+ fields?: undefined;
79
+ ops?: undefined;
80
+ sort?: undefined;
81
+ field?: undefined;
82
+ } | {
83
+ type: string;
84
+ sort: {
85
+ field: string;
86
+ order: string;
87
+ };
88
+ fields?: undefined;
89
+ ops?: undefined;
90
+ as?: undefined;
91
+ expr?: undefined;
92
+ field?: undefined;
93
+ } | {
94
+ type: string;
95
+ field: string;
96
+ as: string[];
97
+ fields?: undefined;
98
+ ops?: undefined;
99
+ expr?: undefined;
100
+ sort?: undefined;
101
+ })[];
102
+ } | {
103
+ name: string;
104
+ values: {
105
+ category: string;
106
+ value: number;
107
+ order: number;
108
+ }[];
109
+ transform: ({
110
+ type: string;
111
+ expr: string;
112
+ as?: undefined;
113
+ } | {
114
+ type: string;
115
+ as: string;
116
+ expr: string;
117
+ })[];
118
+ })[];
119
+ scales: {
120
+ name: string;
121
+ type: string;
122
+ domain: string[];
123
+ range: string[];
124
+ }[];
125
+ legends: {
126
+ fill: string;
127
+ orient: string;
128
+ direction: string;
129
+ columns: number;
130
+ title: string;
131
+ padding: number;
132
+ symbolType: string;
133
+ symbolSize: number;
134
+ labelFontSize: number;
135
+ labelColor: string;
136
+ rowPadding: number;
137
+ }[];
138
+ marks: ({
139
+ type: string;
140
+ name: string;
141
+ from: {
142
+ data: string;
143
+ };
144
+ encode: {
145
+ enter: {
146
+ stroke: {
147
+ value: string;
148
+ };
149
+ strokeWidth: {
150
+ value: number;
151
+ };
152
+ x: {
153
+ signal: string;
154
+ field?: undefined;
155
+ };
156
+ y: {
157
+ signal: string;
158
+ field?: undefined;
159
+ };
160
+ x2: {
161
+ signal: string;
162
+ };
163
+ y2: {
164
+ signal: string;
165
+ };
166
+ fill?: undefined;
167
+ startAngle?: undefined;
168
+ endAngle?: undefined;
169
+ innerRadius?: undefined;
170
+ outerRadius?: undefined;
171
+ padAngle?: undefined;
172
+ cornerRadius?: undefined;
173
+ text?: undefined;
174
+ align?: undefined;
175
+ baseline?: undefined;
176
+ fontSize?: undefined;
177
+ font?: undefined;
178
+ fontWeight?: undefined;
179
+ limit?: undefined;
180
+ lineBreak?: undefined;
181
+ };
182
+ update: {
183
+ opacity: {
184
+ value: number;
185
+ };
186
+ text?: undefined;
187
+ };
188
+ };
189
+ zindex: number;
190
+ interactive?: undefined;
191
+ } | {
192
+ type: string;
193
+ name: string;
194
+ from: {
195
+ data: string;
196
+ };
197
+ encode: {
198
+ enter: {
199
+ fill: {
200
+ scale: string;
201
+ field: string;
202
+ value?: undefined;
203
+ };
204
+ x: {
205
+ signal: string;
206
+ field?: undefined;
207
+ };
208
+ y: {
209
+ signal: string;
210
+ field?: undefined;
211
+ };
212
+ startAngle: {
213
+ field: string;
214
+ };
215
+ endAngle: {
216
+ field: string;
217
+ };
218
+ innerRadius: {
219
+ signal: string;
220
+ };
221
+ outerRadius: {
222
+ signal: string;
223
+ };
224
+ padAngle: {
225
+ value: number;
226
+ };
227
+ cornerRadius: {
228
+ value: number;
229
+ };
230
+ stroke?: undefined;
231
+ strokeWidth?: undefined;
232
+ x2?: undefined;
233
+ y2?: undefined;
234
+ text?: undefined;
235
+ align?: undefined;
236
+ baseline?: undefined;
237
+ fontSize?: undefined;
238
+ font?: undefined;
239
+ fontWeight?: undefined;
240
+ limit?: undefined;
241
+ lineBreak?: undefined;
242
+ };
243
+ update?: undefined;
244
+ };
245
+ interactive: boolean;
246
+ zindex?: undefined;
247
+ } | {
248
+ type: string;
249
+ name: string;
250
+ from: {
251
+ data: string;
252
+ };
253
+ encode: {
254
+ enter: {
255
+ fill: {
256
+ value: string;
257
+ scale?: undefined;
258
+ field?: undefined;
259
+ };
260
+ x: {
261
+ signal: string;
262
+ field?: undefined;
263
+ };
264
+ y: {
265
+ signal: string;
266
+ field?: undefined;
267
+ };
268
+ startAngle: {
269
+ field: string;
270
+ };
271
+ endAngle: {
272
+ field: string;
273
+ };
274
+ innerRadius: {
275
+ signal: string;
276
+ };
277
+ outerRadius: {
278
+ signal: string;
279
+ };
280
+ padAngle: {
281
+ value: number;
282
+ };
283
+ cornerRadius: {
284
+ value: number;
285
+ };
286
+ stroke?: undefined;
287
+ strokeWidth?: undefined;
288
+ x2?: undefined;
289
+ y2?: undefined;
290
+ text?: undefined;
291
+ align?: undefined;
292
+ baseline?: undefined;
293
+ fontSize?: undefined;
294
+ font?: undefined;
295
+ fontWeight?: undefined;
296
+ limit?: undefined;
297
+ lineBreak?: undefined;
298
+ };
299
+ update?: undefined;
300
+ };
301
+ zindex: number;
302
+ interactive?: undefined;
303
+ } | {
304
+ type: string;
305
+ name: string;
306
+ from: {
307
+ data: string;
308
+ };
309
+ encode: {
310
+ enter: {
311
+ fill: {
312
+ value: string;
313
+ scale?: undefined;
314
+ field?: undefined;
315
+ };
316
+ x: {
317
+ signal: string;
318
+ field?: undefined;
319
+ };
320
+ y: {
321
+ signal: string;
322
+ field?: undefined;
323
+ };
324
+ startAngle: {
325
+ field: string;
326
+ };
327
+ endAngle: {
328
+ field: string;
329
+ };
330
+ innerRadius: {
331
+ signal: string;
332
+ };
333
+ outerRadius: {
334
+ signal: string;
335
+ };
336
+ stroke?: undefined;
337
+ strokeWidth?: undefined;
338
+ x2?: undefined;
339
+ y2?: undefined;
340
+ padAngle?: undefined;
341
+ cornerRadius?: undefined;
342
+ text?: undefined;
343
+ align?: undefined;
344
+ baseline?: undefined;
345
+ fontSize?: undefined;
346
+ font?: undefined;
347
+ fontWeight?: undefined;
348
+ limit?: undefined;
349
+ lineBreak?: undefined;
350
+ };
351
+ update?: undefined;
352
+ };
353
+ zindex: number;
354
+ interactive?: undefined;
355
+ } | {
356
+ type: string;
357
+ name: string;
358
+ from: {
359
+ data: string;
360
+ };
361
+ encode: {
362
+ enter: {
363
+ text: {
364
+ field: string;
365
+ value?: undefined;
366
+ };
367
+ align: {
368
+ value: string;
369
+ };
370
+ baseline: {
371
+ value: string;
372
+ };
373
+ fill: {
374
+ value: string;
375
+ scale?: undefined;
376
+ field?: undefined;
377
+ };
378
+ fontSize: {
379
+ value: number;
380
+ };
381
+ x: {
382
+ field: string;
383
+ signal?: undefined;
384
+ };
385
+ y: {
386
+ field: string;
387
+ signal?: undefined;
388
+ };
389
+ font: {
390
+ value: string;
391
+ };
392
+ fontWeight: number;
393
+ stroke?: undefined;
394
+ strokeWidth?: undefined;
395
+ x2?: undefined;
396
+ y2?: undefined;
397
+ startAngle?: undefined;
398
+ endAngle?: undefined;
399
+ innerRadius?: undefined;
400
+ outerRadius?: undefined;
401
+ padAngle?: undefined;
402
+ cornerRadius?: undefined;
403
+ limit?: undefined;
404
+ lineBreak?: undefined;
405
+ };
406
+ update?: undefined;
407
+ };
408
+ zindex?: undefined;
409
+ interactive?: undefined;
410
+ } | {
411
+ type: string;
412
+ encode: {
413
+ enter: {
414
+ text: {
415
+ value: string;
416
+ field?: undefined;
417
+ };
418
+ x: {
419
+ signal: string;
420
+ field?: undefined;
421
+ };
422
+ y: {
423
+ signal: string;
424
+ field?: undefined;
425
+ };
426
+ align: {
427
+ value: string;
428
+ };
429
+ baseline: {
430
+ value: string;
431
+ };
432
+ fontSize: {
433
+ value: number;
434
+ };
435
+ fontWeight: {
436
+ value: string;
437
+ };
438
+ fill: {
439
+ value: string;
440
+ scale?: undefined;
441
+ field?: undefined;
442
+ };
443
+ font: {
444
+ value: string;
445
+ };
446
+ stroke?: undefined;
447
+ strokeWidth?: undefined;
448
+ x2?: undefined;
449
+ y2?: undefined;
450
+ startAngle?: undefined;
451
+ endAngle?: undefined;
452
+ innerRadius?: undefined;
453
+ outerRadius?: undefined;
454
+ padAngle?: undefined;
455
+ cornerRadius?: undefined;
456
+ limit?: undefined;
457
+ lineBreak?: undefined;
458
+ };
459
+ update: {
460
+ text: {
461
+ signal: string;
462
+ };
463
+ opacity?: undefined;
464
+ };
465
+ };
466
+ name?: undefined;
467
+ from?: undefined;
468
+ zindex?: undefined;
469
+ interactive?: undefined;
470
+ } | {
471
+ type: string;
472
+ encode: {
473
+ enter: {
474
+ x: {
475
+ signal: string;
476
+ field?: undefined;
477
+ };
478
+ y: {
479
+ signal: string;
480
+ field?: undefined;
481
+ };
482
+ align: {
483
+ value: string;
484
+ };
485
+ baseline: {
486
+ value: string;
487
+ };
488
+ fontSize: {
489
+ value: number;
490
+ };
491
+ fill: {
492
+ value: string;
493
+ scale?: undefined;
494
+ field?: undefined;
495
+ };
496
+ font: {
497
+ value: string;
498
+ };
499
+ fontWeight: number;
500
+ limit: {
501
+ value: number;
502
+ };
503
+ lineBreak: {
504
+ value: string;
505
+ };
506
+ stroke?: undefined;
507
+ strokeWidth?: undefined;
508
+ x2?: undefined;
509
+ y2?: undefined;
510
+ startAngle?: undefined;
511
+ endAngle?: undefined;
512
+ innerRadius?: undefined;
513
+ outerRadius?: undefined;
514
+ padAngle?: undefined;
515
+ cornerRadius?: undefined;
516
+ text?: undefined;
517
+ };
518
+ update: {
519
+ text: {
520
+ signal: string;
521
+ };
522
+ opacity?: undefined;
523
+ };
524
+ };
525
+ name?: undefined;
526
+ from?: undefined;
527
+ zindex?: undefined;
528
+ interactive?: undefined;
529
+ })[];
530
+ }>;
531
+ render(): any;
532
+ }
533
+ export {};
@@ -0,0 +1,102 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { BarDataItem, BarSpec } from "./components/apollo-data-bar/apollo-data-bar";
9
+ import { DonutDataItem, DonutSpec } from "./components/apollo-data-donut/apollo-data-donut";
10
+ export { BarDataItem, BarSpec } from "./components/apollo-data-bar/apollo-data-bar";
11
+ export { DonutDataItem, DonutSpec } from "./components/apollo-data-donut/apollo-data-donut";
12
+ export namespace Components {
13
+ interface ApolloDataBarChart {
14
+ /**
15
+ * @default []
16
+ */
17
+ "adData": string | BarDataItem[];
18
+ /**
19
+ * @default null
20
+ */
21
+ "adSpec": string | BarSpec;
22
+ }
23
+ interface ApolloDataDonutChart {
24
+ /**
25
+ * Array of data items to display in the donut chart. Each item represents a segment with category and value.
26
+ * @property {string} category - Category name for the data segment
27
+ * @property {number} value - Numeric value for the donut chart segment
28
+ * @default []
29
+ */
30
+ "adData": string | DonutDataItem[];
31
+ /**
32
+ * Optional specification object for customizing the chart appearance
33
+ * @property {string[]} [colorSet] - Array of color hex codes for chart segments
34
+ * @property {string} [preffix] - A string added at the start of another string, like $ or a currency symbol.
35
+ * @property {string} [suffix] - A string added at the end of another string, like %, kg or a currency symbol.
36
+ * @property {string} [centerText] - A label string rendered at the center of the view.
37
+ * @default {}
38
+ */
39
+ "adSpec": string | DonutSpec;
40
+ }
41
+ }
42
+ declare global {
43
+ interface HTMLApolloDataBarChartElement extends Components.ApolloDataBarChart, HTMLStencilElement {
44
+ }
45
+ var HTMLApolloDataBarChartElement: {
46
+ prototype: HTMLApolloDataBarChartElement;
47
+ new (): HTMLApolloDataBarChartElement;
48
+ };
49
+ interface HTMLApolloDataDonutChartElement extends Components.ApolloDataDonutChart, HTMLStencilElement {
50
+ }
51
+ var HTMLApolloDataDonutChartElement: {
52
+ prototype: HTMLApolloDataDonutChartElement;
53
+ new (): HTMLApolloDataDonutChartElement;
54
+ };
55
+ interface HTMLElementTagNameMap {
56
+ "apollo-data-bar-chart": HTMLApolloDataBarChartElement;
57
+ "apollo-data-donut-chart": HTMLApolloDataDonutChartElement;
58
+ }
59
+ }
60
+ declare namespace LocalJSX {
61
+ interface ApolloDataBarChart {
62
+ /**
63
+ * @default []
64
+ */
65
+ "adData"?: string | BarDataItem[];
66
+ /**
67
+ * @default null
68
+ */
69
+ "adSpec"?: string | BarSpec;
70
+ }
71
+ interface ApolloDataDonutChart {
72
+ /**
73
+ * Array of data items to display in the donut chart. Each item represents a segment with category and value.
74
+ * @property {string} category - Category name for the data segment
75
+ * @property {number} value - Numeric value for the donut chart segment
76
+ * @default []
77
+ */
78
+ "adData"?: string | DonutDataItem[];
79
+ /**
80
+ * Optional specification object for customizing the chart appearance
81
+ * @property {string[]} [colorSet] - Array of color hex codes for chart segments
82
+ * @property {string} [preffix] - A string added at the start of another string, like $ or a currency symbol.
83
+ * @property {string} [suffix] - A string added at the end of another string, like %, kg or a currency symbol.
84
+ * @property {string} [centerText] - A label string rendered at the center of the view.
85
+ * @default {}
86
+ */
87
+ "adSpec"?: string | DonutSpec;
88
+ }
89
+ interface IntrinsicElements {
90
+ "apollo-data-bar-chart": ApolloDataBarChart;
91
+ "apollo-data-donut-chart": ApolloDataDonutChart;
92
+ }
93
+ }
94
+ export { LocalJSX as JSX };
95
+ declare module "@stencil/core" {
96
+ export namespace JSX {
97
+ interface IntrinsicElements {
98
+ "apollo-data-bar-chart": LocalJSX.ApolloDataBarChart & JSXBase.HTMLAttributes<HTMLApolloDataBarChartElement>;
99
+ "apollo-data-donut-chart": LocalJSX.ApolloDataDonutChart & JSXBase.HTMLAttributes<HTMLApolloDataDonutChartElement>;
100
+ }
101
+ }
102
+ }
@@ -0,0 +1,12 @@
1
+ import { BarDataItem, BarSpec } from '../components/apollo-data-bar/apollo-data-bar';
2
+ export interface BarExample {
3
+ name: string;
4
+ description: string;
5
+ props: {
6
+ adData: BarDataItem[];
7
+ adSpec?: BarSpec;
8
+ };
9
+ notes?: string;
10
+ }
11
+ /** periodId should be a date string (YYYY-MM-DD) representing the period. */
12
+ export declare const barExamples: BarExample[];
@@ -0,0 +1,11 @@
1
+ import { DonutDataItem, DonutSpec } from '../components/apollo-data-donut/apollo-data-donut';
2
+ export interface DonutExample {
3
+ name: string;
4
+ description: string;
5
+ props: {
6
+ adData: DonutDataItem[];
7
+ adSpec?: DonutSpec;
8
+ };
9
+ notes?: string;
10
+ }
11
+ export declare const donutExamples: DonutExample[];
@@ -0,0 +1,2 @@
1
+ export * from './apollo-data-donut.examples';
2
+ export * from './apollo-data-bar.examples';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview entry point for your component library
3
+ *
4
+ * This is the entry point for your component library. Use this file to export utilities,
5
+ * constants or data structure that accompany your components.
6
+ *
7
+ * DO NOT use this file to export your components. Instead, use the recommended approaches
8
+ * to consume components of this package as outlined in the `README.md`.
9
+ */
10
+ export { format } from './utils/utils';
11
+ export type * from './components';