@xplortech/apollo-data 0.0.3-draft.cc9d917 → 0.0.4-draft.64ed229
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-e6584598.entry.js → p-725550f2.entry.js} +3 -3
- package/dist/cjs/{apollo-data-bar-chart_2.cjs.entry.js → apollo-data-bar-chart_3.cjs.entry.js} +294 -7
- package/dist/cjs/apollo-data.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/apollo-data-line/apollo-data-line.js +346 -0
- package/dist/collection/examples/apollo-data-line.examples.js +91 -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/p-2nuV5Vny.js +1 -0
- package/dist/esm/{apollo-data-bar-chart_2.entry.js → apollo-data-bar-chart_3.entry.js} +294 -8
- package/dist/esm/apollo-data.js +1 -1
- 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.d.ts +31 -0
- package/dist/types/examples/apollo-data-line.examples.d.ts +12 -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/index.ts +2 -1
|
@@ -67653,7 +67653,7 @@ class ApolloBase {
|
|
|
67653
67653
|
|
|
67654
67654
|
const CHART_COLORS = ['#4d1ab2', '#f99170', '#e550c8', '#ffd563', '#8857fa', '#52ebba', '#bf1d78', '#31cff8'];
|
|
67655
67655
|
|
|
67656
|
-
const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
67656
|
+
const FONT_FAMILY$1 = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
67657
67657
|
const ApolloDataBarChart = class extends ApolloBase {
|
|
67658
67658
|
constructor(hostRef) {
|
|
67659
67659
|
super();
|
|
@@ -67743,28 +67743,28 @@ const ApolloDataBarChart = class extends ApolloBase {
|
|
|
67743
67743
|
config: {
|
|
67744
67744
|
text: {
|
|
67745
67745
|
fill: '#6a6d7d',
|
|
67746
|
-
font: FONT_FAMILY,
|
|
67746
|
+
font: FONT_FAMILY$1,
|
|
67747
67747
|
labelFontSize: 12,
|
|
67748
67748
|
labelFontWeight: 400,
|
|
67749
67749
|
},
|
|
67750
67750
|
axis: {
|
|
67751
67751
|
labelColor: '#6a6d7d',
|
|
67752
67752
|
titleColor: '#6a6d7d',
|
|
67753
|
-
labelFont: FONT_FAMILY,
|
|
67754
|
-
titleFont: FONT_FAMILY,
|
|
67753
|
+
labelFont: FONT_FAMILY$1,
|
|
67754
|
+
titleFont: FONT_FAMILY$1,
|
|
67755
67755
|
titleFontWeight: 400,
|
|
67756
67756
|
},
|
|
67757
67757
|
legend: {
|
|
67758
67758
|
labelColor: '#6a6d7d',
|
|
67759
67759
|
titleColor: '#6a6d7d',
|
|
67760
|
-
labelFont: FONT_FAMILY,
|
|
67761
|
-
titleFont: FONT_FAMILY,
|
|
67760
|
+
labelFont: FONT_FAMILY$1,
|
|
67761
|
+
titleFont: FONT_FAMILY$1,
|
|
67762
67762
|
labelFontSize: 12,
|
|
67763
67763
|
labelLimit: 95,
|
|
67764
67764
|
},
|
|
67765
67765
|
title: {
|
|
67766
67766
|
color: '#6a6d7d',
|
|
67767
|
-
font: FONT_FAMILY,
|
|
67767
|
+
font: FONT_FAMILY$1,
|
|
67768
67768
|
labelFontSize: 12,
|
|
67769
67769
|
labelFontWeight: 400,
|
|
67770
67770
|
},
|
|
@@ -68362,4 +68362,290 @@ const ApolloDataDonutChart = class extends ApolloBase {
|
|
|
68362
68362
|
}
|
|
68363
68363
|
};
|
|
68364
68364
|
|
|
68365
|
-
|
|
68365
|
+
const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
68366
|
+
function lineStyleToStrokeDash(lineStyle) {
|
|
68367
|
+
switch (lineStyle) {
|
|
68368
|
+
case 'dashed':
|
|
68369
|
+
return [6, 4];
|
|
68370
|
+
case 'dotted':
|
|
68371
|
+
return [2, 2];
|
|
68372
|
+
case 'solid':
|
|
68373
|
+
default:
|
|
68374
|
+
return [];
|
|
68375
|
+
}
|
|
68376
|
+
}
|
|
68377
|
+
const ApolloDataLineChart = class extends ApolloBase {
|
|
68378
|
+
constructor(hostRef) {
|
|
68379
|
+
super();
|
|
68380
|
+
registerInstance(this, hostRef);
|
|
68381
|
+
}
|
|
68382
|
+
get el() { return getElement(this); }
|
|
68383
|
+
adData = [];
|
|
68384
|
+
adSpec = null;
|
|
68385
|
+
static tooltipStylesInjected = false;
|
|
68386
|
+
componentDidLoad() {
|
|
68387
|
+
this.injectTooltipStyles();
|
|
68388
|
+
}
|
|
68389
|
+
async componentDidRender() {
|
|
68390
|
+
await this.renderChart();
|
|
68391
|
+
}
|
|
68392
|
+
injectTooltipStyles() {
|
|
68393
|
+
if (ApolloDataLineChart.tooltipStylesInjected) {
|
|
68394
|
+
return;
|
|
68395
|
+
}
|
|
68396
|
+
const styleId = 'apollo-data-line-tooltip-styles';
|
|
68397
|
+
if (document.getElementById(styleId)) {
|
|
68398
|
+
ApolloDataLineChart.tooltipStylesInjected = true;
|
|
68399
|
+
return;
|
|
68400
|
+
}
|
|
68401
|
+
const style = document.createElement('style');
|
|
68402
|
+
style.id = styleId;
|
|
68403
|
+
style.textContent = `
|
|
68404
|
+
#vg-tooltip-element {
|
|
68405
|
+
background-color: #ffffff;
|
|
68406
|
+
border: 1px solid #e1e2e8;
|
|
68407
|
+
border-radius: 0.25rem;
|
|
68408
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);
|
|
68409
|
+
font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;
|
|
68410
|
+
font-weight: 500;
|
|
68411
|
+
padding: 0.25rem 0.75rem;
|
|
68412
|
+
pointer-events: none;
|
|
68413
|
+
text-align: center;
|
|
68414
|
+
transform: translateY(20%);
|
|
68415
|
+
white-space: pre;
|
|
68416
|
+
z-index: 999999999;
|
|
68417
|
+
}
|
|
68418
|
+
|
|
68419
|
+
#vg-tooltip-element table tr td.key {
|
|
68420
|
+
color: #6a6d7d;
|
|
68421
|
+
text-align: center;
|
|
68422
|
+
}
|
|
68423
|
+
|
|
68424
|
+
#vg-tooltip-element table tr td.value {
|
|
68425
|
+
text-align: center;
|
|
68426
|
+
}
|
|
68427
|
+
|
|
68428
|
+
#vg-tooltip-element.dark-theme {
|
|
68429
|
+
background-color: #292632;
|
|
68430
|
+
border: 1px solid #6a6d7d;
|
|
68431
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);
|
|
68432
|
+
color: #ffffff;
|
|
68433
|
+
}
|
|
68434
|
+
|
|
68435
|
+
#vg-tooltip-element::after {
|
|
68436
|
+
border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
|
|
68437
|
+
border-style: solid;
|
|
68438
|
+
border-width: 9px;
|
|
68439
|
+
bottom: -17px;
|
|
68440
|
+
content: '';
|
|
68441
|
+
left: 50%;
|
|
68442
|
+
position: absolute;
|
|
68443
|
+
transform: translateX(-50%);
|
|
68444
|
+
}
|
|
68445
|
+
`;
|
|
68446
|
+
document.head.appendChild(style);
|
|
68447
|
+
ApolloDataLineChart.tooltipStylesInjected = true;
|
|
68448
|
+
}
|
|
68449
|
+
// @ts-ignore
|
|
68450
|
+
async getViewData(data, spec) {
|
|
68451
|
+
if (!spec) {
|
|
68452
|
+
throw new Error('adSpec is required for apollo-data-line-chart');
|
|
68453
|
+
}
|
|
68454
|
+
const { tooltipPrefix = '', currencySymbol = '' } = spec;
|
|
68455
|
+
if (!data || data.length === 0) {
|
|
68456
|
+
throw new Error('Data is required for apollo-data-line-chart');
|
|
68457
|
+
}
|
|
68458
|
+
const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
|
|
68459
|
+
const uniqueXValues = [...new Set(data.map(item => item.xValue))].sort((a, b) => a - b);
|
|
68460
|
+
const colorSet = spec?.colorSet ?? CHART_COLORS;
|
|
68461
|
+
const xLabelData = uniqueXValues.map(x => {
|
|
68462
|
+
const first = data.find(d => d.xValue === x);
|
|
68463
|
+
return { xValue: x, displayLabel: first?.xLabel != null ? first.xLabel : String(x) };
|
|
68464
|
+
});
|
|
68465
|
+
const formatNumber = tooltipPrefix ? '.2f' : '.0f';
|
|
68466
|
+
const currencyPrefix = tooltipPrefix ? currencySymbol : '';
|
|
68467
|
+
const pointShape = spec.pointStyle ?? 'circle';
|
|
68468
|
+
const strokeDash = lineStyleToStrokeDash(spec.lineStyle ?? 'solid');
|
|
68469
|
+
const dataSpec = [
|
|
68470
|
+
{ name: 'raw', values: data },
|
|
68471
|
+
{ name: 'xLabelData', values: xLabelData },
|
|
68472
|
+
];
|
|
68473
|
+
uniqueCategories.forEach((cat, i) => {
|
|
68474
|
+
dataSpec.push({
|
|
68475
|
+
name: `series_${i}`,
|
|
68476
|
+
source: 'raw',
|
|
68477
|
+
transform: [
|
|
68478
|
+
{ type: 'filter', expr: `datum.category === ${JSON.stringify(cat)}` },
|
|
68479
|
+
{ type: 'collect', sort: { field: 'xValue' } },
|
|
68480
|
+
],
|
|
68481
|
+
});
|
|
68482
|
+
});
|
|
68483
|
+
const lineMarks = uniqueCategories.map((_, i) => ({
|
|
68484
|
+
type: 'line',
|
|
68485
|
+
from: { data: `series_${i}` },
|
|
68486
|
+
encode: {
|
|
68487
|
+
enter: {
|
|
68488
|
+
x: { scale: 'x', field: 'xValue' },
|
|
68489
|
+
y: { scale: 'y', field: 'yValue' },
|
|
68490
|
+
stroke: { value: colorSet[i % colorSet.length] },
|
|
68491
|
+
strokeWidth: { value: 2 },
|
|
68492
|
+
interpolate: { value: 'monotone' },
|
|
68493
|
+
...(strokeDash.length > 0 ? { strokeDash: { value: strokeDash } } : {}),
|
|
68494
|
+
},
|
|
68495
|
+
},
|
|
68496
|
+
}));
|
|
68497
|
+
return {
|
|
68498
|
+
$schema: 'https://vega.github.io/schema/vega/v5.json',
|
|
68499
|
+
config: {
|
|
68500
|
+
text: {
|
|
68501
|
+
fill: '#6a6d7d',
|
|
68502
|
+
font: FONT_FAMILY,
|
|
68503
|
+
labelFontSize: 12,
|
|
68504
|
+
labelFontWeight: 400,
|
|
68505
|
+
},
|
|
68506
|
+
axis: {
|
|
68507
|
+
labelColor: '#6a6d7d',
|
|
68508
|
+
titleColor: '#6a6d7d',
|
|
68509
|
+
labelFont: FONT_FAMILY,
|
|
68510
|
+
titleFont: FONT_FAMILY,
|
|
68511
|
+
titleFontWeight: 400,
|
|
68512
|
+
},
|
|
68513
|
+
legend: {
|
|
68514
|
+
labelColor: '#6a6d7d',
|
|
68515
|
+
titleColor: '#6a6d7d',
|
|
68516
|
+
labelFont: FONT_FAMILY,
|
|
68517
|
+
titleFont: FONT_FAMILY,
|
|
68518
|
+
labelFontSize: 12,
|
|
68519
|
+
labelLimit: 95,
|
|
68520
|
+
},
|
|
68521
|
+
title: {
|
|
68522
|
+
color: '#6a6d7d',
|
|
68523
|
+
font: FONT_FAMILY,
|
|
68524
|
+
labelFontSize: 12,
|
|
68525
|
+
labelFontWeight: 400,
|
|
68526
|
+
},
|
|
68527
|
+
},
|
|
68528
|
+
height: 250,
|
|
68529
|
+
autosize: { type: 'fit-x', contains: 'padding', resize: true },
|
|
68530
|
+
signals: [
|
|
68531
|
+
{
|
|
68532
|
+
name: 'containerW',
|
|
68533
|
+
update: 'max(containerSize()[0], 400)',
|
|
68534
|
+
},
|
|
68535
|
+
{
|
|
68536
|
+
name: 'legendColumns',
|
|
68537
|
+
update: 'ceil(containerW / 140)',
|
|
68538
|
+
},
|
|
68539
|
+
],
|
|
68540
|
+
width: { signal: 'containerW' },
|
|
68541
|
+
data: dataSpec,
|
|
68542
|
+
scales: [
|
|
68543
|
+
{
|
|
68544
|
+
name: 'x',
|
|
68545
|
+
type: 'point',
|
|
68546
|
+
domain: uniqueXValues,
|
|
68547
|
+
range: 'width',
|
|
68548
|
+
padding: 0.5,
|
|
68549
|
+
},
|
|
68550
|
+
{
|
|
68551
|
+
name: 'xLabels',
|
|
68552
|
+
type: 'ordinal',
|
|
68553
|
+
domain: { data: 'xLabelData', field: 'xValue' },
|
|
68554
|
+
range: { data: 'xLabelData', field: 'displayLabel' },
|
|
68555
|
+
},
|
|
68556
|
+
{
|
|
68557
|
+
name: 'y',
|
|
68558
|
+
type: 'linear',
|
|
68559
|
+
domain: { data: 'raw', field: 'yValue' },
|
|
68560
|
+
nice: true,
|
|
68561
|
+
zero: true,
|
|
68562
|
+
range: 'height',
|
|
68563
|
+
},
|
|
68564
|
+
{
|
|
68565
|
+
name: 'color',
|
|
68566
|
+
type: 'ordinal',
|
|
68567
|
+
domain: uniqueCategories,
|
|
68568
|
+
range: spec?.colorSet ?? CHART_COLORS,
|
|
68569
|
+
},
|
|
68570
|
+
],
|
|
68571
|
+
axes: [
|
|
68572
|
+
{
|
|
68573
|
+
orient: 'bottom',
|
|
68574
|
+
scale: 'x',
|
|
68575
|
+
title: spec?.xAxisTitle,
|
|
68576
|
+
labelPadding: 12,
|
|
68577
|
+
titlePadding: 12,
|
|
68578
|
+
labelAngle: -90,
|
|
68579
|
+
labelAlign: 'right',
|
|
68580
|
+
labelBaseline: 'middle',
|
|
68581
|
+
tickSize: 3,
|
|
68582
|
+
labelFontSize: 12,
|
|
68583
|
+
titleFontSize: 14,
|
|
68584
|
+
ticks: false,
|
|
68585
|
+
domain: false,
|
|
68586
|
+
encode: {
|
|
68587
|
+
labels: {
|
|
68588
|
+
update: {
|
|
68589
|
+
text: { signal: "scale('xLabels', datum.value)" },
|
|
68590
|
+
},
|
|
68591
|
+
},
|
|
68592
|
+
},
|
|
68593
|
+
},
|
|
68594
|
+
{
|
|
68595
|
+
orient: 'left',
|
|
68596
|
+
scale: 'y',
|
|
68597
|
+
title: spec?.yAxisTitle || '',
|
|
68598
|
+
format: ',.0f',
|
|
68599
|
+
grid: true,
|
|
68600
|
+
tickCount: 6,
|
|
68601
|
+
labelFontSize: 12,
|
|
68602
|
+
titleFontSize: 14,
|
|
68603
|
+
ticks: false,
|
|
68604
|
+
domain: false,
|
|
68605
|
+
tickBand: 'extent',
|
|
68606
|
+
labelPadding: 10,
|
|
68607
|
+
},
|
|
68608
|
+
],
|
|
68609
|
+
legends: [
|
|
68610
|
+
{
|
|
68611
|
+
stroke: 'color',
|
|
68612
|
+
orient: 'bottom',
|
|
68613
|
+
direction: 'horizontal',
|
|
68614
|
+
columns: { signal: 'legendColumns' },
|
|
68615
|
+
title: null,
|
|
68616
|
+
symbolType: 'stroke',
|
|
68617
|
+
symbolStrokeWidth: 3,
|
|
68618
|
+
rowPadding: 8,
|
|
68619
|
+
symbolOffset: -35,
|
|
68620
|
+
symbolSize: 100,
|
|
68621
|
+
labelOffset: 8,
|
|
68622
|
+
labelLimit: 95,
|
|
68623
|
+
},
|
|
68624
|
+
],
|
|
68625
|
+
marks: [
|
|
68626
|
+
...lineMarks,
|
|
68627
|
+
{
|
|
68628
|
+
type: 'symbol',
|
|
68629
|
+
from: { data: 'raw' },
|
|
68630
|
+
encode: {
|
|
68631
|
+
enter: {
|
|
68632
|
+
x: { scale: 'x', field: 'xValue' },
|
|
68633
|
+
y: { scale: 'y', field: 'yValue' },
|
|
68634
|
+
fill: { scale: 'color', field: 'category' },
|
|
68635
|
+
size: { value: 50 },
|
|
68636
|
+
shape: { value: pointShape },
|
|
68637
|
+
tooltip: {
|
|
68638
|
+
signal: `(datum.xLabel != null ? datum.xLabel : format(datum.xValue, ',.0f')) + ' · ' + datum.category + ': ' + (datum.yLabel != null ? datum.yLabel : '${currencyPrefix}' + format(datum.yValue, ',${formatNumber}'))`,
|
|
68639
|
+
},
|
|
68640
|
+
},
|
|
68641
|
+
},
|
|
68642
|
+
},
|
|
68643
|
+
],
|
|
68644
|
+
};
|
|
68645
|
+
}
|
|
68646
|
+
render() {
|
|
68647
|
+
return (h$1(Host, { key: '7799f01536f212d7a06da08c1e463d8529c5bf21' }, h$1("div", { key: '25463f10bbc0f5443c35ab03b5b53164d9ad1efd', id: "container", style: { width: '100%', height: '100%' } })));
|
|
68648
|
+
}
|
|
68649
|
+
};
|
|
68650
|
+
|
|
68651
|
+
export { ApolloDataBarChart as apollo_data_bar_chart, ApolloDataDonutChart as apollo_data_donut_chart, ApolloDataLineChart as apollo_data_line_chart };
|
package/dist/esm/apollo-data.js
CHANGED
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["apollo-data-bar-
|
|
20
|
+
return bootstrapLazy([["apollo-data-bar-chart_3",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
|
|
21
21
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["apollo-data-bar-
|
|
8
|
+
return bootstrapLazy([["apollo-data-bar-chart_3",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { ComponentInterface } from '../../stencil-public-runtime';
|
|
2
|
+
import { ApolloBase } from '../../apollo-data-base';
|
|
3
|
+
export interface LineDataItem {
|
|
4
|
+
category: string;
|
|
5
|
+
xValue: number;
|
|
6
|
+
yValue: number;
|
|
7
|
+
xLabel?: string;
|
|
8
|
+
yLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export type LinePointStyle = 'circle' | 'square' | 'diamond' | 'cross' | 'triangle' | 'triangle-up' | 'triangle-down' | 'triangle-right' | 'triangle-left';
|
|
11
|
+
/** Stroke dash pattern for the lines: 'solid' | 'dashed' | 'dotted'. */
|
|
12
|
+
export type LineLineStyle = 'solid' | 'dashed' | 'dotted';
|
|
13
|
+
export interface LineSpec {
|
|
14
|
+
colorSet?: string[];
|
|
15
|
+
tooltipPrefix?: string;
|
|
16
|
+
currencySymbol?: string;
|
|
17
|
+
yAxisTitle?: string;
|
|
18
|
+
xAxisTitle?: string;
|
|
19
|
+
/** Shape of the data points. Defaults to 'circle'. */
|
|
20
|
+
pointStyle?: LinePointStyle;
|
|
21
|
+
/** Stroke style of the lines. Defaults to 'solid'. */
|
|
22
|
+
lineStyle?: LineLineStyle;
|
|
23
|
+
}
|
|
24
|
+
export declare class ApolloDataLineChart extends ApolloBase<LineDataItem[], LineSpec> implements ComponentInterface {
|
|
25
|
+
el: HTMLElement;
|
|
26
|
+
adData: string | LineDataItem[];
|
|
27
|
+
adSpec: string | LineSpec;
|
|
28
|
+
private static tooltipStylesInjected;
|
|
29
|
+
componentDidLoad(): void;
|
|
30
|
+
componentDidRender(): Promise<void>;
|
|
31
|
+
private injectTooltipStyles;
|
|
32
|
+
protected getViewData(data: LineDataItem[], spec?: LineSpec): Promise<{
|
|
33
|
+
$schema: string;
|
|
34
|
+
config: {
|
|
35
|
+
text: {
|
|
36
|
+
fill: string;
|
|
37
|
+
font: string;
|
|
38
|
+
labelFontSize: number;
|
|
39
|
+
labelFontWeight: number;
|
|
40
|
+
};
|
|
41
|
+
axis: {
|
|
42
|
+
labelColor: string;
|
|
43
|
+
titleColor: string;
|
|
44
|
+
labelFont: string;
|
|
45
|
+
titleFont: string;
|
|
46
|
+
titleFontWeight: number;
|
|
47
|
+
};
|
|
48
|
+
legend: {
|
|
49
|
+
labelColor: string;
|
|
50
|
+
titleColor: string;
|
|
51
|
+
labelFont: string;
|
|
52
|
+
titleFont: string;
|
|
53
|
+
labelFontSize: number;
|
|
54
|
+
labelLimit: number;
|
|
55
|
+
};
|
|
56
|
+
title: {
|
|
57
|
+
color: string;
|
|
58
|
+
font: string;
|
|
59
|
+
labelFontSize: number;
|
|
60
|
+
labelFontWeight: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
height: number;
|
|
64
|
+
autosize: {
|
|
65
|
+
type: string;
|
|
66
|
+
contains: string;
|
|
67
|
+
resize: boolean;
|
|
68
|
+
};
|
|
69
|
+
signals: {
|
|
70
|
+
name: string;
|
|
71
|
+
update: string;
|
|
72
|
+
}[];
|
|
73
|
+
width: {
|
|
74
|
+
signal: string;
|
|
75
|
+
};
|
|
76
|
+
data: any[];
|
|
77
|
+
scales: ({
|
|
78
|
+
name: string;
|
|
79
|
+
type: string;
|
|
80
|
+
domain: number[];
|
|
81
|
+
range: string;
|
|
82
|
+
padding: number;
|
|
83
|
+
nice?: undefined;
|
|
84
|
+
zero?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
name: string;
|
|
87
|
+
type: string;
|
|
88
|
+
domain: {
|
|
89
|
+
data: string;
|
|
90
|
+
field: string;
|
|
91
|
+
};
|
|
92
|
+
range: {
|
|
93
|
+
data: string;
|
|
94
|
+
field: string;
|
|
95
|
+
};
|
|
96
|
+
padding?: undefined;
|
|
97
|
+
nice?: undefined;
|
|
98
|
+
zero?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
name: string;
|
|
101
|
+
type: string;
|
|
102
|
+
domain: {
|
|
103
|
+
data: string;
|
|
104
|
+
field: string;
|
|
105
|
+
};
|
|
106
|
+
nice: boolean;
|
|
107
|
+
zero: boolean;
|
|
108
|
+
range: string;
|
|
109
|
+
padding?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
name: string;
|
|
112
|
+
type: string;
|
|
113
|
+
domain: string[];
|
|
114
|
+
range: string[];
|
|
115
|
+
padding?: undefined;
|
|
116
|
+
nice?: undefined;
|
|
117
|
+
zero?: undefined;
|
|
118
|
+
})[];
|
|
119
|
+
axes: ({
|
|
120
|
+
orient: string;
|
|
121
|
+
scale: string;
|
|
122
|
+
title: string;
|
|
123
|
+
labelPadding: number;
|
|
124
|
+
titlePadding: number;
|
|
125
|
+
labelAngle: number;
|
|
126
|
+
labelAlign: string;
|
|
127
|
+
labelBaseline: string;
|
|
128
|
+
tickSize: number;
|
|
129
|
+
labelFontSize: number;
|
|
130
|
+
titleFontSize: number;
|
|
131
|
+
ticks: boolean;
|
|
132
|
+
domain: boolean;
|
|
133
|
+
encode: {
|
|
134
|
+
labels: {
|
|
135
|
+
update: {
|
|
136
|
+
text: {
|
|
137
|
+
signal: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
format?: undefined;
|
|
143
|
+
grid?: undefined;
|
|
144
|
+
tickCount?: undefined;
|
|
145
|
+
tickBand?: undefined;
|
|
146
|
+
} | {
|
|
147
|
+
orient: string;
|
|
148
|
+
scale: string;
|
|
149
|
+
title: string;
|
|
150
|
+
format: string;
|
|
151
|
+
grid: boolean;
|
|
152
|
+
tickCount: number;
|
|
153
|
+
labelFontSize: number;
|
|
154
|
+
titleFontSize: number;
|
|
155
|
+
ticks: boolean;
|
|
156
|
+
domain: boolean;
|
|
157
|
+
tickBand: string;
|
|
158
|
+
labelPadding: number;
|
|
159
|
+
titlePadding?: undefined;
|
|
160
|
+
labelAngle?: undefined;
|
|
161
|
+
labelAlign?: undefined;
|
|
162
|
+
labelBaseline?: undefined;
|
|
163
|
+
tickSize?: undefined;
|
|
164
|
+
encode?: undefined;
|
|
165
|
+
})[];
|
|
166
|
+
legends: {
|
|
167
|
+
stroke: string;
|
|
168
|
+
orient: string;
|
|
169
|
+
direction: string;
|
|
170
|
+
columns: {
|
|
171
|
+
signal: string;
|
|
172
|
+
};
|
|
173
|
+
title: any;
|
|
174
|
+
symbolType: string;
|
|
175
|
+
symbolStrokeWidth: number;
|
|
176
|
+
rowPadding: number;
|
|
177
|
+
symbolOffset: number;
|
|
178
|
+
symbolSize: number;
|
|
179
|
+
labelOffset: number;
|
|
180
|
+
labelLimit: number;
|
|
181
|
+
}[];
|
|
182
|
+
marks: ({
|
|
183
|
+
type: string;
|
|
184
|
+
from: {
|
|
185
|
+
data: string;
|
|
186
|
+
};
|
|
187
|
+
encode: {
|
|
188
|
+
enter: {
|
|
189
|
+
strokeDash?: {
|
|
190
|
+
value: number[];
|
|
191
|
+
};
|
|
192
|
+
x: {
|
|
193
|
+
scale: string;
|
|
194
|
+
field: string;
|
|
195
|
+
};
|
|
196
|
+
y: {
|
|
197
|
+
scale: string;
|
|
198
|
+
field: string;
|
|
199
|
+
};
|
|
200
|
+
stroke: {
|
|
201
|
+
value: string;
|
|
202
|
+
};
|
|
203
|
+
strokeWidth: {
|
|
204
|
+
value: number;
|
|
205
|
+
};
|
|
206
|
+
interpolate: {
|
|
207
|
+
value: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
} | {
|
|
212
|
+
type: string;
|
|
213
|
+
from: {
|
|
214
|
+
data: string;
|
|
215
|
+
};
|
|
216
|
+
encode: {
|
|
217
|
+
enter: {
|
|
218
|
+
x: {
|
|
219
|
+
scale: string;
|
|
220
|
+
field: string;
|
|
221
|
+
};
|
|
222
|
+
y: {
|
|
223
|
+
scale: string;
|
|
224
|
+
field: string;
|
|
225
|
+
};
|
|
226
|
+
fill: {
|
|
227
|
+
scale: string;
|
|
228
|
+
field: string;
|
|
229
|
+
};
|
|
230
|
+
size: {
|
|
231
|
+
value: number;
|
|
232
|
+
};
|
|
233
|
+
shape: {
|
|
234
|
+
value: LinePointStyle;
|
|
235
|
+
};
|
|
236
|
+
tooltip: {
|
|
237
|
+
signal: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
})[];
|
|
242
|
+
}>;
|
|
243
|
+
render(): any;
|
|
244
|
+
}
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
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
|
+
import { LineDataItem, LineSpec } from "./components/apollo-data-line/apollo-data-line";
|
|
10
11
|
export { BarDataItem, BarSpec } from "./components/apollo-data-bar/apollo-data-bar";
|
|
11
12
|
export { DonutDataItem, DonutSpec } from "./components/apollo-data-donut/apollo-data-donut";
|
|
13
|
+
export { LineDataItem, LineSpec } from "./components/apollo-data-line/apollo-data-line";
|
|
12
14
|
export namespace Components {
|
|
13
15
|
interface ApolloDataBarChart {
|
|
14
16
|
/**
|
|
@@ -38,6 +40,16 @@ export namespace Components {
|
|
|
38
40
|
*/
|
|
39
41
|
"adSpec": string | DonutSpec;
|
|
40
42
|
}
|
|
43
|
+
interface ApolloDataLineChart {
|
|
44
|
+
/**
|
|
45
|
+
* @default []
|
|
46
|
+
*/
|
|
47
|
+
"adData": string | LineDataItem[];
|
|
48
|
+
/**
|
|
49
|
+
* @default null
|
|
50
|
+
*/
|
|
51
|
+
"adSpec": string | LineSpec;
|
|
52
|
+
}
|
|
41
53
|
}
|
|
42
54
|
declare global {
|
|
43
55
|
interface HTMLApolloDataBarChartElement extends Components.ApolloDataBarChart, HTMLStencilElement {
|
|
@@ -52,9 +64,16 @@ declare global {
|
|
|
52
64
|
prototype: HTMLApolloDataDonutChartElement;
|
|
53
65
|
new (): HTMLApolloDataDonutChartElement;
|
|
54
66
|
};
|
|
67
|
+
interface HTMLApolloDataLineChartElement extends Components.ApolloDataLineChart, HTMLStencilElement {
|
|
68
|
+
}
|
|
69
|
+
var HTMLApolloDataLineChartElement: {
|
|
70
|
+
prototype: HTMLApolloDataLineChartElement;
|
|
71
|
+
new (): HTMLApolloDataLineChartElement;
|
|
72
|
+
};
|
|
55
73
|
interface HTMLElementTagNameMap {
|
|
56
74
|
"apollo-data-bar-chart": HTMLApolloDataBarChartElement;
|
|
57
75
|
"apollo-data-donut-chart": HTMLApolloDataDonutChartElement;
|
|
76
|
+
"apollo-data-line-chart": HTMLApolloDataLineChartElement;
|
|
58
77
|
}
|
|
59
78
|
}
|
|
60
79
|
declare namespace LocalJSX {
|
|
@@ -86,9 +105,20 @@ declare namespace LocalJSX {
|
|
|
86
105
|
*/
|
|
87
106
|
"adSpec"?: string | DonutSpec;
|
|
88
107
|
}
|
|
108
|
+
interface ApolloDataLineChart {
|
|
109
|
+
/**
|
|
110
|
+
* @default []
|
|
111
|
+
*/
|
|
112
|
+
"adData"?: string | LineDataItem[];
|
|
113
|
+
/**
|
|
114
|
+
* @default null
|
|
115
|
+
*/
|
|
116
|
+
"adSpec"?: string | LineSpec;
|
|
117
|
+
}
|
|
89
118
|
interface IntrinsicElements {
|
|
90
119
|
"apollo-data-bar-chart": ApolloDataBarChart;
|
|
91
120
|
"apollo-data-donut-chart": ApolloDataDonutChart;
|
|
121
|
+
"apollo-data-line-chart": ApolloDataLineChart;
|
|
92
122
|
}
|
|
93
123
|
}
|
|
94
124
|
export { LocalJSX as JSX };
|
|
@@ -97,6 +127,7 @@ declare module "@stencil/core" {
|
|
|
97
127
|
interface IntrinsicElements {
|
|
98
128
|
"apollo-data-bar-chart": LocalJSX.ApolloDataBarChart & JSXBase.HTMLAttributes<HTMLApolloDataBarChartElement>;
|
|
99
129
|
"apollo-data-donut-chart": LocalJSX.ApolloDataDonutChart & JSXBase.HTMLAttributes<HTMLApolloDataDonutChartElement>;
|
|
130
|
+
"apollo-data-line-chart": LocalJSX.ApolloDataLineChart & JSXBase.HTMLAttributes<HTMLApolloDataLineChartElement>;
|
|
100
131
|
}
|
|
101
132
|
}
|
|
102
133
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LineDataItem, LineSpec } from '../components/apollo-data-line/apollo-data-line';
|
|
2
|
+
export interface LineExample {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
props: {
|
|
6
|
+
adData: LineDataItem[];
|
|
7
|
+
adSpec?: LineSpec;
|
|
8
|
+
};
|
|
9
|
+
notes?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Each item has category, xValue, yValue, and optional xLabel/yLabel. When labels are omitted, numeric values are shown. */
|
|
12
|
+
export declare const lineExamples: LineExample[];
|