@xplortech/apollo-data 0.0.4-draft.64ed229 → 0.0.4-draft.f74ef02

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 (31) hide show
  1. package/dist/apollo-data/apollo-data.esm.js +1 -1
  2. package/dist/apollo-data/p-2nuV5Vny.js +1 -0
  3. package/dist/apollo-data/p-4ac3c97c.entry.js +1 -0
  4. package/dist/apollo-data/p-BWkrM8dc.js +11 -0
  5. package/dist/apollo-data/p-b7471c12.entry.js +1 -0
  6. package/dist/apollo-data/p-e518baac.entry.js +1 -0
  7. package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +314 -0
  8. package/dist/{esm/apollo-data-bar-chart_3.entry.js → cjs/apollo-data-base-CxVQ-WVP.js} +2 -999
  9. package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +408 -0
  10. package/dist/cjs/apollo-data-line-chart_2.cjs.entry.js +534 -0
  11. package/dist/cjs/apollo-data.cjs.js +1 -1
  12. package/dist/cjs/constants-B3weDEpc.js +5 -0
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/collection-manifest.json +2 -1
  15. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +329 -0
  16. package/dist/collection/examples/apollo-data-scatter.examples.js +94 -0
  17. package/dist/components/apollo-data-scatter-chart.d.ts +11 -0
  18. package/dist/components/apollo-data-scatter-chart.js +1 -0
  19. package/dist/esm/apollo-data-bar-chart.entry.js +312 -0
  20. package/dist/{cjs/apollo-data-bar-chart_3.cjs.entry.js → esm/apollo-data-base-BWkrM8dc.js} +1 -1004
  21. package/dist/esm/apollo-data-donut-chart.entry.js +406 -0
  22. package/dist/esm/apollo-data-line-chart_2.entry.js +531 -0
  23. package/dist/esm/apollo-data.js +1 -1
  24. package/dist/esm/constants-2nuV5Vny.js +3 -0
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +329 -0
  27. package/dist/types/components.d.ts +55 -0
  28. package/dist/types/examples/apollo-data-scatter.examples.d.ts +11 -0
  29. package/package.json +1 -1
  30. package/src/examples/apollo-data-scatter.examples.ts +109 -0
  31. package/dist/apollo-data/p-725550f2.entry.js +0 -11
