@xplortech/apollo-data 0.0.5 → 0.0.7

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 (84) hide show
  1. package/README.md +15 -91
  2. package/dist/apollo-data/apollo-data.esm.js +1 -1
  3. package/dist/apollo-data/p-4d3f0792.entry.js +1 -0
  4. package/dist/apollo-data/p-C2k3WBpi.js +11 -0
  5. package/dist/apollo-data/p-D64asVrg.js +2 -0
  6. package/dist/apollo-data/{p-b7471c12.entry.js → p-e2c3a317.entry.js} +1 -1
  7. package/dist/cjs/apollo-data-bar-chart_5.cjs.entry.js +1193 -0
  8. package/dist/cjs/{apollo-data-base-CxVQ-WVP.js → apollo-data-base-COGMOEqL.js} +7 -11
  9. package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +3 -3
  10. package/dist/cjs/apollo-data.cjs.js +3 -3
  11. package/dist/cjs/{index-Cl7HgRm0.js → index-Bd5risOy.js} +116 -63
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/collection/apollo-data-base.js +4 -8
  14. package/dist/collection/collection-manifest.json +5 -2
  15. package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +10 -9
  16. package/dist/collection/components/apollo-data-bar/apollo-data-bar.stories.js +122 -0
  17. package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +1 -1
  18. package/dist/collection/components/apollo-data-donut/apollo-data-donut.stories.js +132 -0
  19. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.js +208 -0
  20. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.stories.js +137 -0
  21. package/dist/collection/components/apollo-data-line/apollo-data-line.js +8 -6
  22. package/dist/collection/components/apollo-data-line/apollo-data-line.stories.js +122 -0
  23. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +1 -1
  24. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.stories.js +147 -0
  25. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.js +294 -0
  26. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.stories.js +126 -0
  27. package/dist/collection/examples/apollo-data-heat-map.examples.js +131 -0
  28. package/dist/collection/examples/apollo-data-world-map.examples.js +45 -0
  29. package/dist/collection/examples/index.js +2 -0
  30. package/dist/collection/utils/code-generator.js +1 -1
  31. package/dist/components/apollo-data-bar-chart.js +1 -1
  32. package/dist/components/apollo-data-donut-chart.js +1 -1
  33. package/dist/components/apollo-data-heat-map.d.ts +11 -0
  34. package/dist/components/apollo-data-heat-map.js +1 -0
  35. package/dist/components/apollo-data-line-chart.js +1 -1
  36. package/dist/components/apollo-data-scatter-chart.js +1 -1
  37. package/dist/components/apollo-data-world-map-chart.d.ts +11 -0
  38. package/dist/components/apollo-data-world-map-chart.js +1 -0
  39. package/dist/components/index.js +1 -1
  40. package/dist/components/p-CfbMSXKd.js +11 -0
  41. package/dist/components/p-gcjU8DVr.js +1 -0
  42. package/dist/esm/apollo-data-bar-chart_5.entry.js +1187 -0
  43. package/dist/esm/{apollo-data-base-BWkrM8dc.js → apollo-data-base-C2k3WBpi.js} +7 -11
  44. package/dist/esm/apollo-data-donut-chart.entry.js +3 -3
  45. package/dist/esm/apollo-data.js +4 -4
  46. package/dist/esm/{index-Bb2nY-Tf.js → index-D64asVrg.js} +116 -63
  47. package/dist/esm/loader.js +3 -3
  48. package/dist/types/apollo-data-base.d.ts +2 -2
  49. package/dist/types/components/apollo-data-bar/apollo-data-bar.stories.d.ts +5 -0
  50. package/dist/types/components/apollo-data-donut/apollo-data-donut.stories.d.ts +5 -0
  51. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.d.ts +140 -0
  52. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.stories.d.ts +5 -0
  53. package/dist/types/components/apollo-data-line/apollo-data-line.stories.d.ts +5 -0
  54. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +1 -3
  55. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.stories.d.ts +5 -0
  56. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.d.ts +281 -0
  57. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.stories.d.ts +5 -0
  58. package/dist/types/components.d.ts +128 -8
  59. package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
  60. package/dist/types/examples/apollo-data-scatter.examples.d.ts +1 -1
  61. package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
  62. package/dist/types/examples/index.d.ts +2 -0
  63. package/dist/types/stencil-public-runtime.d.ts +23 -2
  64. package/dist/types/utils/code-generator.d.ts +1 -3
  65. package/package.json +8 -8
  66. package/src/examples/apollo-data-bar.examples.ts +157 -157
  67. package/src/examples/apollo-data-heat-map.examples.ts +147 -0
  68. package/src/examples/apollo-data-line.examples.ts +91 -91
  69. package/src/examples/apollo-data-scatter.examples.ts +1 -1
  70. package/src/examples/apollo-data-world-map.examples.ts +57 -0
  71. package/src/examples/index.ts +3 -1
  72. package/dist/apollo-data/p-2nuV5Vny.js +0 -1
  73. package/dist/apollo-data/p-4ac3c97c.entry.js +0 -1
  74. package/dist/apollo-data/p-BWkrM8dc.js +0 -11
  75. package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
  76. package/dist/apollo-data/p-e518baac.entry.js +0 -1
  77. package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +0 -314
  78. package/dist/cjs/apollo-data-line-chart_2.cjs.entry.js +0 -534
  79. package/dist/cjs/constants-B3weDEpc.js +0 -5
  80. package/dist/components/p-7XF5Cax8.js +0 -11
  81. package/dist/components/p-Dws5s-Xe.js +0 -1
  82. package/dist/esm/apollo-data-bar-chart.entry.js +0 -312
  83. package/dist/esm/apollo-data-line-chart_2.entry.js +0 -531
  84. package/dist/esm/constants-2nuV5Vny.js +0 -3
