@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,91 @@
|
|
|
1
|
+
/** Each item has category, xValue, yValue, and optional xLabel/yLabel. When labels are omitted, numeric values are shown. */
|
|
2
|
+
export const lineExamples = [
|
|
3
|
+
{
|
|
4
|
+
name: 'Revenue and Expenses by Day',
|
|
5
|
+
description: 'Line chart showing daily revenue and expenses over a week',
|
|
6
|
+
props: {
|
|
7
|
+
adData: [
|
|
8
|
+
{ category: 'Revenue', xValue: 1, yValue: 5000, xLabel: 'Mon' },
|
|
9
|
+
{ category: 'Expenses', xValue: 1, yValue: 2000, xLabel: 'Mon' },
|
|
10
|
+
{ category: 'Revenue', xValue: 2, yValue: 6000, xLabel: 'Tue' },
|
|
11
|
+
{ category: 'Expenses', xValue: 2, yValue: 2500, xLabel: 'Tue' },
|
|
12
|
+
{ category: 'Revenue', xValue: 3, yValue: 5500, xLabel: 'Wed' },
|
|
13
|
+
{ category: 'Expenses', xValue: 3, yValue: 2200, xLabel: 'Wed' },
|
|
14
|
+
{ category: 'Revenue', xValue: 4, yValue: 7000, xLabel: 'Thu' },
|
|
15
|
+
{ category: 'Expenses', xValue: 4, yValue: 3000, xLabel: 'Thu' },
|
|
16
|
+
{ category: 'Revenue', xValue: 5, yValue: 6500, xLabel: 'Fri' },
|
|
17
|
+
{ category: 'Expenses', xValue: 5, yValue: 2800, xLabel: 'Fri' },
|
|
18
|
+
],
|
|
19
|
+
adSpec: {
|
|
20
|
+
tooltipPrefix: '$',
|
|
21
|
+
currencySymbol: '$',
|
|
22
|
+
yAxisTitle: 'Amount',
|
|
23
|
+
colorSet: ['#FF8DF4', '#74FBD0'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Monthly Sales by Product',
|
|
29
|
+
description: 'Multi-line chart showing sales across products by month',
|
|
30
|
+
props: {
|
|
31
|
+
adData: [
|
|
32
|
+
{ category: 'Product A', xValue: 1, yValue: 12000, xLabel: 'Jan' },
|
|
33
|
+
{ category: 'Product B', xValue: 1, yValue: 8000, xLabel: 'Jan' },
|
|
34
|
+
{ category: 'Product C', xValue: 1, yValue: 6000, xLabel: 'Jan' },
|
|
35
|
+
{ category: 'Product A', xValue: 2, yValue: 15000, xLabel: 'Feb' },
|
|
36
|
+
{ category: 'Product B', xValue: 2, yValue: 9000, xLabel: 'Feb' },
|
|
37
|
+
{ category: 'Product C', xValue: 2, yValue: 7000, xLabel: 'Feb' },
|
|
38
|
+
{ category: 'Product A', xValue: 3, yValue: 13000, xLabel: 'Mar' },
|
|
39
|
+
{ category: 'Product B', xValue: 3, yValue: 10000, xLabel: 'Mar' },
|
|
40
|
+
{ category: 'Product C', xValue: 3, yValue: 5500, xLabel: 'Mar' },
|
|
41
|
+
{ category: 'Product A', xValue: 4, yValue: 14000, xLabel: 'Apr' },
|
|
42
|
+
{ category: 'Product B', xValue: 4, yValue: 9500, xLabel: 'Apr' },
|
|
43
|
+
{ category: 'Product C', xValue: 4, yValue: 6500, xLabel: 'Apr' },
|
|
44
|
+
],
|
|
45
|
+
adSpec: {
|
|
46
|
+
tooltipPrefix: '$',
|
|
47
|
+
currencySymbol: '$',
|
|
48
|
+
yAxisTitle: 'Monthly Sales',
|
|
49
|
+
colorSet: ['#FF8DF4', '#74FBD0', '#ECFD91'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Single Series',
|
|
55
|
+
description: 'Line chart with one category (visitors over time)',
|
|
56
|
+
props: {
|
|
57
|
+
adData: [
|
|
58
|
+
{ category: 'Visitors', xValue: 1, yValue: 2450, xLabel: 'Mon' },
|
|
59
|
+
{ category: 'Visitors', xValue: 2, yValue: 2680, xLabel: 'Tue' },
|
|
60
|
+
{ category: 'Visitors', xValue: 3, yValue: 2320, xLabel: 'Wed' },
|
|
61
|
+
{ category: 'Visitors', xValue: 4, yValue: 2890, xLabel: 'Thu' },
|
|
62
|
+
{ category: 'Visitors', xValue: 5, yValue: 3150, xLabel: 'Fri' },
|
|
63
|
+
{ category: 'Visitors', xValue: 6, yValue: 3420, xLabel: 'Sat' },
|
|
64
|
+
{ category: 'Visitors', xValue: 7, yValue: 3280, xLabel: 'Sun' },
|
|
65
|
+
],
|
|
66
|
+
adSpec: {
|
|
67
|
+
yAxisTitle: 'Daily Visitors',
|
|
68
|
+
colorSet: ['#6366f1'],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Custom Axis Titles',
|
|
74
|
+
description: 'Line chart with custom x-axis and y-axis titles',
|
|
75
|
+
props: {
|
|
76
|
+
adData: [
|
|
77
|
+
{ category: 'Inbound', xValue: 1, yValue: 120, xLabel: 'Mon' },
|
|
78
|
+
{ category: 'Outbound', xValue: 1, yValue: 80, xLabel: 'Mon' },
|
|
79
|
+
{ category: 'Inbound', xValue: 2, yValue: 95, xLabel: 'Tue' },
|
|
80
|
+
{ category: 'Outbound', xValue: 2, yValue: 110, xLabel: 'Tue' },
|
|
81
|
+
{ category: 'Inbound', xValue: 3, yValue: 130, xLabel: 'Wed' },
|
|
82
|
+
{ category: 'Outbound', xValue: 3, yValue: 70, xLabel: 'Wed' },
|
|
83
|
+
],
|
|
84
|
+
adSpec: {
|
|
85
|
+
yAxisTitle: 'Calls',
|
|
86
|
+
xAxisTitle: 'Support queue (by day)',
|
|
87
|
+
colorSet: ['#4d1ab2', '#f99170'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export const scatterExamples = [
|
|
2
|
+
{
|
|
3
|
+
name: 'Basic Scatter Chart',
|
|
4
|
+
description: 'A simple scatter chart using default styling and automatic tooltips.',
|
|
5
|
+
props: {
|
|
6
|
+
adData: [
|
|
7
|
+
{ category: 'A', xValue: 120, yValue: 4.5 },
|
|
8
|
+
{ category: 'B', xValue: 340, yValue: 6.8 },
|
|
9
|
+
{ category: 'C', xValue: 560, yValue: 7.2 },
|
|
10
|
+
{ category: 'A', xValue: 230, yValue: 5.1 },
|
|
11
|
+
{ category: 'B', xValue: 890, yValue: 8.4 },
|
|
12
|
+
],
|
|
13
|
+
adSpec: {
|
|
14
|
+
xAxisTitle: 'Revenue',
|
|
15
|
+
yAxisTitle: 'Rating',
|
|
16
|
+
tooltip: 'auto',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
notes: 'Uses defaultPointStyle internally. No category-based styling applied.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Category Styled Scatter',
|
|
23
|
+
description: 'Scatter chart with custom styles per category using categoryPointStyleMap.',
|
|
24
|
+
props: {
|
|
25
|
+
adData: [
|
|
26
|
+
{ category: 'Mobile', xValue: 150, yValue: 3.8 },
|
|
27
|
+
{ category: 'Web', xValue: 980, yValue: 7.9 },
|
|
28
|
+
{ category: 'Backend', xValue: 670, yValue: 6.7 },
|
|
29
|
+
{ category: 'Mobile', xValue: 300, yValue: 5.6 },
|
|
30
|
+
],
|
|
31
|
+
adSpec: {
|
|
32
|
+
xAxisTitle: 'Users',
|
|
33
|
+
yAxisTitle: 'Performance Score',
|
|
34
|
+
tooltip: 'auto',
|
|
35
|
+
categoryPointStyleMap: {
|
|
36
|
+
Mobile: { color: '#4ECDC4', size: 100, shape: 'circle' },
|
|
37
|
+
Web: { color: '#FF6B6B', size: 120, shape: 'square' },
|
|
38
|
+
Backend: { color: '#6A6D7D', size: 140, shape: 'triangle' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
notes: 'Each category overrides the defaultPointStyle using categoryPointStyleMap.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Per-Point Style Override',
|
|
46
|
+
description: 'Individual data points override category and default styles.',
|
|
47
|
+
props: {
|
|
48
|
+
adData: [
|
|
49
|
+
{
|
|
50
|
+
category: 'Sales',
|
|
51
|
+
xValue: 400,
|
|
52
|
+
yValue: 6.2,
|
|
53
|
+
pointStyle: { color: '#FF0000', size: 180, shape: 'triangle' },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
category: 'Sales',
|
|
57
|
+
xValue: 520,
|
|
58
|
+
yValue: 7.1,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
category: 'Marketing',
|
|
62
|
+
xValue: 310,
|
|
63
|
+
yValue: 5.4,
|
|
64
|
+
pointStyle: { color: '#000000', size: 160, shape: 'square' },
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
adSpec: {
|
|
68
|
+
xAxisTitle: 'Spend',
|
|
69
|
+
yAxisTitle: 'Conversion Rate',
|
|
70
|
+
defaultPointStyle: { color: '#6A6D7D', size: 100, shape: 'circle' },
|
|
71
|
+
tooltip: 'auto',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
notes: 'pointStyle at the data level has highest priority over category and default styles.',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Tooltip Disabled',
|
|
78
|
+
description: 'Scatter chart with tooltips disabled.',
|
|
79
|
+
props: {
|
|
80
|
+
adData: [
|
|
81
|
+
{ category: 'Q1', xValue: 200, yValue: 4.2 },
|
|
82
|
+
{ category: 'Q2', xValue: 450, yValue: 6.5 },
|
|
83
|
+
{ category: 'Q3', xValue: 700, yValue: 8.1 },
|
|
84
|
+
{ category: 'Q4', xValue: 300, yValue: 5.9 },
|
|
85
|
+
],
|
|
86
|
+
adSpec: {
|
|
87
|
+
xAxisTitle: 'Quarter',
|
|
88
|
+
yAxisTitle: 'Growth',
|
|
89
|
+
tooltip: 'none',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
notes: 'Tooltip interaction is completely disabled in this example.',
|
|
93
|
+
},
|
|
94
|
+
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,t,h as a,H as o}from"./p-Dws5s-Xe.js";import{A as l}from"./p-7XF5Cax8.js";
|
|
1
|
+
import{p as e,t,h as a,H as o}from"./p-Dws5s-Xe.js";import{A as l}from"./p-7XF5Cax8.js";import{C as n}from"./p-2nuV5Vny.js";const r="apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",i=e(class e extends l{constructor(e){super(!1),!1!==e&&this.__registerHost(),this.__attachShadow()}get el(){return this}adData=[];adSpec=null;static tooltipStylesInjected=!1;componentDidLoad(){this.injectTooltipStyles()}async componentDidRender(){await this.renderChart()}injectTooltipStyles(){if(e.tooltipStylesInjected)return;const t="apollo-data-bar-tooltip-styles";if(document.getElementById(t))return void(e.tooltipStylesInjected=!0);const a=document.createElement("style");a.id=t,a.textContent="\n #vg-tooltip-element {\n background-color: #ffffff;\n border: 1px solid #e1e2e8;\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);\n font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;\n font-weight: 500;\n padding: 0.25rem 0.75rem;\n pointer-events: none;\n text-align: center;\n transform: translateY(20%);\n white-space: pre;\n z-index: 999999999;\n }\n\n #vg-tooltip-element table tr td.key {\n color: #6a6d7d;\n text-align: center;\n }\n\n #vg-tooltip-element table tr td.value {\n text-align: center;\n }\n\n #vg-tooltip-element.dark-theme {\n background-color: #292632;\n border: 1px solid #6a6d7d;\n box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);\n color: #ffffff;\n }\n\n #vg-tooltip-element::after {\n border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;\n border-style: solid;\n border-width: 9px;\n bottom: -17px;\n content: '';\n left: 50%;\n position: absolute;\n transform: translateX(-50%);\n }\n ",document.head.appendChild(a),e.tooltipStylesInjected=!0}async getViewData(e,t){if(!t)throw Error("adSpec is required for apollo-data-bar-chart");const{tooltipPrefix:a="",currencySymbol:o=""}=t;if(!e||0===e.length)throw Error("Data is required for apollo-data-bar-chart");const l=Array.from(new Set(e.map((e=>e.category)))),i=a?".2f":".0f",d=a?o:"";return{$schema:"https://vega.github.io/schema/vega/v5.json",config:{text:{fill:"#6a6d7d",font:r,labelFontSize:12,labelFontWeight:400},axis:{labelColor:"#6a6d7d",titleColor:"#6a6d7d",labelFont:r,titleFont:r,titleFontWeight:400},legend:{labelColor:"#6a6d7d",titleColor:"#6a6d7d",labelFont:r,titleFont:r,labelFontSize:12,labelLimit:95},title:{color:"#6a6d7d",font:r,labelFontSize:12,labelFontWeight:400}},height:250,autosize:{type:"fit-x",contains:"padding",resize:!0},signals:[{name:"containerW",update:"max(containerSize()[0], 400)"},{name:"legendColumns",update:"ceil(containerW / 140)"},{name:"hoveredPeriod",value:null,on:[{events:"rect:mouseover",update:"datum.period"},{events:"rect:mouseout",update:"null"}]}],width:{signal:"containerW"},data:[{name:"raw",values:e},{name:"periodTotals",source:"raw",transform:[{type:"aggregate",groupby:["periodId"],fields:["value"],ops:["sum"],as:["total"]}]},{name:"table",source:"raw",transform:[{type:"lookup",from:"periodTotals",key:"periodId",fields:["periodId"],values:["total"],as:["total"]},{type:"stack",groupby:["periodId"],sort:{field:"category"},field:"value"},{type:"formula",as:"periodId",expr:"datum.periodId"},{type:"formula",as:"labelOnly",expr:"datum.label"}]},{name:"periodLabels",source:"raw",transform:[{type:"aggregate",groupby:["periodId","label"]}]}],scales:[{name:"x",type:"band",domain:{data:"table",field:"periodId"},range:"width",paddingInner:.35,paddingOuter:.02},{name:"xLabels",type:"ordinal",domain:{data:"periodLabels",field:"periodId"},range:{data:"periodLabels",field:"label"}},{name:"y",type:"linear",domain:{data:"table",field:"y1"},nice:!0,zero:!0,range:"height"},{name:"color",type:"ordinal",domain:l,range:t?.colorSet??n}],axes:[{orient:"bottom",scale:"x",title:t?.xAxisTitle,labelPadding:12,titlePadding:12,labelAngle:-90,labelAlign:"right",labelBaseline:"middle",tickSize:3,labelFontSize:12,titleFontSize:14,ticks:!1,domain:!1,encode:{labels:{update:{text:{signal:"scale('xLabels', datum.value)"}}}}},{orient:"left",scale:"y",title:t?.yAxisTitle||"",format:",.0f",grid:!0,tickCount:6,labelFontSize:12,titleFontSize:14,ticks:!1,domain:!1,tickBand:"extent",labelPadding:10}],legends:[{fill:"color",orient:"bottom",direction:"horizontal",columns:{signal:"legendColumns"},title:null,symbolType:"square",rowPadding:8,symbolOffset:-35,symbolSize:100,labelOffset:8,labelLimit:95}],marks:[{type:"rect",from:{data:"table"},encode:{enter:{x:{scale:"x",field:"periodId"},width:{scale:"x",band:1},y:{scale:"y",field:"y1"},y2:{scale:"y",field:"y0"},fill:{scale:"color",field:"category"},tooltip:{signal:`datum.category + ': ${d}' + format(datum.value, ',${i}') + '\\nTotal: ${d}' + format(datum.total, ',${i}')`}},update:{opacity:[{test:"hoveredPeriod && datum.period !== hoveredPeriod",value:.2},{value:1}]}}}]}}render(){return a(o,{key:"86ed2e74e5abd57e684a93bc9cf6a014b3ed081c"},a("div",{key:"96e5f7dd2dfa6a104ca709d1399308a86041c2f3",id:"container",style:{width:"100%",height:"100%"}}))}},[513,"apollo-data-bar-chart",{adData:[1,"ad-data"],adSpec:[1,"ad-spec"]}]),d=i,s=function(){"undefined"!=typeof customElements&&["apollo-data-bar-chart"].forEach((e=>{"apollo-data-bar-chart"===e&&(customElements.get(t(e))||customElements.define(t(e),i))}))};export{d as ApolloDataBarChart,s as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ApolloDataLineChart extends Components.ApolloDataLineChart, HTMLElement {}
|
|
4
|
+
export const ApolloDataLineChart: {
|
|
5
|
+
prototype: ApolloDataLineChart;
|
|
6
|
+
new (): ApolloDataLineChart;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,h as t,H as a,t as l}from"./p-Dws5s-Xe.js";import{A as n}from"./p-7XF5Cax8.js";import{C as o}from"./p-2nuV5Vny.js";const i="apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",r=e(class e extends n{constructor(e){super(!1),!1!==e&&this.__registerHost(),this.__attachShadow()}get el(){return this}adData=[];adSpec=null;static tooltipStylesInjected=!1;componentDidLoad(){this.injectTooltipStyles()}async componentDidRender(){await this.renderChart()}injectTooltipStyles(){if(e.tooltipStylesInjected)return;const t="apollo-data-line-tooltip-styles";if(document.getElementById(t))return void(e.tooltipStylesInjected=!0);const a=document.createElement("style");a.id=t,a.textContent="\n #vg-tooltip-element {\n background-color: #ffffff;\n border: 1px solid #e1e2e8;\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);\n font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;\n font-weight: 500;\n padding: 0.25rem 0.75rem;\n pointer-events: none;\n text-align: center;\n transform: translateY(20%);\n white-space: pre;\n z-index: 999999999;\n }\n\n #vg-tooltip-element table tr td.key {\n color: #6a6d7d;\n text-align: center;\n }\n\n #vg-tooltip-element table tr td.value {\n text-align: center;\n }\n\n #vg-tooltip-element.dark-theme {\n background-color: #292632;\n border: 1px solid #6a6d7d;\n box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);\n color: #ffffff;\n }\n\n #vg-tooltip-element::after {\n border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;\n border-style: solid;\n border-width: 9px;\n bottom: -17px;\n content: '';\n left: 50%;\n position: absolute;\n transform: translateX(-50%);\n }\n ",document.head.appendChild(a),e.tooltipStylesInjected=!0}async getViewData(e,t){if(!t)throw Error("adSpec is required for apollo-data-line-chart");const{tooltipPrefix:a="",currencySymbol:l=""}=t;if(!e||0===e.length)throw Error("Data is required for apollo-data-line-chart");const n=Array.from(new Set(e.map((e=>e.category)))),r=[...new Set(e.map((e=>e.xValue)))].sort(((e,t)=>e-t)),d=t?.colorSet??o,s=r.map((t=>{const a=e.find((e=>e.xValue===t));return{xValue:t,displayLabel:null!=a?.xLabel?a.xLabel:t+""}})),c=a?".2f":".0f",m=a?l:"",p=t.pointStyle??"circle",u=function(e){switch(e){case"dashed":return[6,4];case"dotted":return[2,2];default:return[]}}(t.lineStyle??"solid"),f=[{name:"raw",values:e},{name:"xLabelData",values:s}];n.forEach(((e,t)=>{f.push({name:"series_"+t,source:"raw",transform:[{type:"filter",expr:"datum.category === "+JSON.stringify(e)},{type:"collect",sort:{field:"xValue"}}]})}));const b=n.map(((e,t)=>({type:"line",from:{data:"series_"+t},encode:{enter:{x:{scale:"x",field:"xValue"},y:{scale:"y",field:"yValue"},stroke:{value:d[t%d.length]},strokeWidth:{value:2},interpolate:{value:"monotone"},...u.length>0?{strokeDash:{value:u}}:{}}}})));return{$schema:"https://vega.github.io/schema/vega/v5.json",config:{text:{fill:"#6a6d7d",font:i,labelFontSize:12,labelFontWeight:400},axis:{labelColor:"#6a6d7d",titleColor:"#6a6d7d",labelFont:i,titleFont:i,titleFontWeight:400},legend:{labelColor:"#6a6d7d",titleColor:"#6a6d7d",labelFont:i,titleFont:i,labelFontSize:12,labelLimit:95},title:{color:"#6a6d7d",font:i,labelFontSize:12,labelFontWeight:400}},height:250,autosize:{type:"fit-x",contains:"padding",resize:!0},signals:[{name:"containerW",update:"max(containerSize()[0], 400)"},{name:"legendColumns",update:"ceil(containerW / 140)"}],width:{signal:"containerW"},data:f,scales:[{name:"x",type:"point",domain:r,range:"width",padding:.5},{name:"xLabels",type:"ordinal",domain:{data:"xLabelData",field:"xValue"},range:{data:"xLabelData",field:"displayLabel"}},{name:"y",type:"linear",domain:{data:"raw",field:"yValue"},nice:!0,zero:!0,range:"height"},{name:"color",type:"ordinal",domain:n,range:t?.colorSet??o}],axes:[{orient:"bottom",scale:"x",title:t?.xAxisTitle,labelPadding:12,titlePadding:12,labelAngle:-90,labelAlign:"right",labelBaseline:"middle",tickSize:3,labelFontSize:12,titleFontSize:14,ticks:!1,domain:!1,encode:{labels:{update:{text:{signal:"scale('xLabels', datum.value)"}}}}},{orient:"left",scale:"y",title:t?.yAxisTitle||"",format:",.0f",grid:!0,tickCount:6,labelFontSize:12,titleFontSize:14,ticks:!1,domain:!1,tickBand:"extent",labelPadding:10}],legends:[{stroke:"color",orient:"bottom",direction:"horizontal",columns:{signal:"legendColumns"},title:null,symbolType:"stroke",symbolStrokeWidth:3,rowPadding:8,symbolOffset:-35,symbolSize:100,labelOffset:8,labelLimit:95}],marks:[...b,{type:"symbol",from:{data:"raw"},encode:{enter:{x:{scale:"x",field:"xValue"},y:{scale:"y",field:"yValue"},fill:{scale:"color",field:"category"},size:{value:50},shape:{value:p},tooltip:{signal:`(datum.xLabel != null ? datum.xLabel : format(datum.xValue, ',.0f')) + ' · ' + datum.category + ': ' + (datum.yLabel != null ? datum.yLabel : '${m}' + format(datum.yValue, ',${c}'))`}}}}]}}render(){return t(a,{key:"7799f01536f212d7a06da08c1e463d8529c5bf21"},t("div",{key:"25463f10bbc0f5443c35ab03b5b53164d9ad1efd",id:"container",style:{width:"100%",height:"100%"}}))}},[513,"apollo-data-line-chart",{adData:[1,"ad-data"],adSpec:[1,"ad-spec"]}]),d=r,s=function(){"undefined"!=typeof customElements&&["apollo-data-line-chart"].forEach((e=>{"apollo-data-line-chart"===e&&(customElements.get(l(e))||customElements.define(l(e),r))}))};export{d as ApolloDataLineChart,s as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface ApolloDataScatterChart extends Components.ApolloDataScatterChart, HTMLElement {}
|
|
4
|
+
export const ApolloDataScatterChart: {
|
|
5
|
+
prototype: ApolloDataScatterChart;
|
|
6
|
+
new (): ApolloDataScatterChart;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,h as a,H as l,t}from"./p-Dws5s-Xe.js";import{A as i}from"./p-7XF5Cax8.js";const s=e(class extends i{constructor(e){super(!1),!1!==e&&this.__registerHost(),this.__attachShadow()}get el(){return this}adData=[];adSpec={};async componentDidRender(){await this.renderChart()}DEFAULT_POINT_STYLE={shape:"circle",opacity:1,color:"blue",size:1};async getViewData(e,a){const l=e.map((e=>{const l={};return Object.keys(this.DEFAULT_POINT_STYLE).forEach((t=>{l[t]=e.pointStyle?.[t]??e?.[t]??a.categoryPointStyleMap?.[e.category]?.[t]??a.defaultPointStyle?.[t]??this.DEFAULT_POINT_STYLE[t]})),{category:e.category,xValue:e.xValue,yValue:e.yValue,color:l.color,shape:l.shape,opacity:l.opacity}})),t="auto"===a?.tooltip?"category":"none";return{$schema:"https://vega.github.io/schema/vega/v6.json",description:"A scatter plot with null values visualized along the axes.",width:450,height:450,padding:5,autosize:{type:"fit",resize:!0},signals:[{name:"nullSize",value:8},{name:"nullGap",update:"nullSize + 10"}],data:[{name:"source",values:l},{name:"valid",source:"source",transform:[{type:"filter",expr:"datum.xValue != null && datum.yValue != null"}]},{name:"nullXY",source:"source",transform:[{type:"filter",expr:"datum.xValue == null && datum.yValue == null"},{type:"aggregate"}]},{name:"nullY",source:"source",transform:[{type:"filter",expr:"datum.xValue != null && datum.yValue == null"}]},{name:"nullX",source:"source",transform:[{type:"filter",expr:"datum.xValue == null && datum.yValue != null"}]}],scales:[{name:"xscale",type:"linear",range:[{signal:"nullGap"},{signal:"width"}],nice:!0,domain:{data:"valid",field:"xValue"}},{name:"yscale",type:"linear",range:[{signal:"height - nullGap"},0],nice:!0,domain:{data:"valid",field:"yValue"}}],axes:[{orient:"bottom",scale:"xscale",offset:5,format:"s",title:a?.xAxisTitle||"X Value"},{orient:"left",scale:"yscale",offset:5,format:"s",title:a?.yAxisTitle||"Y Value"}],marks:[{type:"symbol",from:{data:"valid"},encode:{enter:{size:{value:50},tooltip:{field:t}},update:{x:{scale:"xscale",field:"xValue"},y:{scale:"yscale",field:"yValue"},fill:{field:"color"},fillOpacity:{field:"opacity"},shape:{field:"shape"},zindex:{value:0}},hover:{fill:{value:"firebrick"},fillOpacity:{value:1},zindex:{value:1}}}},{type:"symbol",from:{data:"nullY"},encode:{enter:{size:{value:50},tooltip:{field:t}},update:{x:{scale:"xscale",field:"xValue"},y:{signal:"height - nullSize/2"},fill:{value:"#aaa"},fillOpacity:{value:.2}},hover:{fill:{value:"firebrick"},fillOpacity:{value:1}}}},{type:"symbol",from:{data:"nullX"},encode:{enter:{size:{value:50},tooltip:{field:"name"}},update:{x:{signal:"nullSize/2"},y:{scale:"yscale",field:"yValue"},fill:{value:"#aaa"},fillOpacity:{value:.2},zindex:{value:0}},hover:{fill:{value:"firebrick"},fillOpacity:{value:1},zindex:{value:1}}}},{type:"text",interactive:!1,from:{data:"nullXY"},encode:{update:{x:{signal:"nullSize",offset:-4},y:{signal:"height",offset:13},text:{signal:"datum.count + ' null'"},align:{value:"right"},baseline:{value:"top"},fill:{value:"#999"},fontSize:{value:9}}}}]}}render(){return a(l,{key:"60005ab926b0153b3e31729a69f5a64cf6558085"},a("div",{key:"820de3e0ddbbc2650b9764e279d87531338e72e3",id:"container",style:{width:"100%",height:"100%"}}))}},[513,"apollo-data-scatter-chart",{adData:[1,"ad-data"],adSpec:[1,"ad-spec"]}]),u=s,n=function(){"undefined"!=typeof customElements&&["apollo-data-scatter-chart"].forEach((e=>{"apollo-data-scatter-chart"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))};export{u as ApolloDataScatterChart,n as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f=["#4d1ab2","#f99170","#e550c8","#ffd563","#8857fa","#52ebba","#bf1d78","#31cff8"];export{f as C}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { r as registerInstance, g as getElement, h, H as Host } from './index-Bb2nY-Tf.js';
|
|
2
|
+
import { A as ApolloBase } from './apollo-data-base-BWkrM8dc.js';
|
|
3
|
+
import { C as CHART_COLORS } from './constants-2nuV5Vny.js';
|
|
4
|
+
|
|
5
|
+
const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
6
|
+
const ApolloDataBarChart = class extends ApolloBase {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
super();
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
get el() { return getElement(this); }
|
|
12
|
+
adData = [];
|
|
13
|
+
adSpec = null;
|
|
14
|
+
static tooltipStylesInjected = false;
|
|
15
|
+
componentDidLoad() {
|
|
16
|
+
this.injectTooltipStyles();
|
|
17
|
+
}
|
|
18
|
+
async componentDidRender() {
|
|
19
|
+
await this.renderChart();
|
|
20
|
+
}
|
|
21
|
+
injectTooltipStyles() {
|
|
22
|
+
if (ApolloDataBarChart.tooltipStylesInjected) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const styleId = 'apollo-data-bar-tooltip-styles';
|
|
26
|
+
if (document.getElementById(styleId)) {
|
|
27
|
+
ApolloDataBarChart.tooltipStylesInjected = true;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const style = document.createElement('style');
|
|
31
|
+
style.id = styleId;
|
|
32
|
+
style.textContent = `
|
|
33
|
+
#vg-tooltip-element {
|
|
34
|
+
background-color: #ffffff;
|
|
35
|
+
border: 1px solid #e1e2e8;
|
|
36
|
+
border-radius: 0.25rem;
|
|
37
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);
|
|
38
|
+
font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
padding: 0.25rem 0.75rem;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
text-align: center;
|
|
43
|
+
transform: translateY(20%);
|
|
44
|
+
white-space: pre;
|
|
45
|
+
z-index: 999999999;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#vg-tooltip-element table tr td.key {
|
|
49
|
+
color: #6a6d7d;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#vg-tooltip-element table tr td.value {
|
|
54
|
+
text-align: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#vg-tooltip-element.dark-theme {
|
|
58
|
+
background-color: #292632;
|
|
59
|
+
border: 1px solid #6a6d7d;
|
|
60
|
+
box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);
|
|
61
|
+
color: #ffffff;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#vg-tooltip-element::after {
|
|
65
|
+
border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
|
|
66
|
+
border-style: solid;
|
|
67
|
+
border-width: 9px;
|
|
68
|
+
bottom: -17px;
|
|
69
|
+
content: '';
|
|
70
|
+
left: 50%;
|
|
71
|
+
position: absolute;
|
|
72
|
+
transform: translateX(-50%);
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
document.head.appendChild(style);
|
|
76
|
+
ApolloDataBarChart.tooltipStylesInjected = true;
|
|
77
|
+
}
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
async getViewData(data, spec) {
|
|
80
|
+
if (!spec) {
|
|
81
|
+
throw new Error('adSpec is required for apollo-data-bar-chart');
|
|
82
|
+
}
|
|
83
|
+
const { tooltipPrefix = '', currencySymbol = '' } = spec;
|
|
84
|
+
if (!data || data.length === 0) {
|
|
85
|
+
throw new Error('Data is required for apollo-data-bar-chart');
|
|
86
|
+
}
|
|
87
|
+
const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
|
|
88
|
+
const formatNumber = tooltipPrefix ? '.2f' : '.0f';
|
|
89
|
+
const currencyPrefix = tooltipPrefix ? currencySymbol : '';
|
|
90
|
+
return {
|
|
91
|
+
$schema: 'https://vega.github.io/schema/vega/v5.json',
|
|
92
|
+
config: {
|
|
93
|
+
text: {
|
|
94
|
+
fill: '#6a6d7d',
|
|
95
|
+
font: FONT_FAMILY,
|
|
96
|
+
labelFontSize: 12,
|
|
97
|
+
labelFontWeight: 400,
|
|
98
|
+
},
|
|
99
|
+
axis: {
|
|
100
|
+
labelColor: '#6a6d7d',
|
|
101
|
+
titleColor: '#6a6d7d',
|
|
102
|
+
labelFont: FONT_FAMILY,
|
|
103
|
+
titleFont: FONT_FAMILY,
|
|
104
|
+
titleFontWeight: 400,
|
|
105
|
+
},
|
|
106
|
+
legend: {
|
|
107
|
+
labelColor: '#6a6d7d',
|
|
108
|
+
titleColor: '#6a6d7d',
|
|
109
|
+
labelFont: FONT_FAMILY,
|
|
110
|
+
titleFont: FONT_FAMILY,
|
|
111
|
+
labelFontSize: 12,
|
|
112
|
+
labelLimit: 95,
|
|
113
|
+
},
|
|
114
|
+
title: {
|
|
115
|
+
color: '#6a6d7d',
|
|
116
|
+
font: FONT_FAMILY,
|
|
117
|
+
labelFontSize: 12,
|
|
118
|
+
labelFontWeight: 400,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
height: 250,
|
|
122
|
+
autosize: { type: 'fit-x', contains: 'padding', resize: true },
|
|
123
|
+
signals: [
|
|
124
|
+
{
|
|
125
|
+
name: 'containerW',
|
|
126
|
+
update: 'max(containerSize()[0], 400)',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'legendColumns',
|
|
130
|
+
update: 'ceil(containerW / 140)',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'hoveredPeriod',
|
|
134
|
+
value: null,
|
|
135
|
+
on: [
|
|
136
|
+
{ events: 'rect:mouseover', update: 'datum.period' },
|
|
137
|
+
{ events: 'rect:mouseout', update: 'null' },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
width: { signal: 'containerW' },
|
|
142
|
+
data: [
|
|
143
|
+
{
|
|
144
|
+
name: 'raw',
|
|
145
|
+
values: data,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'periodTotals',
|
|
149
|
+
source: 'raw',
|
|
150
|
+
transform: [
|
|
151
|
+
{
|
|
152
|
+
type: 'aggregate',
|
|
153
|
+
groupby: ['periodId'],
|
|
154
|
+
fields: ['value'],
|
|
155
|
+
ops: ['sum'],
|
|
156
|
+
as: ['total'],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'table',
|
|
162
|
+
source: 'raw',
|
|
163
|
+
transform: [
|
|
164
|
+
{
|
|
165
|
+
type: 'lookup',
|
|
166
|
+
from: 'periodTotals',
|
|
167
|
+
key: 'periodId',
|
|
168
|
+
fields: ['periodId'],
|
|
169
|
+
values: ['total'],
|
|
170
|
+
as: ['total'],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'stack',
|
|
174
|
+
groupby: ['periodId'],
|
|
175
|
+
sort: { field: 'category' },
|
|
176
|
+
field: 'value',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: 'formula',
|
|
180
|
+
as: 'periodId',
|
|
181
|
+
expr: 'datum.periodId',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'formula',
|
|
185
|
+
as: 'labelOnly',
|
|
186
|
+
expr: 'datum.label',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'periodLabels',
|
|
192
|
+
source: 'raw',
|
|
193
|
+
transform: [
|
|
194
|
+
{
|
|
195
|
+
type: 'aggregate',
|
|
196
|
+
groupby: ['periodId', 'label'],
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
scales: [
|
|
202
|
+
{
|
|
203
|
+
name: 'x',
|
|
204
|
+
type: 'band',
|
|
205
|
+
domain: { data: 'table', field: 'periodId' },
|
|
206
|
+
range: 'width',
|
|
207
|
+
paddingInner: 0.35,
|
|
208
|
+
paddingOuter: 0.02,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'xLabels',
|
|
212
|
+
type: 'ordinal',
|
|
213
|
+
domain: { data: 'periodLabels', field: 'periodId' },
|
|
214
|
+
range: { data: 'periodLabels', field: 'label' },
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'y',
|
|
218
|
+
type: 'linear',
|
|
219
|
+
domain: { data: 'table', field: 'y1' },
|
|
220
|
+
nice: true,
|
|
221
|
+
zero: true,
|
|
222
|
+
range: 'height',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'color',
|
|
226
|
+
type: 'ordinal',
|
|
227
|
+
domain: uniqueCategories,
|
|
228
|
+
range: spec?.colorSet ?? CHART_COLORS,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
axes: [
|
|
232
|
+
{
|
|
233
|
+
orient: 'bottom',
|
|
234
|
+
scale: 'x',
|
|
235
|
+
title: spec?.xAxisTitle,
|
|
236
|
+
labelPadding: 12,
|
|
237
|
+
titlePadding: 12,
|
|
238
|
+
labelAngle: -90,
|
|
239
|
+
labelAlign: 'right',
|
|
240
|
+
labelBaseline: 'middle',
|
|
241
|
+
tickSize: 3,
|
|
242
|
+
labelFontSize: 12,
|
|
243
|
+
titleFontSize: 14,
|
|
244
|
+
ticks: false,
|
|
245
|
+
domain: false,
|
|
246
|
+
encode: {
|
|
247
|
+
labels: {
|
|
248
|
+
update: {
|
|
249
|
+
text: { signal: "scale('xLabels', datum.value)" },
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
orient: 'left',
|
|
256
|
+
scale: 'y',
|
|
257
|
+
title: spec?.yAxisTitle || '',
|
|
258
|
+
format: ',.0f',
|
|
259
|
+
grid: true,
|
|
260
|
+
tickCount: 6,
|
|
261
|
+
labelFontSize: 12,
|
|
262
|
+
titleFontSize: 14,
|
|
263
|
+
ticks: false,
|
|
264
|
+
domain: false,
|
|
265
|
+
tickBand: 'extent',
|
|
266
|
+
labelPadding: 10,
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
legends: [
|
|
270
|
+
{
|
|
271
|
+
fill: 'color',
|
|
272
|
+
orient: 'bottom',
|
|
273
|
+
direction: 'horizontal',
|
|
274
|
+
columns: { signal: 'legendColumns' },
|
|
275
|
+
title: null,
|
|
276
|
+
symbolType: 'square',
|
|
277
|
+
rowPadding: 8,
|
|
278
|
+
symbolOffset: -35,
|
|
279
|
+
symbolSize: 100,
|
|
280
|
+
labelOffset: 8,
|
|
281
|
+
labelLimit: 95,
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
marks: [
|
|
285
|
+
{
|
|
286
|
+
type: 'rect',
|
|
287
|
+
from: { data: 'table' },
|
|
288
|
+
encode: {
|
|
289
|
+
enter: {
|
|
290
|
+
x: { scale: 'x', field: 'periodId' },
|
|
291
|
+
width: { scale: 'x', band: 1 },
|
|
292
|
+
y: { scale: 'y', field: 'y1' },
|
|
293
|
+
y2: { scale: 'y', field: 'y0' },
|
|
294
|
+
fill: { scale: 'color', field: 'category' },
|
|
295
|
+
tooltip: {
|
|
296
|
+
signal: `datum.category + ': ${currencyPrefix}' + format(datum.value, ',${formatNumber}') + '\\nTotal: ${currencyPrefix}' + format(datum.total, ',${formatNumber}')`,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
update: {
|
|
300
|
+
opacity: [{ test: 'hoveredPeriod && datum.period !== hoveredPeriod', value: 0.2 }, { value: 1 }],
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
render() {
|
|
308
|
+
return (h(Host, { key: '86ed2e74e5abd57e684a93bc9cf6a014b3ed081c' }, h("div", { key: '96e5f7dd2dfa6a104ca709d1399308a86041c2f3', id: "container", style: { width: '100%', height: '100%' } })));
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export { ApolloDataBarChart as apollo_data_bar_chart };
|