@xplortech/apollo-data 0.0.4 → 0.0.5
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/dist/apollo-data/apollo-data.esm.js +1 -1
- package/dist/apollo-data/p-2nuV5Vny.js +1 -0
- package/dist/apollo-data/p-4ac3c97c.entry.js +1 -0
- package/dist/apollo-data/p-BWkrM8dc.js +11 -0
- package/dist/apollo-data/p-b7471c12.entry.js +1 -0
- package/dist/apollo-data/p-e518baac.entry.js +1 -0
- package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +314 -0
- package/dist/cjs/{apollo-data-bar-chart_2.cjs.entry.js → apollo-data-base-CxVQ-WVP.js} +1 -715
- package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +408 -0
- package/dist/cjs/apollo-data-line-chart_2.cjs.entry.js +534 -0
- package/dist/cjs/apollo-data.cjs.js +1 -1
- package/dist/cjs/constants-B3weDEpc.js +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/apollo-data-line/apollo-data-line.js +346 -0
- package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +329 -0
- package/dist/collection/examples/apollo-data-line.examples.js +91 -0
- package/dist/collection/examples/apollo-data-scatter.examples.js +94 -0
- package/dist/collection/examples/index.js +1 -0
- package/dist/components/apollo-data-bar-chart.js +1 -1
- package/dist/components/apollo-data-line-chart.d.ts +11 -0
- package/dist/components/apollo-data-line-chart.js +1 -0
- package/dist/components/apollo-data-scatter-chart.d.ts +11 -0
- package/dist/components/apollo-data-scatter-chart.js +1 -0
- package/dist/components/p-2nuV5Vny.js +1 -0
- package/dist/esm/apollo-data-bar-chart.entry.js +312 -0
- package/dist/esm/{apollo-data-bar-chart_2.entry.js → apollo-data-base-BWkrM8dc.js} +1 -714
- package/dist/esm/apollo-data-donut-chart.entry.js +406 -0
- package/dist/esm/apollo-data-line-chart_2.entry.js +531 -0
- package/dist/esm/apollo-data.js +1 -1
- package/dist/esm/constants-2nuV5Vny.js +3 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/apollo-data-line/apollo-data-line.d.ts +244 -0
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +329 -0
- package/dist/types/components.d.ts +86 -0
- package/dist/types/examples/apollo-data-line.examples.d.ts +12 -0
- package/dist/types/examples/apollo-data-scatter.examples.d.ts +11 -0
- package/dist/types/examples/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/examples/apollo-data-line.examples.ts +103 -0
- package/src/examples/apollo-data-scatter.examples.ts +109 -0
- package/src/examples/index.ts +2 -1
- package/dist/apollo-data/p-e6584598.entry.js +0 -11
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Cl7HgRm0.js');
|
|
4
|
+
var apolloDataBase = require('./apollo-data-base-CxVQ-WVP.js');
|
|
5
|
+
var constants = require('./constants-B3weDEpc.js');
|
|
6
|
+
|
|
7
|
+
const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
8
|
+
function lineStyleToStrokeDash(lineStyle) {
|
|
9
|
+
switch (lineStyle) {
|
|
10
|
+
case 'dashed':
|
|
11
|
+
return [6, 4];
|
|
12
|
+
case 'dotted':
|
|
13
|
+
return [2, 2];
|
|
14
|
+
case 'solid':
|
|
15
|
+
default:
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const ApolloDataLineChart = class extends apolloDataBase.ApolloBase {
|
|
20
|
+
constructor(hostRef) {
|
|
21
|
+
super();
|
|
22
|
+
index.registerInstance(this, hostRef);
|
|
23
|
+
}
|
|
24
|
+
get el() { return index.getElement(this); }
|
|
25
|
+
adData = [];
|
|
26
|
+
adSpec = null;
|
|
27
|
+
static tooltipStylesInjected = false;
|
|
28
|
+
componentDidLoad() {
|
|
29
|
+
this.injectTooltipStyles();
|
|
30
|
+
}
|
|
31
|
+
async componentDidRender() {
|
|
32
|
+
await this.renderChart();
|
|
33
|
+
}
|
|
34
|
+
injectTooltipStyles() {
|
|
35
|
+
if (ApolloDataLineChart.tooltipStylesInjected) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const styleId = 'apollo-data-line-tooltip-styles';
|
|
39
|
+
if (document.getElementById(styleId)) {
|
|
40
|
+
ApolloDataLineChart.tooltipStylesInjected = true;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const style = document.createElement('style');
|
|
44
|
+
style.id = styleId;
|
|
45
|
+
style.textContent = `
|
|
46
|
+
#vg-tooltip-element {
|
|
47
|
+
background-color: #ffffff;
|
|
48
|
+
border: 1px solid #e1e2e8;
|
|
49
|
+
border-radius: 0.25rem;
|
|
50
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);
|
|
51
|
+
font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
padding: 0.25rem 0.75rem;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
text-align: center;
|
|
56
|
+
transform: translateY(20%);
|
|
57
|
+
white-space: pre;
|
|
58
|
+
z-index: 999999999;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#vg-tooltip-element table tr td.key {
|
|
62
|
+
color: #6a6d7d;
|
|
63
|
+
text-align: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#vg-tooltip-element table tr td.value {
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#vg-tooltip-element.dark-theme {
|
|
71
|
+
background-color: #292632;
|
|
72
|
+
border: 1px solid #6a6d7d;
|
|
73
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);
|
|
74
|
+
color: #ffffff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#vg-tooltip-element::after {
|
|
78
|
+
border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
|
|
79
|
+
border-style: solid;
|
|
80
|
+
border-width: 9px;
|
|
81
|
+
bottom: -17px;
|
|
82
|
+
content: '';
|
|
83
|
+
left: 50%;
|
|
84
|
+
position: absolute;
|
|
85
|
+
transform: translateX(-50%);
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
document.head.appendChild(style);
|
|
89
|
+
ApolloDataLineChart.tooltipStylesInjected = true;
|
|
90
|
+
}
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
async getViewData(data, spec) {
|
|
93
|
+
if (!spec) {
|
|
94
|
+
throw new Error('adSpec is required for apollo-data-line-chart');
|
|
95
|
+
}
|
|
96
|
+
const { tooltipPrefix = '', currencySymbol = '' } = spec;
|
|
97
|
+
if (!data || data.length === 0) {
|
|
98
|
+
throw new Error('Data is required for apollo-data-line-chart');
|
|
99
|
+
}
|
|
100
|
+
const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
|
|
101
|
+
const uniqueXValues = [...new Set(data.map(item => item.xValue))].sort((a, b) => a - b);
|
|
102
|
+
const colorSet = spec?.colorSet ?? constants.CHART_COLORS;
|
|
103
|
+
const xLabelData = uniqueXValues.map(x => {
|
|
104
|
+
const first = data.find(d => d.xValue === x);
|
|
105
|
+
return { xValue: x, displayLabel: first?.xLabel != null ? first.xLabel : String(x) };
|
|
106
|
+
});
|
|
107
|
+
const formatNumber = tooltipPrefix ? '.2f' : '.0f';
|
|
108
|
+
const currencyPrefix = tooltipPrefix ? currencySymbol : '';
|
|
109
|
+
const pointShape = spec.pointStyle ?? 'circle';
|
|
110
|
+
const strokeDash = lineStyleToStrokeDash(spec.lineStyle ?? 'solid');
|
|
111
|
+
const dataSpec = [
|
|
112
|
+
{ name: 'raw', values: data },
|
|
113
|
+
{ name: 'xLabelData', values: xLabelData },
|
|
114
|
+
];
|
|
115
|
+
uniqueCategories.forEach((cat, i) => {
|
|
116
|
+
dataSpec.push({
|
|
117
|
+
name: `series_${i}`,
|
|
118
|
+
source: 'raw',
|
|
119
|
+
transform: [
|
|
120
|
+
{ type: 'filter', expr: `datum.category === ${JSON.stringify(cat)}` },
|
|
121
|
+
{ type: 'collect', sort: { field: 'xValue' } },
|
|
122
|
+
],
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
const lineMarks = uniqueCategories.map((_, i) => ({
|
|
126
|
+
type: 'line',
|
|
127
|
+
from: { data: `series_${i}` },
|
|
128
|
+
encode: {
|
|
129
|
+
enter: {
|
|
130
|
+
x: { scale: 'x', field: 'xValue' },
|
|
131
|
+
y: { scale: 'y', field: 'yValue' },
|
|
132
|
+
stroke: { value: colorSet[i % colorSet.length] },
|
|
133
|
+
strokeWidth: { value: 2 },
|
|
134
|
+
interpolate: { value: 'monotone' },
|
|
135
|
+
...(strokeDash.length > 0 ? { strokeDash: { value: strokeDash } } : {}),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}));
|
|
139
|
+
return {
|
|
140
|
+
$schema: 'https://vega.github.io/schema/vega/v5.json',
|
|
141
|
+
config: {
|
|
142
|
+
text: {
|
|
143
|
+
fill: '#6a6d7d',
|
|
144
|
+
font: FONT_FAMILY,
|
|
145
|
+
labelFontSize: 12,
|
|
146
|
+
labelFontWeight: 400,
|
|
147
|
+
},
|
|
148
|
+
axis: {
|
|
149
|
+
labelColor: '#6a6d7d',
|
|
150
|
+
titleColor: '#6a6d7d',
|
|
151
|
+
labelFont: FONT_FAMILY,
|
|
152
|
+
titleFont: FONT_FAMILY,
|
|
153
|
+
titleFontWeight: 400,
|
|
154
|
+
},
|
|
155
|
+
legend: {
|
|
156
|
+
labelColor: '#6a6d7d',
|
|
157
|
+
titleColor: '#6a6d7d',
|
|
158
|
+
labelFont: FONT_FAMILY,
|
|
159
|
+
titleFont: FONT_FAMILY,
|
|
160
|
+
labelFontSize: 12,
|
|
161
|
+
labelLimit: 95,
|
|
162
|
+
},
|
|
163
|
+
title: {
|
|
164
|
+
color: '#6a6d7d',
|
|
165
|
+
font: FONT_FAMILY,
|
|
166
|
+
labelFontSize: 12,
|
|
167
|
+
labelFontWeight: 400,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
height: 250,
|
|
171
|
+
autosize: { type: 'fit-x', contains: 'padding', resize: true },
|
|
172
|
+
signals: [
|
|
173
|
+
{
|
|
174
|
+
name: 'containerW',
|
|
175
|
+
update: 'max(containerSize()[0], 400)',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'legendColumns',
|
|
179
|
+
update: 'ceil(containerW / 140)',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
width: { signal: 'containerW' },
|
|
183
|
+
data: dataSpec,
|
|
184
|
+
scales: [
|
|
185
|
+
{
|
|
186
|
+
name: 'x',
|
|
187
|
+
type: 'point',
|
|
188
|
+
domain: uniqueXValues,
|
|
189
|
+
range: 'width',
|
|
190
|
+
padding: 0.5,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'xLabels',
|
|
194
|
+
type: 'ordinal',
|
|
195
|
+
domain: { data: 'xLabelData', field: 'xValue' },
|
|
196
|
+
range: { data: 'xLabelData', field: 'displayLabel' },
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'y',
|
|
200
|
+
type: 'linear',
|
|
201
|
+
domain: { data: 'raw', field: 'yValue' },
|
|
202
|
+
nice: true,
|
|
203
|
+
zero: true,
|
|
204
|
+
range: 'height',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'color',
|
|
208
|
+
type: 'ordinal',
|
|
209
|
+
domain: uniqueCategories,
|
|
210
|
+
range: spec?.colorSet ?? constants.CHART_COLORS,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
axes: [
|
|
214
|
+
{
|
|
215
|
+
orient: 'bottom',
|
|
216
|
+
scale: 'x',
|
|
217
|
+
title: spec?.xAxisTitle,
|
|
218
|
+
labelPadding: 12,
|
|
219
|
+
titlePadding: 12,
|
|
220
|
+
labelAngle: -90,
|
|
221
|
+
labelAlign: 'right',
|
|
222
|
+
labelBaseline: 'middle',
|
|
223
|
+
tickSize: 3,
|
|
224
|
+
labelFontSize: 12,
|
|
225
|
+
titleFontSize: 14,
|
|
226
|
+
ticks: false,
|
|
227
|
+
domain: false,
|
|
228
|
+
encode: {
|
|
229
|
+
labels: {
|
|
230
|
+
update: {
|
|
231
|
+
text: { signal: "scale('xLabels', datum.value)" },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
orient: 'left',
|
|
238
|
+
scale: 'y',
|
|
239
|
+
title: spec?.yAxisTitle || '',
|
|
240
|
+
format: ',.0f',
|
|
241
|
+
grid: true,
|
|
242
|
+
tickCount: 6,
|
|
243
|
+
labelFontSize: 12,
|
|
244
|
+
titleFontSize: 14,
|
|
245
|
+
ticks: false,
|
|
246
|
+
domain: false,
|
|
247
|
+
tickBand: 'extent',
|
|
248
|
+
labelPadding: 10,
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
legends: [
|
|
252
|
+
{
|
|
253
|
+
stroke: 'color',
|
|
254
|
+
orient: 'bottom',
|
|
255
|
+
direction: 'horizontal',
|
|
256
|
+
columns: { signal: 'legendColumns' },
|
|
257
|
+
title: null,
|
|
258
|
+
symbolType: 'stroke',
|
|
259
|
+
symbolStrokeWidth: 3,
|
|
260
|
+
rowPadding: 8,
|
|
261
|
+
symbolOffset: -35,
|
|
262
|
+
symbolSize: 100,
|
|
263
|
+
labelOffset: 8,
|
|
264
|
+
labelLimit: 95,
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
marks: [
|
|
268
|
+
...lineMarks,
|
|
269
|
+
{
|
|
270
|
+
type: 'symbol',
|
|
271
|
+
from: { data: 'raw' },
|
|
272
|
+
encode: {
|
|
273
|
+
enter: {
|
|
274
|
+
x: { scale: 'x', field: 'xValue' },
|
|
275
|
+
y: { scale: 'y', field: 'yValue' },
|
|
276
|
+
fill: { scale: 'color', field: 'category' },
|
|
277
|
+
size: { value: 50 },
|
|
278
|
+
shape: { value: pointShape },
|
|
279
|
+
tooltip: {
|
|
280
|
+
signal: `(datum.xLabel != null ? datum.xLabel : format(datum.xValue, ',.0f')) + ' · ' + datum.category + ': ' + (datum.yLabel != null ? datum.yLabel : '${currencyPrefix}' + format(datum.yValue, ',${formatNumber}'))`,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
render() {
|
|
289
|
+
return (index.h(index.Host, { key: '7799f01536f212d7a06da08c1e463d8529c5bf21' }, index.h("div", { key: '25463f10bbc0f5443c35ab03b5b53164d9ad1efd', id: "container", style: { width: '100%', height: '100%' } })));
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const ApolloDataScatterChart = class extends apolloDataBase.ApolloBase {
|
|
294
|
+
constructor(hostRef) {
|
|
295
|
+
super();
|
|
296
|
+
index.registerInstance(this, hostRef);
|
|
297
|
+
}
|
|
298
|
+
get el() { return index.getElement(this); }
|
|
299
|
+
/**
|
|
300
|
+
* Represents a single data point in the scatter chart.
|
|
301
|
+
* @property {string} category - Category or group name associated with the data point.
|
|
302
|
+
* This can be used for legend grouping or category-based styling.
|
|
303
|
+
* @property {number} xValue - Numeric value plotted along the X-axis.
|
|
304
|
+
* @property {number} yValue - Numeric value plotted along the Y-axis.
|
|
305
|
+
* @property {PointStyle} [pointStyle] - Optional style override for this specific data point.
|
|
306
|
+
* If provided, it takes precedence over default or category-level styles.
|
|
307
|
+
*/
|
|
308
|
+
adData = [];
|
|
309
|
+
/**
|
|
310
|
+
* Optional specification object for customizing the scatter chart configuration.
|
|
311
|
+
* @property {string} [yAxisTitle] - Label displayed for the Y-axis.
|
|
312
|
+
* @property {string} [xAxisTitle] - Label displayed for the X-axis.
|
|
313
|
+
* @property {PointStyle} [defaultPointStyle] - Default styling applied to all scatter points (e.g., size, color, shape, opacity).
|
|
314
|
+
* @property {PointStyle} [pointStyle] - Global point style override applied to all data points.
|
|
315
|
+
* @property {{ [categoryName: string]: PointStyle }} [categoryPointStyleMap] -
|
|
316
|
+
* A mapping object that allows custom point styles per category name.
|
|
317
|
+
* Each key represents a category, and its value defines the corresponding PointStyle.
|
|
318
|
+
* @property {'auto' | 'none'} [tooltip] - Controls tooltip behavior.
|
|
319
|
+
* 'auto' enables default tooltip rendering, while 'none' disables tooltips.
|
|
320
|
+
*/
|
|
321
|
+
adSpec = {};
|
|
322
|
+
async componentDidRender() {
|
|
323
|
+
await this.renderChart();
|
|
324
|
+
}
|
|
325
|
+
DEFAULT_POINT_STYLE = {
|
|
326
|
+
shape: 'circle',
|
|
327
|
+
opacity: 1,
|
|
328
|
+
color: 'blue',
|
|
329
|
+
size: 1,
|
|
330
|
+
};
|
|
331
|
+
// @ts-ignore
|
|
332
|
+
async getViewData(data, spec) {
|
|
333
|
+
const dataItemsToUse = data.map(dataItem => {
|
|
334
|
+
const pointStylesToUse = {};
|
|
335
|
+
Object.keys(this.DEFAULT_POINT_STYLE).forEach(key => {
|
|
336
|
+
const value = dataItem.pointStyle?.[key] ??
|
|
337
|
+
dataItem?.[key] ??
|
|
338
|
+
spec.categoryPointStyleMap?.[dataItem.category]?.[key] ??
|
|
339
|
+
spec.defaultPointStyle?.[key] ??
|
|
340
|
+
this.DEFAULT_POINT_STYLE[key];
|
|
341
|
+
pointStylesToUse[key] = value;
|
|
342
|
+
});
|
|
343
|
+
return {
|
|
344
|
+
category: dataItem.category,
|
|
345
|
+
xValue: dataItem.xValue,
|
|
346
|
+
yValue: dataItem.yValue,
|
|
347
|
+
color: pointStylesToUse.color,
|
|
348
|
+
shape: pointStylesToUse.shape,
|
|
349
|
+
opacity: pointStylesToUse.opacity,
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
const tooltipField = spec?.tooltip === 'auto' ? 'category' : 'none';
|
|
353
|
+
return {
|
|
354
|
+
$schema: 'https://vega.github.io/schema/vega/v6.json',
|
|
355
|
+
description: 'A scatter plot with null values visualized along the axes.',
|
|
356
|
+
width: 450,
|
|
357
|
+
height: 450,
|
|
358
|
+
padding: 5,
|
|
359
|
+
autosize: { type: 'fit', resize: true },
|
|
360
|
+
signals: [
|
|
361
|
+
{ name: 'nullSize', value: 8 },
|
|
362
|
+
{ name: 'nullGap', update: 'nullSize + 10' },
|
|
363
|
+
],
|
|
364
|
+
data: [
|
|
365
|
+
{
|
|
366
|
+
name: 'source',
|
|
367
|
+
values: dataItemsToUse,
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: 'valid',
|
|
371
|
+
source: 'source',
|
|
372
|
+
transform: [
|
|
373
|
+
{
|
|
374
|
+
type: 'filter',
|
|
375
|
+
expr: 'datum.xValue != null && datum.yValue != null',
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: 'nullXY',
|
|
381
|
+
source: 'source',
|
|
382
|
+
transform: [
|
|
383
|
+
{
|
|
384
|
+
type: 'filter',
|
|
385
|
+
expr: 'datum.xValue == null && datum.yValue == null',
|
|
386
|
+
},
|
|
387
|
+
{ type: 'aggregate' },
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'nullY',
|
|
392
|
+
source: 'source',
|
|
393
|
+
transform: [
|
|
394
|
+
{
|
|
395
|
+
type: 'filter',
|
|
396
|
+
expr: 'datum.xValue != null && datum.yValue == null',
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'nullX',
|
|
402
|
+
source: 'source',
|
|
403
|
+
transform: [
|
|
404
|
+
{
|
|
405
|
+
type: 'filter',
|
|
406
|
+
expr: 'datum.xValue == null && datum.yValue != null',
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
scales: [
|
|
412
|
+
{
|
|
413
|
+
name: 'xscale',
|
|
414
|
+
type: 'linear',
|
|
415
|
+
range: [{ signal: 'nullGap' }, { signal: 'width' }],
|
|
416
|
+
nice: true,
|
|
417
|
+
domain: { data: 'valid', field: 'xValue' },
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: 'yscale',
|
|
421
|
+
type: 'linear',
|
|
422
|
+
range: [{ signal: 'height - nullGap' }, 0],
|
|
423
|
+
nice: true,
|
|
424
|
+
domain: { data: 'valid', field: 'yValue' },
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
axes: [
|
|
428
|
+
{
|
|
429
|
+
orient: 'bottom',
|
|
430
|
+
scale: 'xscale',
|
|
431
|
+
offset: 5,
|
|
432
|
+
format: 's',
|
|
433
|
+
title: spec?.xAxisTitle || 'X Value',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
orient: 'left',
|
|
437
|
+
scale: 'yscale',
|
|
438
|
+
offset: 5,
|
|
439
|
+
format: 's',
|
|
440
|
+
title: spec?.yAxisTitle || 'Y Value',
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
marks: [
|
|
444
|
+
{
|
|
445
|
+
type: 'symbol',
|
|
446
|
+
from: { data: 'valid' },
|
|
447
|
+
encode: {
|
|
448
|
+
enter: {
|
|
449
|
+
size: { value: 50 },
|
|
450
|
+
tooltip: { field: tooltipField },
|
|
451
|
+
},
|
|
452
|
+
update: {
|
|
453
|
+
x: { scale: 'xscale', field: 'xValue' },
|
|
454
|
+
y: { scale: 'yscale', field: 'yValue' },
|
|
455
|
+
fill: { field: 'color' },
|
|
456
|
+
fillOpacity: { field: 'opacity' },
|
|
457
|
+
shape: { field: 'shape' },
|
|
458
|
+
zindex: { value: 0 },
|
|
459
|
+
},
|
|
460
|
+
hover: {
|
|
461
|
+
fill: { value: 'firebrick' },
|
|
462
|
+
fillOpacity: { value: 1 },
|
|
463
|
+
zindex: { value: 1 },
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
type: 'symbol',
|
|
469
|
+
from: { data: 'nullY' },
|
|
470
|
+
encode: {
|
|
471
|
+
enter: {
|
|
472
|
+
size: { value: 50 },
|
|
473
|
+
tooltip: { field: tooltipField },
|
|
474
|
+
},
|
|
475
|
+
update: {
|
|
476
|
+
x: { scale: 'xscale', field: 'xValue' },
|
|
477
|
+
y: { signal: 'height - nullSize/2' },
|
|
478
|
+
fill: { value: '#aaa' },
|
|
479
|
+
fillOpacity: { value: 0.2 },
|
|
480
|
+
},
|
|
481
|
+
hover: {
|
|
482
|
+
fill: { value: 'firebrick' },
|
|
483
|
+
fillOpacity: { value: 1 },
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
type: 'symbol',
|
|
489
|
+
from: { data: 'nullX' },
|
|
490
|
+
encode: {
|
|
491
|
+
enter: {
|
|
492
|
+
size: { value: 50 },
|
|
493
|
+
tooltip: { field: 'name' },
|
|
494
|
+
},
|
|
495
|
+
update: {
|
|
496
|
+
x: { signal: 'nullSize/2' },
|
|
497
|
+
y: { scale: 'yscale', field: 'yValue' },
|
|
498
|
+
fill: { value: '#aaa' },
|
|
499
|
+
fillOpacity: { value: 0.2 },
|
|
500
|
+
zindex: { value: 0 },
|
|
501
|
+
},
|
|
502
|
+
hover: {
|
|
503
|
+
fill: { value: 'firebrick' },
|
|
504
|
+
fillOpacity: { value: 1 },
|
|
505
|
+
zindex: { value: 1 },
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
type: 'text',
|
|
511
|
+
interactive: false,
|
|
512
|
+
from: { data: 'nullXY' },
|
|
513
|
+
encode: {
|
|
514
|
+
update: {
|
|
515
|
+
x: { signal: 'nullSize', offset: -4 },
|
|
516
|
+
y: { signal: 'height', offset: 13 },
|
|
517
|
+
text: { signal: "datum.count + ' null'" },
|
|
518
|
+
align: { value: 'right' },
|
|
519
|
+
baseline: { value: 'top' },
|
|
520
|
+
fill: { value: '#999' },
|
|
521
|
+
fontSize: { value: 9 },
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
render() {
|
|
529
|
+
return (index.h(index.Host, { key: '60005ab926b0153b3e31729a69f5a64cf6558085' }, index.h("div", { key: '820de3e0ddbbc2650b9764e279d87531338e72e3', id: "container", style: { width: '100%', height: '100%' } })));
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
exports.apollo_data_line_chart = ApolloDataLineChart;
|
|
534
|
+
exports.apollo_data_scatter_chart = ApolloDataScatterChart;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["apollo-data-
|
|
22
|
+
return index.bootstrapLazy([["apollo-data-line-chart_2.cjs",[[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-scatter-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-bar-chart.cjs",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-donut-chart.cjs",[[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["apollo-data-
|
|
9
|
+
return index.bootstrapLazy([["apollo-data-line-chart_2.cjs",[[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-scatter-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-bar-chart.cjs",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-donut-chart.cjs",[[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
3
|
"components/apollo-data-bar/apollo-data-bar.js",
|
|
4
|
-
"components/apollo-data-donut/apollo-data-donut.js"
|
|
4
|
+
"components/apollo-data-donut/apollo-data-donut.js",
|
|
5
|
+
"components/apollo-data-line/apollo-data-line.js",
|
|
6
|
+
"components/apollo-data-scatter/apollo-data-scatter.js"
|
|
5
7
|
],
|
|
6
8
|
"compiler": {
|
|
7
9
|
"name": "@stencil/core",
|