@@ -1,103 +1,103 @@
1
1
  import { LineDataItem, LineSpec } from '../components/apollo-data-line/apollo-data-line';
2
2
 
3
3
  export interface LineExample {
4
- name: string;
5
- description: string;
6
- props: {
7
- adData: LineDataItem[];
8
- adSpec?: LineSpec;
9
- };
10
- notes?: string;
4
+ name: string;
5
+ description: string;
6
+ props: {
7
+ adData: LineDataItem[];
8
+ adSpec?: LineSpec;
9
+ };
10
+ notes?: string;
11
11
  }
12
12
 
13
13
  /** Each item has category, xValue, yValue, and optional xLabel/yLabel. When labels are omitted, numeric values are shown. */
14
14
  export const lineExamples: LineExample[] = [
15
- {
16
- name: 'Revenue and Expenses by Day',
17
- description: 'Line chart showing daily revenue and expenses over a week',
18
- props: {
19
- adData: [
20
- { category: 'Revenue', xValue: 1, yValue: 5000, xLabel: 'Mon' },
21
- { category: 'Expenses', xValue: 1, yValue: 2000, xLabel: 'Mon' },
22
- { category: 'Revenue', xValue: 2, yValue: 6000, xLabel: 'Tue' },
23
- { category: 'Expenses', xValue: 2, yValue: 2500, xLabel: 'Tue' },
24
- { category: 'Revenue', xValue: 3, yValue: 5500, xLabel: 'Wed' },
25
- { category: 'Expenses', xValue: 3, yValue: 2200, xLabel: 'Wed' },
26
- { category: 'Revenue', xValue: 4, yValue: 7000, xLabel: 'Thu' },
27
- { category: 'Expenses', xValue: 4, yValue: 3000, xLabel: 'Thu' },
28
- { category: 'Revenue', xValue: 5, yValue: 6500, xLabel: 'Fri' },
29
- { category: 'Expenses', xValue: 5, yValue: 2800, xLabel: 'Fri' },
30
- ],
31
- adSpec: {
32
- tooltipPrefix: '$',
33
- currencySymbol: '$',
34
- yAxisTitle: 'Amount',
35
- colorSet: ['#FF8DF4', '#74FBD0'],
36
- },
37
- },
15
+ {
16
+ name: 'Revenue and Expenses by Day',
17
+ description: 'Line chart showing daily revenue and expenses over a week',
18
+ props: {
19
+ adData: [
20
+ { category: 'Revenue', xValue: 1, yValue: 5000, xLabel: 'Mon' },
21
+ { category: 'Expenses', xValue: 1, yValue: 2000, xLabel: 'Mon' },
22
+ { category: 'Revenue', xValue: 2, yValue: 6000, xLabel: 'Tue' },
23
+ { category: 'Expenses', xValue: 2, yValue: 2500, xLabel: 'Tue' },
24
+ { category: 'Revenue', xValue: 3, yValue: 5500, xLabel: 'Wed' },
25
+ { category: 'Expenses', xValue: 3, yValue: 2200, xLabel: 'Wed' },
26
+ { category: 'Revenue', xValue: 4, yValue: 7000, xLabel: 'Thu' },
27
+ { category: 'Expenses', xValue: 4, yValue: 3000, xLabel: 'Thu' },
28
+ { category: 'Revenue', xValue: 5, yValue: 6500, xLabel: 'Fri' },
29
+ { category: 'Expenses', xValue: 5, yValue: 2800, xLabel: 'Fri' },
30
+ ],
31
+ adSpec: {
32
+ tooltipPrefix: '$',
33
+ currencySymbol: '$',
34
+ yAxisTitle: 'Amount',
35
+ colorSet: ['#FF8DF4', '#74FBD0'],
36
+ },
38
37
  },
39
- {
40
- name: 'Monthly Sales by Product',
41
- description: 'Multi-line chart showing sales across products by month',
42
- props: {
43
- adData: [
44
- { category: 'Product A', xValue: 1, yValue: 12000, xLabel: 'Jan' },
45
- { category: 'Product B', xValue: 1, yValue: 8000, xLabel: 'Jan' },
46
- { category: 'Product C', xValue: 1, yValue: 6000, xLabel: 'Jan' },
47
- { category: 'Product A', xValue: 2, yValue: 15000, xLabel: 'Feb' },
48
- { category: 'Product B', xValue: 2, yValue: 9000, xLabel: 'Feb' },
49
- { category: 'Product C', xValue: 2, yValue: 7000, xLabel: 'Feb' },
50
- { category: 'Product A', xValue: 3, yValue: 13000, xLabel: 'Mar' },
51
- { category: 'Product B', xValue: 3, yValue: 10000, xLabel: 'Mar' },
52
- { category: 'Product C', xValue: 3, yValue: 5500, xLabel: 'Mar' },
53
- { category: 'Product A', xValue: 4, yValue: 14000, xLabel: 'Apr' },
54
- { category: 'Product B', xValue: 4, yValue: 9500, xLabel: 'Apr' },
55
- { category: 'Product C', xValue: 4, yValue: 6500, xLabel: 'Apr' },
56
- ],
57
- adSpec: {
58
- tooltipPrefix: '$',
59
- currencySymbol: '$',
60
- yAxisTitle: 'Monthly Sales',
61
- colorSet: ['#FF8DF4', '#74FBD0', '#ECFD91'],
62
- },
63
- },
38
+ },
39
+ {
40
+ name: 'Monthly Sales by Product',
41
+ description: 'Multi-line chart showing sales across products by month',
42
+ props: {
43
+ adData: [
44
+ { category: 'Product A', xValue: 1, yValue: 12000, xLabel: 'Jan' },
45
+ { category: 'Product B', xValue: 1, yValue: 8000, xLabel: 'Jan' },
46
+ { category: 'Product C', xValue: 1, yValue: 6000, xLabel: 'Jan' },
47
+ { category: 'Product A', xValue: 2, yValue: 15000, xLabel: 'Feb' },
48
+ { category: 'Product B', xValue: 2, yValue: 9000, xLabel: 'Feb' },
49
+ { category: 'Product C', xValue: 2, yValue: 7000, xLabel: 'Feb' },
50
+ { category: 'Product A', xValue: 3, yValue: 13000, xLabel: 'Mar' },
51
+ { category: 'Product B', xValue: 3, yValue: 10000, xLabel: 'Mar' },
52
+ { category: 'Product C', xValue: 3, yValue: 5500, xLabel: 'Mar' },
53
+ { category: 'Product A', xValue: 4, yValue: 14000, xLabel: 'Apr' },
54
+ { category: 'Product B', xValue: 4, yValue: 9500, xLabel: 'Apr' },
55
+ { category: 'Product C', xValue: 4, yValue: 6500, xLabel: 'Apr' },
56
+ ],
57
+ adSpec: {
58
+ tooltipPrefix: '$',
59
+ currencySymbol: '$',
60
+ yAxisTitle: 'Monthly Sales',
61
+ colorSet: ['#FF8DF4', '#74FBD0', '#ECFD91'],
62
+ },
64
63
  },
65
- {
66
- name: 'Single Series',
67
- description: 'Line chart with one category (visitors over time)',
68
- props: {
69
- adData: [
70
- { category: 'Visitors', xValue: 1, yValue: 2450, xLabel: 'Mon' },
71
- { category: 'Visitors', xValue: 2, yValue: 2680, xLabel: 'Tue' },
72
- { category: 'Visitors', xValue: 3, yValue: 2320, xLabel: 'Wed' },
73
- { category: 'Visitors', xValue: 4, yValue: 2890, xLabel: 'Thu' },
74
- { category: 'Visitors', xValue: 5, yValue: 3150, xLabel: 'Fri' },
75
- { category: 'Visitors', xValue: 6, yValue: 3420, xLabel: 'Sat' },
76
- { category: 'Visitors', xValue: 7, yValue: 3280, xLabel: 'Sun' },
77
- ],
78
- adSpec: {
79
- yAxisTitle: 'Daily Visitors',
80
- colorSet: ['#6366f1'],
81
- },
82
- },
64
+ },
65
+ {
66
+ name: 'Single Series',
67
+ description: 'Line chart with one category (visitors over time)',
68
+ props: {
69
+ adData: [
70
+ { category: 'Visitors', xValue: 1, yValue: 2450, xLabel: 'Mon' },
71
+ { category: 'Visitors', xValue: 2, yValue: 2680, xLabel: 'Tue' },
72
+ { category: 'Visitors', xValue: 3, yValue: 2320, xLabel: 'Wed' },
73
+ { category: 'Visitors', xValue: 4, yValue: 2890, xLabel: 'Thu' },
74
+ { category: 'Visitors', xValue: 5, yValue: 3150, xLabel: 'Fri' },
75
+ { category: 'Visitors', xValue: 6, yValue: 3420, xLabel: 'Sat' },
76
+ { category: 'Visitors', xValue: 7, yValue: 3280, xLabel: 'Sun' },
77
+ ],
78
+ adSpec: {
79
+ yAxisTitle: 'Daily Visitors',
80
+ colorSet: ['#6366f1'],
81
+ },
83
82
  },
84
- {
85
- name: 'Custom Axis Titles',
86
- description: 'Line chart with custom x-axis and y-axis titles',
87
- props: {
88
- adData: [
89
- { category: 'Inbound', xValue: 1, yValue: 120, xLabel: 'Mon' },
90
- { category: 'Outbound', xValue: 1, yValue: 80, xLabel: 'Mon' },
91
- { category: 'Inbound', xValue: 2, yValue: 95, xLabel: 'Tue' },
92
- { category: 'Outbound', xValue: 2, yValue: 110, xLabel: 'Tue' },
93
- { category: 'Inbound', xValue: 3, yValue: 130, xLabel: 'Wed' },
94
- { category: 'Outbound', xValue: 3, yValue: 70, xLabel: 'Wed' },
95
- ],
96
- adSpec: {
97
- yAxisTitle: 'Calls',
98
- xAxisTitle: 'Support queue (by day)',
99
- colorSet: ['#4d1ab2', '#f99170'],
100
- },
101
- },
83
+ },
84
+ {
85
+ name: 'Custom Axis Titles',
86
+ description: 'Line chart with custom x-axis and y-axis titles',
87
+ props: {
88
+ adData: [
89
+ { category: 'Inbound', xValue: 1, yValue: 120, xLabel: 'Mon' },
90
+ { category: 'Outbound', xValue: 1, yValue: 80, xLabel: 'Mon' },
91
+ { category: 'Inbound', xValue: 2, yValue: 95, xLabel: 'Tue' },
92
+ { category: 'Outbound', xValue: 2, yValue: 110, xLabel: 'Tue' },
93
+ { category: 'Inbound', xValue: 3, yValue: 130, xLabel: 'Wed' },
94
+ { category: 'Outbound', xValue: 3, yValue: 70, xLabel: 'Wed' },
95
+ ],
96
+ adSpec: {
97
+ yAxisTitle: 'Calls',
98
+ xAxisTitle: 'Support queue (by day)',
99
+ colorSet: ['#4d1ab2', '#f99170'],
100
+ },
102
101
  },
102
+ },
103
103
  ];
@@ -1,4 +1,4 @@
1
- import { ScatterDataItem, ScatterSpec } from '../components';
1
+ import type { ScatterDataItem, ScatterSpec } from '../components/apollo-data-scatter/apollo-data-scatter';
2
2
 
3
3
  // Use the component's prop types directly
4
4
  export interface ScatterExamples {
@@ -0,0 +1,57 @@
1
+ import { WorldMapDataItem, WorldMapSpec } from '../components/apollo-data-world-map/apollo-data-world-map';
2
+
3
+ export interface WorldMapExample {
4
+ name: string;
5
+ description: string;
6
+ props: {
7
+ adData: WorldMapDataItem[];
8
+ adSpec?: WorldMapSpec;
9
+ };
10
+ notes?: string;
11
+ }
12
+
13
+ export const worldMapExamples: WorldMapExample[] = [
14
+ {
15
+ name: 'Global Sales Hubs',
16
+ description: 'World map with major city hubs and value markers.',
17
+ props: {
18
+ adData: [
19
+ { lon: -74.006, lat: 40.7128, value: 82, label: 'New York' },
20
+ { lon: -46.6333, lat: -23.5505, value: 64, label: 'São Paulo' },
21
+ { lon: -0.1276, lat: 51.5074, value: 58, label: 'London' },
22
+ { lon: 77.209, lat: 28.6139, value: 73, label: 'Delhi' },
23
+ { lon: 139.6917, lat: 35.6895, value: 69, label: 'Tokyo' },
24
+ { lon: 151.2093, lat: -33.8688, value: 47, label: 'Sydney' },
25
+ ],
26
+ adSpec: { pinColor: '#2563eb' },
27
+ },
28
+ },
29
+ {
30
+ name: 'EMEA Focus',
31
+ description: 'World map centered on EMEA business locations and values.',
32
+ props: {
33
+ adData: [
34
+ { lon: 13.405, lat: 52.52, value: 56, label: 'Berlin' },
35
+ { lon: 2.3522, lat: 48.8566, value: 59, label: 'Paris' },
36
+ { lon: 55.2708, lat: 25.2048, value: 45, label: 'Dubai' },
37
+ { lon: 18.4241, lat: -33.9249, value: 41, label: 'Cape Town' },
38
+ { lon: 36.8219, lat: -1.2921, value: 26, label: 'Nairobi' },
39
+ ],
40
+ adSpec: {},
41
+ },
42
+ },
43
+ {
44
+ name: 'APAC Expansion',
45
+ description: 'World map showing APAC expansion points and values.',
46
+ props: {
47
+ adData: [
48
+ { lon: 103.8198, lat: 1.3521, value: 62, label: 'Singapore' },
49
+ { lon: 126.978, lat: 37.5665, value: 53, label: 'Seoul' },
50
+ { lon: 106.8456, lat: -6.2088, value: 37, label: 'Jakarta' },
51
+ { lon: 100.5018, lat: 13.7563, value: 31, label: 'Bangkok' },
52
+ { lon: 174.7633, lat: -36.8485, value: 23, label: 'Auckland' },
53
+ ],
54
+ adSpec: {},
55
+ },
56
+ },
57
+ ];
@@ -1,3 +1,5 @@
1
1
  export * from './apollo-data-donut.examples';
2
2
  export * from './apollo-data-bar.examples';
3
- export * from './apollo-data-line.examples';
3
+ export * from './apollo-data-line.examples';
4
+ export * from './apollo-data-heat-map.examples';
5
+ export * from './apollo-data-world-map.examples';
@@ -1 +0,0 @@
1
- const f=["#4d1ab2","#f99170","#e550c8","#ffd563","#8857fa","#52ebba","#bf1d78","#31cff8"];export{f as C}
@@ -1 +0,0 @@
1
- import{r as e,g as t,h as a,H as o}from"./p-Bb2nY-Tf.js";import{A as l}from"./p-BWkrM8dc.js";import{C as n}from"./p-2nuV5Vny.js";const r="apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",i=class extends l{constructor(t){super(),e(this,t)}get el(){return t(this)}adData=[];adSpec=null;static tooltipStylesInjected=!1;componentDidLoad(){this.injectTooltipStyles()}async componentDidRender(){await this.renderChart()}injectTooltipStyles(){if(i.tooltipStylesInjected)return;const e="apollo-data-bar-tooltip-styles";if(document.getElementById(e))return void(i.tooltipStylesInjected=!0);const t=document.createElement("style");t.id=e,t.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(t),i.tooltipStylesInjected=!0}async getViewData(e,t){if(!t)throw new Error("adSpec is required for apollo-data-bar-chart");const{tooltipPrefix:a="",currencySymbol:o=""}=t;if(!e||0===e.length)throw new 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%"}}))}};export{i as apollo_data_bar_chart}