@@ -0,0 +1,329 @@
1
+ import { ComponentInterface } from '../../stencil-public-runtime';
2
+ import { ApolloBase } from '../../apollo-data-base';
3
+ export interface PointStyle {
4
+ shape?: 'circle' | 'square' | 'triangle';
5
+ opacity?: number;
6
+ color?: string;
7
+ size?: number;
8
+ }
9
+ export interface ScatterDataItem {
10
+ category: string;
11
+ xValue: number;
12
+ yValue: number;
13
+ pointStyle?: PointStyle;
14
+ }
15
+ export interface ScatterSpec {
16
+ yAxisTitle?: string;
17
+ xAxisTitle?: string;
18
+ defaultPointStyle?: PointStyle;
19
+ pointStyle?: PointStyle;
20
+ categoryPointStyleMap?: {
21
+ [categoryName: string]: PointStyle;
22
+ };
23
+ tooltip?: 'auto' | 'none';
24
+ }
25
+ export declare class ApolloDataScatterChart extends ApolloBase<ScatterDataItem[], ScatterSpec> implements ComponentInterface {
26
+ el: HTMLElement;
27
+ /**
28
+ * Represents a single data point in the scatter chart.
29
+ * @property {string} category - Category or group name associated with the data point.
30
+ * This can be used for legend grouping or category-based styling.
31
+ * @property {number} xValue - Numeric value plotted along the X-axis.
32
+ * @property {number} yValue - Numeric value plotted along the Y-axis.
33
+ * @property {PointStyle} [pointStyle] - Optional style override for this specific data point.
34
+ * If provided, it takes precedence over default or category-level styles.
35
+ */
36
+ adData: string | ScatterDataItem[];
37
+ /**
38
+ * Optional specification object for customizing the scatter chart configuration.
39
+ * @property {string} [yAxisTitle] - Label displayed for the Y-axis.
40
+ * @property {string} [xAxisTitle] - Label displayed for the X-axis.
41
+ * @property {PointStyle} [defaultPointStyle] - Default styling applied to all scatter points (e.g., size, color, shape, opacity).
42
+ * @property {PointStyle} [pointStyle] - Global point style override applied to all data points.
43
+ * @property {{ [categoryName: string]: PointStyle }} [categoryPointStyleMap] -
44
+ * A mapping object that allows custom point styles per category name.
45
+ * Each key represents a category, and its value defines the corresponding PointStyle.
46
+ * @property {'auto' | 'none'} [tooltip] - Controls tooltip behavior.
47
+ * 'auto' enables default tooltip rendering, while 'none' disables tooltips.
48
+ */
49
+ adSpec: string | ScatterSpec;
50
+ componentDidRender(): Promise<void>;
51
+ private DEFAULT_POINT_STYLE;
52
+ protected getViewData(data: ScatterDataItem[], spec?: ScatterSpec): Promise<{
53
+ $schema: string;
54
+ description: string;
55
+ width: number;
56
+ height: number;
57
+ padding: number;
58
+ autosize: {
59
+ type: string;
60
+ resize: boolean;
61
+ };
62
+ signals: ({
63
+ name: string;
64
+ value: number;
65
+ update?: undefined;
66
+ } | {
67
+ name: string;
68
+ update: string;
69
+ value?: undefined;
70
+ })[];
71
+ data: ({
72
+ name: string;
73
+ values: {
74
+ category: string;
75
+ xValue: number;
76
+ yValue: number;
77
+ color: string;
78
+ shape: "square" | "circle" | "triangle";
79
+ opacity: number;
80
+ }[];
81
+ source?: undefined;
82
+ transform?: undefined;
83
+ } | {
84
+ name: string;
85
+ source: string;
86
+ transform: ({
87
+ type: string;
88
+ expr: string;
89
+ } | {
90
+ type: string;
91
+ expr?: undefined;
92
+ })[];
93
+ values?: undefined;
94
+ })[];
95
+ scales: {
96
+ name: string;
97
+ type: string;
98
+ range: (number | {
99
+ signal: string;
100
+ })[];
101
+ nice: boolean;
102
+ domain: {
103
+ data: string;
104
+ field: string;
105
+ };
106
+ }[];
107
+ axes: {
108
+ orient: string;
109
+ scale: string;
110
+ offset: number;
111
+ format: string;
112
+ title: string;
113
+ }[];
114
+ marks: ({
115
+ type: string;
116
+ from: {
117
+ data: string;
118
+ };
119
+ encode: {
120
+ enter: {
121
+ size: {
122
+ value: number;
123
+ };
124
+ tooltip: {
125
+ field: string;
126
+ };
127
+ };
128
+ update: {
129
+ x: {
130
+ scale: string;
131
+ field: string;
132
+ signal?: undefined;
133
+ offset?: undefined;
134
+ };
135
+ y: {
136
+ scale: string;
137
+ field: string;
138
+ signal?: undefined;
139
+ offset?: undefined;
140
+ };
141
+ fill: {
142
+ field: string;
143
+ value?: undefined;
144
+ };
145
+ fillOpacity: {
146
+ field: string;
147
+ value?: undefined;
148
+ };
149
+ shape: {
150
+ field: string;
151
+ };
152
+ zindex: {
153
+ value: number;
154
+ };
155
+ text?: undefined;
156
+ align?: undefined;
157
+ baseline?: undefined;
158
+ fontSize?: undefined;
159
+ };
160
+ hover: {
161
+ fill: {
162
+ value: string;
163
+ };
164
+ fillOpacity: {
165
+ value: number;
166
+ };
167
+ zindex: {
168
+ value: number;
169
+ };
170
+ };
171
+ };
172
+ interactive?: undefined;
173
+ } | {
174
+ type: string;
175
+ from: {
176
+ data: string;
177
+ };
178
+ encode: {
179
+ enter: {
180
+ size: {
181
+ value: number;
182
+ };
183
+ tooltip: {
184
+ field: string;
185
+ };
186
+ };
187
+ update: {
188
+ x: {
189
+ scale: string;
190
+ field: string;
191
+ signal?: undefined;
192
+ offset?: undefined;
193
+ };
194
+ y: {
195
+ signal: string;
196
+ scale?: undefined;
197
+ field?: undefined;
198
+ offset?: undefined;
199
+ };
200
+ fill: {
201
+ value: string;
202
+ field?: undefined;
203
+ };
204
+ fillOpacity: {
205
+ value: number;
206
+ field?: undefined;
207
+ };
208
+ shape?: undefined;
209
+ zindex?: undefined;
210
+ text?: undefined;
211
+ align?: undefined;
212
+ baseline?: undefined;
213
+ fontSize?: undefined;
214
+ };
215
+ hover: {
216
+ fill: {
217
+ value: string;
218
+ };
219
+ fillOpacity: {
220
+ value: number;
221
+ };
222
+ zindex?: undefined;
223
+ };
224
+ };
225
+ interactive?: undefined;
226
+ } | {
227
+ type: string;
228
+ from: {
229
+ data: string;
230
+ };
231
+ encode: {
232
+ enter: {
233
+ size: {
234
+ value: number;
235
+ };
236
+ tooltip: {
237
+ field: string;
238
+ };
239
+ };
240
+ update: {
241
+ x: {
242
+ signal: string;
243
+ scale?: undefined;
244
+ field?: undefined;
245
+ offset?: undefined;
246
+ };
247
+ y: {
248
+ scale: string;
249
+ field: string;
250
+ signal?: undefined;
251
+ offset?: undefined;
252
+ };
253
+ fill: {
254
+ value: string;
255
+ field?: undefined;
256
+ };
257
+ fillOpacity: {
258
+ value: number;
259
+ field?: undefined;
260
+ };
261
+ zindex: {
262
+ value: number;
263
+ };
264
+ shape?: undefined;
265
+ text?: undefined;
266
+ align?: undefined;
267
+ baseline?: undefined;
268
+ fontSize?: undefined;
269
+ };
270
+ hover: {
271
+ fill: {
272
+ value: string;
273
+ };
274
+ fillOpacity: {
275
+ value: number;
276
+ };
277
+ zindex: {
278
+ value: number;
279
+ };
280
+ };
281
+ };
282
+ interactive?: undefined;
283
+ } | {
284
+ type: string;
285
+ interactive: boolean;
286
+ from: {
287
+ data: string;
288
+ };
289
+ encode: {
290
+ update: {
291
+ x: {
292
+ signal: string;
293
+ offset: number;
294
+ scale?: undefined;
295
+ field?: undefined;
296
+ };
297
+ y: {
298
+ signal: string;
299
+ offset: number;
300
+ scale?: undefined;
301
+ field?: undefined;
302
+ };
303
+ text: {
304
+ signal: string;
305
+ };
306
+ align: {
307
+ value: string;
308
+ };
309
+ baseline: {
310
+ value: string;
311
+ };
312
+ fill: {
313
+ value: string;
314
+ field?: undefined;
315
+ };
316
+ fontSize: {
317
+ value: number;
318
+ };
319
+ fillOpacity?: undefined;
320
+ shape?: undefined;
321
+ zindex?: undefined;
322
+ };
323
+ enter?: undefined;
324
+ hover?: undefined;
325
+ };
326
+ })[];
327
+ }>;
328
+ render(): any;
329
+ }
@@ -8,9 +8,11 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { BarDataItem, BarSpec } from "./components/apollo-data-bar/apollo-data-bar";
9
9
  import { DonutDataItem, DonutSpec } from "./components/apollo-data-donut/apollo-data-donut";
10
10
  import { LineDataItem, LineSpec } from "./components/apollo-data-line/apollo-data-line";
11
+ import { ScatterDataItem, ScatterSpec } from "./components/apollo-data-scatter/apollo-data-scatter";
11
12
  export { BarDataItem, BarSpec } from "./components/apollo-data-bar/apollo-data-bar";
12
13
  export { DonutDataItem, DonutSpec } from "./components/apollo-data-donut/apollo-data-donut";
13
14
  export { LineDataItem, LineSpec } from "./components/apollo-data-line/apollo-data-line";
15
+ export { ScatterDataItem, ScatterSpec } from "./components/apollo-data-scatter/apollo-data-scatter";
14
16
  export namespace Components {
15
17
  interface ApolloDataBarChart {
16
18
  /**
@@ -50,6 +52,28 @@ export namespace Components {
50
52
  */
51
53
  "adSpec": string | LineSpec;
52
54
  }
55
+ interface ApolloDataScatterChart {
56
+ /**
57
+ * Represents a single data point in the scatter chart.
58
+ * @property {string} category - Category or group name associated with the data point. This can be used for legend grouping or category-based styling.
59
+ * @property {number} xValue - Numeric value plotted along the X-axis.
60
+ * @property {number} yValue - Numeric value plotted along the Y-axis.
61
+ * @property {PointStyle} [pointStyle] - Optional style override for this specific data point. If provided, it takes precedence over default or category-level styles.
62
+ * @default []
63
+ */
64
+ "adData": string | ScatterDataItem[];
65
+ /**
66
+ * Optional specification object for customizing the scatter chart configuration.
67
+ * @property {string} [yAxisTitle] - Label displayed for the Y-axis.
68
+ * @property {string} [xAxisTitle] - Label displayed for the X-axis.
69
+ * @property {PointStyle} [defaultPointStyle] - Default styling applied to all scatter points (e.g., size, color, shape, opacity).
70
+ * @property {PointStyle} [pointStyle] - Global point style override applied to all data points.
71
+ * @property {{ [categoryName: string]: PointStyle }} [categoryPointStyleMap] - A mapping object that allows custom point styles per category name. Each key represents a category, and its value defines the corresponding PointStyle.
72
+ * @property {'auto' | 'none'} [tooltip] - Controls tooltip behavior. 'auto' enables default tooltip rendering, while 'none' disables tooltips.
73
+ * @default {}
74
+ */
75
+ "adSpec": string | ScatterSpec;
76
+ }
53
77
  }
54
78
  declare global {
55
79
  interface HTMLApolloDataBarChartElement extends Components.ApolloDataBarChart, HTMLStencilElement {
@@ -70,10 +94,17 @@ declare global {
70
94
  prototype: HTMLApolloDataLineChartElement;
71
95
  new (): HTMLApolloDataLineChartElement;
72
96
  };
97
+ interface HTMLApolloDataScatterChartElement extends Components.ApolloDataScatterChart, HTMLStencilElement {
98
+ }
99
+ var HTMLApolloDataScatterChartElement: {
100
+ prototype: HTMLApolloDataScatterChartElement;
101
+ new (): HTMLApolloDataScatterChartElement;
102
+ };
73
103
  interface HTMLElementTagNameMap {
74
104
  "apollo-data-bar-chart": HTMLApolloDataBarChartElement;
75
105
  "apollo-data-donut-chart": HTMLApolloDataDonutChartElement;
76
106
  "apollo-data-line-chart": HTMLApolloDataLineChartElement;
107
+ "apollo-data-scatter-chart": HTMLApolloDataScatterChartElement;
77
108
  }
78
109
  }
79
110
  declare namespace LocalJSX {
@@ -115,10 +146,33 @@ declare namespace LocalJSX {
115
146
  */
116
147
  "adSpec"?: string | LineSpec;
117
148
  }
149
+ interface ApolloDataScatterChart {
150
+ /**
151
+ * Represents a single data point in the scatter chart.
152
+ * @property {string} category - Category or group name associated with the data point. This can be used for legend grouping or category-based styling.
153
+ * @property {number} xValue - Numeric value plotted along the X-axis.
154
+ * @property {number} yValue - Numeric value plotted along the Y-axis.
155
+ * @property {PointStyle} [pointStyle] - Optional style override for this specific data point. If provided, it takes precedence over default or category-level styles.
156
+ * @default []
157
+ */
158
+ "adData"?: string | ScatterDataItem[];
159
+ /**
160
+ * Optional specification object for customizing the scatter chart configuration.
161
+ * @property {string} [yAxisTitle] - Label displayed for the Y-axis.
162
+ * @property {string} [xAxisTitle] - Label displayed for the X-axis.
163
+ * @property {PointStyle} [defaultPointStyle] - Default styling applied to all scatter points (e.g., size, color, shape, opacity).
164
+ * @property {PointStyle} [pointStyle] - Global point style override applied to all data points.
165
+ * @property {{ [categoryName: string]: PointStyle }} [categoryPointStyleMap] - A mapping object that allows custom point styles per category name. Each key represents a category, and its value defines the corresponding PointStyle.
166
+ * @property {'auto' | 'none'} [tooltip] - Controls tooltip behavior. 'auto' enables default tooltip rendering, while 'none' disables tooltips.
167
+ * @default {}
168
+ */
169
+ "adSpec"?: string | ScatterSpec;
170
+ }
118
171
  interface IntrinsicElements {
119
172
  "apollo-data-bar-chart": ApolloDataBarChart;
120
173
  "apollo-data-donut-chart": ApolloDataDonutChart;
121
174
  "apollo-data-line-chart": ApolloDataLineChart;
175
+ "apollo-data-scatter-chart": ApolloDataScatterChart;
122
176
  }
123
177
  }
124
178
  export { LocalJSX as JSX };
@@ -128,6 +182,7 @@ declare module "@stencil/core" {
128
182
  "apollo-data-bar-chart": LocalJSX.ApolloDataBarChart & JSXBase.HTMLAttributes<HTMLApolloDataBarChartElement>;
129
183
  "apollo-data-donut-chart": LocalJSX.ApolloDataDonutChart & JSXBase.HTMLAttributes<HTMLApolloDataDonutChartElement>;
130
184
  "apollo-data-line-chart": LocalJSX.ApolloDataLineChart & JSXBase.HTMLAttributes<HTMLApolloDataLineChartElement>;
185
+ "apollo-data-scatter-chart": LocalJSX.ApolloDataScatterChart & JSXBase.HTMLAttributes<HTMLApolloDataScatterChartElement>;
131
186
  }
132
187
  }
133
188
  }
@@ -0,0 +1,11 @@
1
+ import { ScatterDataItem, ScatterSpec } from '../components';
2
+ export interface ScatterExamples {
3
+ name: string;
4
+ description: string;
5
+ props: {
6
+ adData: ScatterDataItem[];
7
+ adSpec?: ScatterSpec;
8
+ };
9
+ notes?: string;
10
+ }
11
+ export declare const scatterExamples: ScatterExamples[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xplortech/apollo-data",
3
- "version": "0.0.4-draft.64ed229",
3
+ "version": "0.0.4-draft.f74ef02",
4
4
  "description": "Apollo Data",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -0,0 +1,109 @@
1
+ import { ScatterDataItem, ScatterSpec } from '../components';
2
+
3
+ // Use the component's prop types directly
4
+ export interface ScatterExamples {
5
+ name: string;
6
+ description: string;
7
+ props: {
8
+ adData: ScatterDataItem[];
9
+ adSpec?: ScatterSpec;
10
+ // Future: add event handlers when component supports them
11
+ // onSliceClick?: (item: ScatterDataItem) => void;
12
+ };
13
+ notes?: string; // Optional additional documentation
14
+ }
15
+
16
+ export const scatterExamples: ScatterExamples[] = [
17
+ {
18
+ name: 'Basic Scatter Chart',
19
+ description: 'A simple scatter chart using default styling and automatic tooltips.',
20
+ props: {
21
+ adData: [
22
+ { category: 'A', xValue: 120, yValue: 4.5 },
23
+ { category: 'B', xValue: 340, yValue: 6.8 },
24
+ { category: 'C', xValue: 560, yValue: 7.2 },
25
+ { category: 'A', xValue: 230, yValue: 5.1 },
26
+ { category: 'B', xValue: 890, yValue: 8.4 },
27
+ ],
28
+ adSpec: {
29
+ xAxisTitle: 'Revenue',
30
+ yAxisTitle: 'Rating',
31
+ tooltip: 'auto',
32
+ },
33
+ },
34
+ notes: 'Uses defaultPointStyle internally. No category-based styling applied.',
35
+ },
36
+ {
37
+ name: 'Category Styled Scatter',
38
+ description: 'Scatter chart with custom styles per category using categoryPointStyleMap.',
39
+ props: {
40
+ adData: [
41
+ { category: 'Mobile', xValue: 150, yValue: 3.8 },
42
+ { category: 'Web', xValue: 980, yValue: 7.9 },
43
+ { category: 'Backend', xValue: 670, yValue: 6.7 },
44
+ { category: 'Mobile', xValue: 300, yValue: 5.6 },
45
+ ],
46
+ adSpec: {
47
+ xAxisTitle: 'Users',
48
+ yAxisTitle: 'Performance Score',
49
+ tooltip: 'auto',
50
+ categoryPointStyleMap: {
51
+ Mobile: { color: '#4ECDC4', size: 100, shape: 'circle' },
52
+ Web: { color: '#FF6B6B', size: 120, shape: 'square' },
53
+ Backend: { color: '#6A6D7D', size: 140, shape: 'triangle' },
54
+ },
55
+ },
56
+ },
57
+ notes: 'Each category overrides the defaultPointStyle using categoryPointStyleMap.',
58
+ },
59
+ {
60
+ name: 'Per-Point Style Override',
61
+ description: 'Individual data points override category and default styles.',
62
+ props: {
63
+ adData: [
64
+ {
65
+ category: 'Sales',
66
+ xValue: 400,
67
+ yValue: 6.2,
68
+ pointStyle: { color: '#FF0000', size: 180, shape: 'triangle' },
69
+ },
70
+ {
71
+ category: 'Sales',
72
+ xValue: 520,
73
+ yValue: 7.1,
74
+ },
75
+ {
76
+ category: 'Marketing',
77
+ xValue: 310,
78
+ yValue: 5.4,
79
+ pointStyle: { color: '#000000', size: 160, shape: 'square' },
80
+ },
81
+ ],
82
+ adSpec: {
83
+ xAxisTitle: 'Spend',
84
+ yAxisTitle: 'Conversion Rate',
85
+ defaultPointStyle: { color: '#6A6D7D', size: 100, shape: 'circle' },
86
+ tooltip: 'auto',
87
+ },
88
+ },
89
+ notes: 'pointStyle at the data level has highest priority over category and default styles.',
90
+ },
91
+ {
92
+ name: 'Tooltip Disabled',
93
+ description: 'Scatter chart with tooltips disabled.',
94
+ props: {
95
+ adData: [
96
+ { category: 'Q1', xValue: 200, yValue: 4.2 },
97
+ { category: 'Q2', xValue: 450, yValue: 6.5 },
98
+ { category: 'Q3', xValue: 700, yValue: 8.1 },
99
+ { category: 'Q4', xValue: 300, yValue: 5.9 },
100
+ ],
101
+ adSpec: {
102
+ xAxisTitle: 'Quarter',
103
+ yAxisTitle: 'Growth',
104
+ tooltip: 'none',
105
+ },
106
+ },
107
+ notes: 'Tooltip interaction is completely disabled in this example.',
108
+ },
109
+ ];