@mozaic-ds/web-components 0.5.0 → 0.6.1
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/package.json +3 -3
- package/public/ClickOutside-63071e7a.js +1 -15
- package/public/ClickOutside-63071e7a.js.map +1 -1
- package/public/DataTableDefaultAction.nested-4da4dc44.js +1 -759
- package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
- package/public/DataTableUtilities-60220c78.js +1 -370
- package/public/DataTableUtilities-60220c78.js.map +1 -1
- package/public/EventForward-8492ff62.js +1 -109
- package/public/EventForward-8492ff62.js.map +1 -1
- package/public/EventHandler-02058705.js +1 -15
- package/public/EventHandler-02058705.js.map +1 -1
- package/public/adeo/components/checkbox/Checkbox.js +1 -1
- package/public/adeo/components/checkbox/Checkbox.js.map +1 -1
- package/public/adeo/components/checkbox/Checkbox.svelte +2 -2
- package/public/adeo/components/datatable/DataTable.js +1 -1
- package/public/adeo/components/datatable/DataTable.js.map +1 -1
- package/public/adeo/components/datatable/DataTable.svelte +18 -18
- package/public/adeo/components/fileuploader/FileUploader.js +1 -1
- package/public/adeo/components/fileuploader/FileUploader.js.map +1 -1
- package/public/adeo/components/fileuploader/FileUploader.svelte +8 -5
- package/public/adeo/components/fileuploader/ResultFile.nested.js +1 -1
- package/public/adeo/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/adeo/components/layer/Layer.js +1 -1
- package/public/adeo/components/layer/Layer.js.map +1 -1
- package/public/adeo/components/layer/Layer.svelte +2 -1
- package/public/adeo/components/link/Link.js +1 -1
- package/public/adeo/components/link/Link.js.map +1 -1
- package/public/adeo/components/link/Link.svelte +1 -1
- package/public/adeo/components/phonenumber/PhoneNumber.js +1 -1
- package/public/adeo/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/adeo/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/adeo/components/quantityselector/QuantitySelector.js +1 -1
- package/public/adeo/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/adeo/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/adeo/components/resultfile/ResultFile.nested.svelte +1 -1
- package/public/array-5b770a93.js +1 -13
- package/public/array-5b770a93.js.map +1 -1
- package/public/axis-fbc0f7b5.js +1 -174
- package/public/axis-fbc0f7b5.js.map +1 -1
- package/public/band-d7a07d2c.js +1 -186
- package/public/band-d7a07d2c.js.map +1 -1
- package/public/bricoman/components/chart/Donut.js +1 -1
- package/public/bricoman/components/checkbox/Checkbox.js +1 -1
- package/public/bricoman/components/checkbox/Checkbox.js.map +1 -1
- package/public/bricoman/components/checkbox/Checkbox.svelte +2 -2
- package/public/bricoman/components/datatable/DataTable.js +1 -1
- package/public/bricoman/components/datatable/DataTable.js.map +1 -1
- package/public/bricoman/components/datatable/DataTable.svelte +18 -18
- package/public/bricoman/components/fileuploader/FileUploader.js +1 -1
- package/public/bricoman/components/fileuploader/FileUploader.js.map +1 -1
- package/public/bricoman/components/fileuploader/FileUploader.svelte +8 -5
- package/public/bricoman/components/fileuploader/ResultFile.nested.js +1 -1
- package/public/bricoman/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/bricoman/components/header/Header.js +1 -1
- package/public/bricoman/components/hero/Hero.js +1 -1
- package/public/bricoman/components/layer/Layer.js +1 -1
- package/public/bricoman/components/layer/Layer.js.map +1 -1
- package/public/bricoman/components/layer/Layer.svelte +2 -1
- package/public/bricoman/components/link/Link.js +1 -1
- package/public/bricoman/components/link/Link.js.map +1 -1
- package/public/bricoman/components/link/Link.svelte +1 -1
- package/public/bricoman/components/listbox/Listbox.js +1 -1
- package/public/bricoman/components/listbox/Listbox.nested.js +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.js +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/bricoman/components/phonenumber/PhoneNumber.svelte +72 -9
- package/public/bricoman/components/price/Price.js +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.js +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/bricoman/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/bricoman/components/resultfile/ResultFile.nested.svelte +1 -1
- package/public/components/accordion/Accordion.js +1 -365
- package/public/components/accordion/Accordion.js.map +1 -1
- package/public/components/autocomplete/Autocomplete.js +1 -1515
- package/public/components/autocomplete/Autocomplete.js.map +1 -1
- package/public/components/badge/Badge.js +1 -155
- package/public/components/badge/Badge.js.map +1 -1
- package/public/components/badge/Badge.nested.js +1 -101
- package/public/components/badge/Badge.nested.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.js +1 -372
- package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/public/components/breadcrumb/Breadcrumb.nested.js +1 -319
- package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
- package/public/components/button/Button.js +1 -1138
- package/public/components/button/Button.js.map +1 -1
- package/public/components/card/Card.js +1 -369
- package/public/components/card/Card.js.map +1 -1
- package/public/components/chart/BarChart.js +1 -582
- package/public/components/chart/BarChart.js.map +1 -1
- package/public/components/chart/Donut.js +1 -1189
- package/public/components/chart/Donut.js.map +1 -1
- package/public/components/chart/GroupedBarChart.js +1 -750
- package/public/components/chart/GroupedBarChart.js.map +1 -1
- package/public/components/chart/LineChart.js +1 -1731
- package/public/components/chart/LineChart.js.map +1 -1
- package/public/components/chart/Radar.js +1 -729
- package/public/components/chart/Radar.js.map +1 -1
- package/public/components/chart/StackedBarChart.js +1 -745
- package/public/components/chart/StackedBarChart.js.map +1 -1
- package/public/components/checkbox/Checkbox.js +1 -307
- package/public/components/checkbox/Checkbox.js.map +1 -1
- package/public/components/checkbox/Checkbox.svelte +2 -2
- package/public/components/checkboxgroup/checkboxGroup.js +1 -404
- package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
- package/public/components/datatable/DataTable.js +1 -3064
- package/public/components/datatable/DataTable.js.map +1 -1
- package/public/components/datatable/DataTable.svelte +18 -18
- package/public/components/datatable/DataTableDefaultAction.nested.js +1 -4
- package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -164
- package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -380
- package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -424
- package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -263
- package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
- package/public/components/datatable/DataTableFooter.nested.js +1 -637
- package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
- package/public/components/dropdown/Dropdown.js +1 -1426
- package/public/components/dropdown/Dropdown.js.map +1 -1
- package/public/components/field/Field.js +1 -375
- package/public/components/field/Field.js.map +1 -1
- package/public/components/fileuploader/FileUploader.js +1 -555
- package/public/components/fileuploader/FileUploader.js.map +1 -1
- package/public/components/fileuploader/FileUploader.svelte +8 -5
- package/public/components/fileuploader/ResultFile.nested.js +1 -265
- package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
- package/public/components/flag/Flag.js +1 -174
- package/public/components/flag/Flag.js.map +1 -1
- package/public/components/header/Header.js +1 -903
- package/public/components/header/Header.js.map +1 -1
- package/public/components/hero/Hero.js +1 -271
- package/public/components/hero/Hero.js.map +1 -1
- package/public/components/layer/Layer.js +1 -453
- package/public/components/layer/Layer.js.map +1 -1
- package/public/components/layer/Layer.svelte +2 -1
- package/public/components/link/Link.js +1 -380
- package/public/components/link/Link.js.map +1 -1
- package/public/components/link/Link.svelte +1 -1
- package/public/components/listbox/Listbox.js +1 -595
- package/public/components/listbox/Listbox.js.map +1 -1
- package/public/components/listbox/Listbox.nested.js +1 -629
- package/public/components/listbox/Listbox.nested.js.map +1 -1
- package/public/components/loader/Loader.js +1 -246
- package/public/components/loader/Loader.js.map +1 -1
- package/public/components/loader/Loader.nested.js +1 -176
- package/public/components/loader/Loader.nested.js.map +1 -1
- package/public/components/modal/Modal.js +1 -395
- package/public/components/modal/Modal.js.map +1 -1
- package/public/components/notification/Notification.js +1 -458
- package/public/components/notification/Notification.js.map +1 -1
- package/public/components/optionbutton/OptionButton.js +1 -316
- package/public/components/optionbutton/OptionButton.js.map +1 -1
- package/public/components/overlay/Overlay.js +1 -104
- package/public/components/overlay/Overlay.js.map +1 -1
- package/public/components/overlay/OverlayLoader.js +1 -151
- package/public/components/overlay/OverlayLoader.js.map +1 -1
- package/public/components/pagination/Pagination.js +1 -613
- package/public/components/pagination/Pagination.js.map +1 -1
- package/public/components/passwordinput/PasswordInput.js +1 -291
- package/public/components/passwordinput/PasswordInput.js.map +1 -1
- package/public/components/phonenumber/PhoneNumber.js +1 -6894
- package/public/components/phonenumber/PhoneNumber.js.map +1 -1
- package/public/components/price/Price.js +1 -768
- package/public/components/price/Price.js.map +1 -1
- package/public/components/progressbar/ProgressBar.js +1 -278
- package/public/components/progressbar/ProgressBar.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.js +1 -333
- package/public/components/quantityselector/QuantitySelector.js.map +1 -1
- package/public/components/quantityselector/QuantitySelector.svelte +6 -3
- package/public/components/radio/Radio.js +1 -273
- package/public/components/radio/Radio.js.map +1 -1
- package/public/components/radiogroup/RadioGroup.js +1 -414
- package/public/components/radiogroup/RadioGroup.js.map +1 -1
- package/public/components/ratings/StarsInput.js +1 -292
- package/public/components/ratings/StarsInput.js.map +1 -1
- package/public/components/ratings/StarsResult.js +1 -246
- package/public/components/ratings/StarsResult.js.map +1 -1
- package/public/components/resultfile/ResultFile.nested.svelte +1 -1
- package/public/components/select/Select.js +1 -451
- package/public/components/select/Select.js.map +1 -1
- package/public/components/sidebar/Sidebar.js +1 -784
- package/public/components/sidebar/Sidebar.js.map +1 -1
- package/public/components/sidebar/sidebar-feature-group.nested.js +1 -594
- package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-feature.nested.js +1 -402
- package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-section.nested.js +1 -394
- package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-segment.nested.js +1 -200
- package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-separator.nested.js +1 -49
- package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-sub-features.nested.js +1 -312
- package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
- package/public/components/sidebar/sidebar-user.nested.js +1 -733
- package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
- package/public/components/stepper/Stepper.js +1 -371
- package/public/components/stepper/Stepper.js.map +1 -1
- package/public/components/tabs/Tabs.js +1 -615
- package/public/components/tabs/Tabs.js.map +1 -1
- package/public/components/tabs/Tabs.nested.js +1 -472
- package/public/components/tabs/Tabs.nested.js.map +1 -1
- package/public/components/tag/Tag.js +1 -665
- package/public/components/tag/Tag.js.map +1 -1
- package/public/components/tag/Tag.nested.js +1 -554
- package/public/components/tag/Tag.nested.js.map +1 -1
- package/public/components/taglist/TagList.js +1 -475
- package/public/components/taglist/TagList.js.map +1 -1
- package/public/components/textarea/Textarea.js +1 -303
- package/public/components/textarea/Textarea.js.map +1 -1
- package/public/components/textinput/Textinput.js +1 -497
- package/public/components/textinput/Textinput.js.map +1 -1
- package/public/components/textinput/Textinput.nested.js +1 -320
- package/public/components/textinput/Textinput.nested.js.map +1 -1
- package/public/components/toggle/Toggle.js +1 -278
- package/public/components/toggle/Toggle.js.map +1 -1
- package/public/components/tooltip/Tooltip.js +1 -173
- package/public/components/tooltip/Tooltip.js.map +1 -1
- package/public/index-c33b3772.js +1 -873
- package/public/index-c33b3772.js.map +1 -1
- package/public/linear-f46d7e9e.js +1 -700
- package/public/linear-f46d7e9e.js.map +1 -1
- package/public/path-1b5da959.js +1 -186
- package/public/path-1b5da959.js.map +1 -1
- package/public/sidebar-service-275bf9ef.js +1 -129
- package/public/sidebar-service-275bf9ef.js.map +1 -1
- package/public/symbol-b05a6e2b.js +1 -169
- package/public/symbol-b05a6e2b.js.map +1 -1
- package/public/transform-15d69d5d.js +1 -2743
- package/public/transform-15d69d5d.js.map +1 -1
- package/public/utilities/stories/fileuploader/FileUploader.stories.d.ts.map +1 -1
- package/public/utilities/stories/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
|
@@ -1,746 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { s as select } from '../../transform-15d69d5d.js';
|
|
3
|
-
import { E as EventHandler } from '../../EventHandler-02058705.js';
|
|
4
|
-
import { c as constant, a as array } from '../../array-5b770a93.js';
|
|
5
|
-
import { a as axisBottom, b as axisLeft } from '../../axis-fbc0f7b5.js';
|
|
6
|
-
import { b as band } from '../../band-d7a07d2c.js';
|
|
7
|
-
import { l as linear } from '../../linear-f46d7e9e.js';
|
|
8
|
-
|
|
9
|
-
function none$1(series, order) {
|
|
10
|
-
if (!((n = series.length) > 1)) return;
|
|
11
|
-
for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
|
|
12
|
-
s0 = s1, s1 = series[order[i]];
|
|
13
|
-
for (j = 0; j < m; ++j) {
|
|
14
|
-
s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function none(series) {
|
|
20
|
-
var n = series.length, o = new Array(n);
|
|
21
|
-
while (--n >= 0) o[n] = n;
|
|
22
|
-
return o;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function stackValue(d, key) {
|
|
26
|
-
return d[key];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function stackSeries(key) {
|
|
30
|
-
const series = [];
|
|
31
|
-
series.key = key;
|
|
32
|
-
return series;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function stack() {
|
|
36
|
-
var keys = constant([]),
|
|
37
|
-
order = none,
|
|
38
|
-
offset = none$1,
|
|
39
|
-
value = stackValue;
|
|
40
|
-
|
|
41
|
-
function stack(data) {
|
|
42
|
-
var sz = Array.from(keys.apply(this, arguments), stackSeries),
|
|
43
|
-
i, n = sz.length, j = -1,
|
|
44
|
-
oz;
|
|
45
|
-
|
|
46
|
-
for (const d of data) {
|
|
47
|
-
for (i = 0, ++j; i < n; ++i) {
|
|
48
|
-
(sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
for (i = 0, oz = array(order(sz)); i < n; ++i) {
|
|
53
|
-
sz[oz[i]].index = i;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
offset(sz, oz);
|
|
57
|
-
return sz;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
stack.keys = function(_) {
|
|
61
|
-
return arguments.length ? (keys = typeof _ === "function" ? _ : constant(Array.from(_)), stack) : keys;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
stack.value = function(_) {
|
|
65
|
-
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
stack.order = function(_) {
|
|
69
|
-
return arguments.length ? (order = _ == null ? none : typeof _ === "function" ? _ : constant(Array.from(_)), stack) : order;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
stack.offset = function(_) {
|
|
73
|
-
return arguments.length ? (offset = _ == null ? none$1 : _, stack) : offset;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
return stack;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* src/components/chart/StackedBarChart.svelte generated by Svelte v3.58.0 */
|
|
80
|
-
|
|
81
|
-
function get_each_context(ctx, list, i) {
|
|
82
|
-
const child_ctx = ctx.slice();
|
|
83
|
-
child_ctx[6] = list[i];
|
|
84
|
-
return child_ctx;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function get_each_context_1(ctx, list, i) {
|
|
88
|
-
const child_ctx = ctx.slice();
|
|
89
|
-
child_ctx[32] = list[i];
|
|
90
|
-
return child_ctx;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// (197:0) {#if tooltipData.show}
|
|
94
|
-
function create_if_block(ctx) {
|
|
95
|
-
let div;
|
|
96
|
-
let t_value = /*tooltipData*/ ctx[3].text + "";
|
|
97
|
-
let t;
|
|
98
|
-
let div_style_value;
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
c() {
|
|
102
|
-
div = element("div");
|
|
103
|
-
t = text(t_value);
|
|
104
|
-
attr(div, "class", "tooltip");
|
|
105
|
-
attr(div, "style", div_style_value = `top: ${/*tooltipData*/ ctx[3].top}px; left: ${/*tooltipData*/ ctx[3].left}px; width: ${/*tooltipData*/ ctx[3].width}px;`);
|
|
106
|
-
},
|
|
107
|
-
m(target, anchor) {
|
|
108
|
-
insert(target, div, anchor);
|
|
109
|
-
append(div, t);
|
|
110
|
-
},
|
|
111
|
-
p(ctx, dirty) {
|
|
112
|
-
if (dirty[0] & /*tooltipData*/ 8 && t_value !== (t_value = /*tooltipData*/ ctx[3].text + "")) set_data(t, t_value);
|
|
113
|
-
|
|
114
|
-
if (dirty[0] & /*tooltipData*/ 8 && div_style_value !== (div_style_value = `top: ${/*tooltipData*/ ctx[3].top}px; left: ${/*tooltipData*/ ctx[3].left}px; width: ${/*tooltipData*/ ctx[3].width}px;`)) {
|
|
115
|
-
attr(div, "style", div_style_value);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
d(detaching) {
|
|
119
|
-
if (detaching) detach(div);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// (207:2) {#each subgroups as subgroup}
|
|
125
|
-
function create_each_block_1(ctx) {
|
|
126
|
-
let div;
|
|
127
|
-
let svg_1;
|
|
128
|
-
let rect;
|
|
129
|
-
let rect_fill_value;
|
|
130
|
-
let t0;
|
|
131
|
-
let span;
|
|
132
|
-
let t1_value = /*subgroup*/ ctx[32] + "";
|
|
133
|
-
let t1;
|
|
134
|
-
let t2;
|
|
135
|
-
|
|
136
|
-
return {
|
|
137
|
-
c() {
|
|
138
|
-
div = element("div");
|
|
139
|
-
svg_1 = svg_element("svg");
|
|
140
|
-
rect = svg_element("rect");
|
|
141
|
-
t0 = space();
|
|
142
|
-
span = element("span");
|
|
143
|
-
t1 = text(t1_value);
|
|
144
|
-
t2 = space();
|
|
145
|
-
attr(rect, "x", "0");
|
|
146
|
-
attr(rect, "y", "0");
|
|
147
|
-
attr(rect, "width", "24");
|
|
148
|
-
attr(rect, "height", "16");
|
|
149
|
-
attr(rect, "fill", rect_fill_value = /*parsedColor*/ ctx[1][/*subgroup*/ ctx[32]]);
|
|
150
|
-
attr(svg_1, "class", "legend__box");
|
|
151
|
-
attr(span, "class", "legend__title");
|
|
152
|
-
attr(div, "class", "legend__item");
|
|
153
|
-
},
|
|
154
|
-
m(target, anchor) {
|
|
155
|
-
insert(target, div, anchor);
|
|
156
|
-
append(div, svg_1);
|
|
157
|
-
append(svg_1, rect);
|
|
158
|
-
append(div, t0);
|
|
159
|
-
append(div, span);
|
|
160
|
-
append(span, t1);
|
|
161
|
-
append(div, t2);
|
|
162
|
-
},
|
|
163
|
-
p(ctx, dirty) {
|
|
164
|
-
if (dirty[0] & /*parsedColor, subgroups*/ 18 && rect_fill_value !== (rect_fill_value = /*parsedColor*/ ctx[1][/*subgroup*/ ctx[32]])) {
|
|
165
|
-
attr(rect, "fill", rect_fill_value);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (dirty[0] & /*subgroups*/ 16 && t1_value !== (t1_value = /*subgroup*/ ctx[32] + "")) set_data(t1, t1_value);
|
|
169
|
-
},
|
|
170
|
-
d(detaching) {
|
|
171
|
-
if (detaching) detach(div);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// (218:2) {#each parsedSvgs as svg}
|
|
177
|
-
function create_each_block(ctx) {
|
|
178
|
-
let html_tag;
|
|
179
|
-
let raw_value = /*svg*/ ctx[6] + "";
|
|
180
|
-
let html_anchor;
|
|
181
|
-
|
|
182
|
-
return {
|
|
183
|
-
c() {
|
|
184
|
-
html_tag = new HtmlTag(false);
|
|
185
|
-
html_anchor = empty();
|
|
186
|
-
html_tag.a = html_anchor;
|
|
187
|
-
},
|
|
188
|
-
m(target, anchor) {
|
|
189
|
-
html_tag.m(raw_value, target, anchor);
|
|
190
|
-
insert(target, html_anchor, anchor);
|
|
191
|
-
},
|
|
192
|
-
p(ctx, dirty) {
|
|
193
|
-
if (dirty[0] & /*parsedSvgs*/ 32 && raw_value !== (raw_value = /*svg*/ ctx[6] + "")) html_tag.p(raw_value);
|
|
194
|
-
},
|
|
195
|
-
d(detaching) {
|
|
196
|
-
if (detaching) detach(html_anchor);
|
|
197
|
-
if (detaching) html_tag.d();
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function create_fragment(ctx) {
|
|
203
|
-
let div0;
|
|
204
|
-
let t0;
|
|
205
|
-
let t1;
|
|
206
|
-
let div1;
|
|
207
|
-
let t2;
|
|
208
|
-
let div2;
|
|
209
|
-
let t3;
|
|
210
|
-
let text_1;
|
|
211
|
-
let if_block = /*tooltipData*/ ctx[3].show && create_if_block(ctx);
|
|
212
|
-
let each_value_1 = /*subgroups*/ ctx[4];
|
|
213
|
-
let each_blocks_1 = [];
|
|
214
|
-
|
|
215
|
-
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
216
|
-
each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
let each_value = /*parsedSvgs*/ ctx[5];
|
|
220
|
-
let each_blocks = [];
|
|
221
|
-
|
|
222
|
-
for (let i = 0; i < each_value.length; i += 1) {
|
|
223
|
-
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
c() {
|
|
228
|
-
div0 = element("div");
|
|
229
|
-
t0 = space();
|
|
230
|
-
if (if_block) if_block.c();
|
|
231
|
-
t1 = space();
|
|
232
|
-
div1 = element("div");
|
|
233
|
-
|
|
234
|
-
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
235
|
-
each_blocks_1[i].c();
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
t2 = space();
|
|
239
|
-
div2 = element("div");
|
|
240
|
-
|
|
241
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
242
|
-
each_blocks[i].c();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
t3 = space();
|
|
246
|
-
text_1 = svg_element("text");
|
|
247
|
-
this.c = noop;
|
|
248
|
-
set_style(div0, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
249
|
-
attr(div1, "class", "legend");
|
|
250
|
-
set_style(div2, "height", "0");
|
|
251
|
-
set_style(div2, "width", "0");
|
|
252
|
-
attr(div2, "class", "pattern");
|
|
253
|
-
},
|
|
254
|
-
m(target, anchor) {
|
|
255
|
-
insert(target, div0, anchor);
|
|
256
|
-
/*div0_binding*/ ctx[19](div0);
|
|
257
|
-
insert(target, t0, anchor);
|
|
258
|
-
if (if_block) if_block.m(target, anchor);
|
|
259
|
-
insert(target, t1, anchor);
|
|
260
|
-
insert(target, div1, anchor);
|
|
261
|
-
|
|
262
|
-
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
263
|
-
if (each_blocks_1[i]) {
|
|
264
|
-
each_blocks_1[i].m(div1, null);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
insert(target, t2, anchor);
|
|
269
|
-
insert(target, div2, anchor);
|
|
270
|
-
|
|
271
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
272
|
-
if (each_blocks[i]) {
|
|
273
|
-
each_blocks[i].m(div2, null);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
insert(target, t3, anchor);
|
|
278
|
-
insert(target, text_1, anchor);
|
|
279
|
-
},
|
|
280
|
-
p(ctx, dirty) {
|
|
281
|
-
if (dirty[0] & /*backgroundcolor*/ 1) {
|
|
282
|
-
set_style(div0, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
if (/*tooltipData*/ ctx[3].show) {
|
|
286
|
-
if (if_block) {
|
|
287
|
-
if_block.p(ctx, dirty);
|
|
288
|
-
} else {
|
|
289
|
-
if_block = create_if_block(ctx);
|
|
290
|
-
if_block.c();
|
|
291
|
-
if_block.m(t1.parentNode, t1);
|
|
292
|
-
}
|
|
293
|
-
} else if (if_block) {
|
|
294
|
-
if_block.d(1);
|
|
295
|
-
if_block = null;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (dirty[0] & /*subgroups, parsedColor*/ 18) {
|
|
299
|
-
each_value_1 = /*subgroups*/ ctx[4];
|
|
300
|
-
let i;
|
|
301
|
-
|
|
302
|
-
for (i = 0; i < each_value_1.length; i += 1) {
|
|
303
|
-
const child_ctx = get_each_context_1(ctx, each_value_1, i);
|
|
304
|
-
|
|
305
|
-
if (each_blocks_1[i]) {
|
|
306
|
-
each_blocks_1[i].p(child_ctx, dirty);
|
|
307
|
-
} else {
|
|
308
|
-
each_blocks_1[i] = create_each_block_1(child_ctx);
|
|
309
|
-
each_blocks_1[i].c();
|
|
310
|
-
each_blocks_1[i].m(div1, null);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
for (; i < each_blocks_1.length; i += 1) {
|
|
315
|
-
each_blocks_1[i].d(1);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
each_blocks_1.length = each_value_1.length;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
if (dirty[0] & /*parsedSvgs*/ 32) {
|
|
322
|
-
each_value = /*parsedSvgs*/ ctx[5];
|
|
323
|
-
let i;
|
|
324
|
-
|
|
325
|
-
for (i = 0; i < each_value.length; i += 1) {
|
|
326
|
-
const child_ctx = get_each_context(ctx, each_value, i);
|
|
327
|
-
|
|
328
|
-
if (each_blocks[i]) {
|
|
329
|
-
each_blocks[i].p(child_ctx, dirty);
|
|
330
|
-
} else {
|
|
331
|
-
each_blocks[i] = create_each_block(child_ctx);
|
|
332
|
-
each_blocks[i].c();
|
|
333
|
-
each_blocks[i].m(div2, null);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
for (; i < each_blocks.length; i += 1) {
|
|
338
|
-
each_blocks[i].d(1);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
each_blocks.length = each_value.length;
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
i: noop,
|
|
345
|
-
o: noop,
|
|
346
|
-
d(detaching) {
|
|
347
|
-
if (detaching) detach(div0);
|
|
348
|
-
/*div0_binding*/ ctx[19](null);
|
|
349
|
-
if (detaching) detach(t0);
|
|
350
|
-
if (if_block) if_block.d(detaching);
|
|
351
|
-
if (detaching) detach(t1);
|
|
352
|
-
if (detaching) detach(div1);
|
|
353
|
-
destroy_each(each_blocks_1, detaching);
|
|
354
|
-
if (detaching) detach(t2);
|
|
355
|
-
if (detaching) detach(div2);
|
|
356
|
-
destroy_each(each_blocks, detaching);
|
|
357
|
-
if (detaching) detach(t3);
|
|
358
|
-
if (detaching) detach(text_1);
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function getParsedMargins(margins) {
|
|
364
|
-
if (margins) return JSON.parse(margins); else return {
|
|
365
|
-
top: 10,
|
|
366
|
-
right: 40,
|
|
367
|
-
bottom: 20,
|
|
368
|
-
left: 60,
|
|
369
|
-
xAxis: 20
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function instance($$self, $$props, $$invalidate) {
|
|
374
|
-
let parsedData;
|
|
375
|
-
let groups;
|
|
376
|
-
let subgroups;
|
|
377
|
-
let height;
|
|
378
|
-
let parsedSvgs;
|
|
379
|
-
let { data = '' } = $$props;
|
|
380
|
-
let { chartheight = '300' } = $$props;
|
|
381
|
-
let { backgroundcolor = '#fff' } = $$props;
|
|
382
|
-
let { scalemax = 50 } = $$props;
|
|
383
|
-
let { ticknumbers = 4 } = $$props;
|
|
384
|
-
let { tickleftformat = d => `${Number(d)}` } = $$props;
|
|
385
|
-
let { tickbottomformat = d => `${Number(d)}` } = $$props;
|
|
386
|
-
let { margins } = $$props;
|
|
387
|
-
let { svgs } = $$props;
|
|
388
|
-
let { colors } = $$props;
|
|
389
|
-
let parsedColor;
|
|
390
|
-
let _data;
|
|
391
|
-
let chart;
|
|
392
|
-
let svg;
|
|
393
|
-
let hasMounted = false;
|
|
394
|
-
|
|
395
|
-
let tooltipData = {
|
|
396
|
-
show: false,
|
|
397
|
-
text: '',
|
|
398
|
-
top: 0,
|
|
399
|
-
left: 0,
|
|
400
|
-
width: 0
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
let eventHandler = new EventHandler();
|
|
404
|
-
|
|
405
|
-
function getChartWidth() {
|
|
406
|
-
let chartWidth = select(chart).style('width');
|
|
407
|
-
|
|
408
|
-
if (chartWidth === '' || !chartWidth) {
|
|
409
|
-
chartWidth = `${window.innerWidth / 2}`;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return parseInt(chartWidth);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function getAxes(width) {
|
|
416
|
-
const x = band().domain(groups).range([
|
|
417
|
-
0,
|
|
418
|
-
width - (getParsedMargins(margins).left / 2 + getParsedMargins(margins).right / 2)
|
|
419
|
-
]).padding(0.2);
|
|
420
|
-
|
|
421
|
-
const y = linear().domain([0, scalemax]).range([height, 0]);
|
|
422
|
-
return { x, y };
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
function addRectandles(x, y) {
|
|
426
|
-
const stackedData = stack().keys(subgroups)(parsedData);
|
|
427
|
-
|
|
428
|
-
svg.append('g').selectAll('g').data(stackedData).enter().append('g').attr('fill', d => parsedColor[d.key] || 'black').attr('class', 'bar').selectAll('rect').data(d => d).enter().append('rect').attr('x', d => x(d.data.group.toString())).attr('y', d => y(d[1])).attr('width', x.bandwidth()).attr('height', d => y(d[0]) - y(d[1])).style('cursor', 'pointer').on('mouseout', (_e, chartEvent) => {
|
|
429
|
-
const others = svg.selectAll('rect').filter(function (arc) {
|
|
430
|
-
return arc != chartEvent;
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
others.style('opacity', 1);
|
|
434
|
-
$$invalidate(3, tooltipData.show = false, tooltipData);
|
|
435
|
-
}).on('mouseover', (e, chartEvent) => {
|
|
436
|
-
const others = svg.selectAll('rect').filter(function (arc) {
|
|
437
|
-
return arc != chartEvent;
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
others.style('opacity', 0.7);
|
|
441
|
-
const { left, top, width } = e.target.getBoundingClientRect();
|
|
442
|
-
|
|
443
|
-
$$invalidate(3, tooltipData = {
|
|
444
|
-
show: true,
|
|
445
|
-
text: chartEvent.data.customtooltip
|
|
446
|
-
? chartEvent.data.customtooltip
|
|
447
|
-
: `${chartEvent[1] - chartEvent[0]}`,
|
|
448
|
-
left,
|
|
449
|
-
top: top - 50,
|
|
450
|
-
width
|
|
451
|
-
});
|
|
452
|
-
}).on('click', (_e, chartEvent) => {
|
|
453
|
-
eventHandler.dispatch('bar-clicked', chartEvent);
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
function updateAxes(x, y) {
|
|
458
|
-
svg.select('.x-axis').call(axisBottom(x).tickFormat(tickbottomformat));
|
|
459
|
-
svg.select('.y-axis').call(axisLeft(y).ticks(ticknumbers).tickFormat(tickleftformat));
|
|
460
|
-
const width = getChartWidth();
|
|
461
|
-
svg.selectAll('.y-axis .tick line').attr('stroke', '#EEEDEA').attr('stroke-width', '1px').attr('x2', width);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
function render() {
|
|
465
|
-
const width = getChartWidth();
|
|
466
|
-
const { x, y } = getAxes(width);
|
|
467
|
-
$$invalidate(6, svg = select(chart).append('svg').attr('width', width).attr('height', Number(height) + Number(getParsedMargins(margins).top) + Number(getParsedMargins(margins).bottom) + Number(getParsedMargins(margins).xAxis)).attr('id', 'svg-chart').append('g').attr('transform', `translate(${getParsedMargins(margins).left / 2 + getParsedMargins(margins).right / 2},${getParsedMargins(margins).top})`));
|
|
468
|
-
svg.append('g').attr('transform', `translate(0, ${Number(height) + Number(getParsedMargins(margins).xAxis)})`).call(axisBottom(x)).attr('class', 'x-axis').attr('stroke-width', '0');
|
|
469
|
-
svg.append('g').call(axisLeft(y).ticks(ticknumbers).tickFormat(tickleftformat)).attr('class', 'y-axis').attr('stroke-width', '0');
|
|
470
|
-
addRectandles(x, y);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
function update() {
|
|
474
|
-
var _a;
|
|
475
|
-
const width = getChartWidth();
|
|
476
|
-
|
|
477
|
-
(_a = chart.querySelector('#svg-chart')) === null || _a === void 0
|
|
478
|
-
? void 0
|
|
479
|
-
: _a.setAttribute('width', `${width}px`);
|
|
480
|
-
|
|
481
|
-
const { x, y } = getAxes(width);
|
|
482
|
-
updateAxes(x, y);
|
|
483
|
-
svg.selectAll('.bar').remove();
|
|
484
|
-
addRectandles(x, y);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
function resize() {
|
|
488
|
-
var _a;
|
|
489
|
-
|
|
490
|
-
if (_data) {
|
|
491
|
-
const width = getChartWidth();
|
|
492
|
-
|
|
493
|
-
(_a = chart.querySelector('#svg-chart')) === null || _a === void 0
|
|
494
|
-
? void 0
|
|
495
|
-
: _a.setAttribute('width', `${width}px`);
|
|
496
|
-
|
|
497
|
-
const { x, y } = getAxes(width);
|
|
498
|
-
updateAxes(x, y);
|
|
499
|
-
const stackedData = stack().keys(subgroups)(parsedData);
|
|
500
|
-
svg.selectAll('.bar').data(stackedData).selectAll('rect').data(d => d).attr('x', d => x(d.data.group.toString())).attr('y', d => y(d[1])).attr('width', x.bandwidth()).attr('height', d => y(d[0]) - y(d[1]));
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
onMount(() => {
|
|
505
|
-
const resizeObserver = new ResizeObserver(resize);
|
|
506
|
-
resizeObserver.observe(chart);
|
|
507
|
-
$$invalidate(17, hasMounted = true);
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
function div0_binding($$value) {
|
|
511
|
-
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
512
|
-
chart = $$value;
|
|
513
|
-
$$invalidate(2, chart);
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
$$self.$$set = $$props => {
|
|
518
|
-
if ('data' in $$props) $$invalidate(7, data = $$props.data);
|
|
519
|
-
if ('chartheight' in $$props) $$invalidate(8, chartheight = $$props.chartheight);
|
|
520
|
-
if ('backgroundcolor' in $$props) $$invalidate(0, backgroundcolor = $$props.backgroundcolor);
|
|
521
|
-
if ('scalemax' in $$props) $$invalidate(9, scalemax = $$props.scalemax);
|
|
522
|
-
if ('ticknumbers' in $$props) $$invalidate(10, ticknumbers = $$props.ticknumbers);
|
|
523
|
-
if ('tickleftformat' in $$props) $$invalidate(11, tickleftformat = $$props.tickleftformat);
|
|
524
|
-
if ('tickbottomformat' in $$props) $$invalidate(12, tickbottomformat = $$props.tickbottomformat);
|
|
525
|
-
if ('margins' in $$props) $$invalidate(13, margins = $$props.margins);
|
|
526
|
-
if ('svgs' in $$props) $$invalidate(14, svgs = $$props.svgs);
|
|
527
|
-
if ('colors' in $$props) $$invalidate(15, colors = $$props.colors);
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
$$self.$$.update = () => {
|
|
531
|
-
if ($$self.$$.dirty[0] & /*data*/ 128) {
|
|
532
|
-
$$invalidate(18, parsedData = data ? JSON.parse(data) : []);
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
if ($$self.$$.dirty[0] & /*parsedData*/ 262144) {
|
|
536
|
-
groups = parsedData.map(d => d.group);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
if ($$self.$$.dirty[0] & /*parsedData*/ 262144) {
|
|
540
|
-
$$invalidate(4, subgroups = parsedData[0]
|
|
541
|
-
? Object.keys(parsedData[0]).filter(d => d !== 'group')
|
|
542
|
-
: []);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
if ($$self.$$.dirty[0] & /*chartheight*/ 256) {
|
|
546
|
-
height = parseInt(chartheight, 10);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
if ($$self.$$.dirty[0] & /*svgs*/ 16384) {
|
|
550
|
-
$$invalidate(5, parsedSvgs = svgs ? JSON.parse(svgs) : []);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
if ($$self.$$.dirty[0] & /*colors*/ 32768) {
|
|
554
|
-
$$invalidate(1, parsedColor = colors ? JSON.parse(colors) : {});
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
if ($$self.$$.dirty[0] & /*data, hasMounted, _data*/ 196736) {
|
|
558
|
-
if (data.length > 0 && hasMounted) {
|
|
559
|
-
if (!_data) {
|
|
560
|
-
render();
|
|
561
|
-
$$invalidate(16, _data = data);
|
|
562
|
-
} else if (data !== _data) {
|
|
563
|
-
update();
|
|
564
|
-
$$invalidate(16, _data = data);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
return [
|
|
571
|
-
backgroundcolor,
|
|
572
|
-
parsedColor,
|
|
573
|
-
chart,
|
|
574
|
-
tooltipData,
|
|
575
|
-
subgroups,
|
|
576
|
-
parsedSvgs,
|
|
577
|
-
svg,
|
|
578
|
-
data,
|
|
579
|
-
chartheight,
|
|
580
|
-
scalemax,
|
|
581
|
-
ticknumbers,
|
|
582
|
-
tickleftformat,
|
|
583
|
-
tickbottomformat,
|
|
584
|
-
margins,
|
|
585
|
-
svgs,
|
|
586
|
-
colors,
|
|
587
|
-
_data,
|
|
588
|
-
hasMounted,
|
|
589
|
-
parsedData,
|
|
590
|
-
div0_binding
|
|
591
|
-
];
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
class StackedBarChart extends SvelteElement {
|
|
595
|
-
constructor(options) {
|
|
596
|
-
super();
|
|
597
|
-
const style = document.createElement('style');
|
|
598
|
-
style.textContent = `.legend{margin-top:1rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 1.5rem;height:100%;color:#000000;gap:1rem}.legend__item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:0.875rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.legend__title{white-space:nowrap;margin:0}.legend__box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:0.25rem;height:16px;width:24px}.tooltip{height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;text-align:center;padding:0.5rem 0;position:absolute}.pattern{z-index:-1;position:relative}text{font-family:"LeroyMerlin", sans-serif;font-size:0.875rem;color:#4d4d4d}`;
|
|
599
|
-
this.shadowRoot.appendChild(style);
|
|
600
|
-
|
|
601
|
-
init(
|
|
602
|
-
this,
|
|
603
|
-
{
|
|
604
|
-
target: this.shadowRoot,
|
|
605
|
-
props: attribute_to_object(this.attributes),
|
|
606
|
-
customElement: true
|
|
607
|
-
},
|
|
608
|
-
instance,
|
|
609
|
-
create_fragment,
|
|
610
|
-
safe_not_equal,
|
|
611
|
-
{
|
|
612
|
-
data: 7,
|
|
613
|
-
chartheight: 8,
|
|
614
|
-
backgroundcolor: 0,
|
|
615
|
-
scalemax: 9,
|
|
616
|
-
ticknumbers: 10,
|
|
617
|
-
tickleftformat: 11,
|
|
618
|
-
tickbottomformat: 12,
|
|
619
|
-
margins: 13,
|
|
620
|
-
svgs: 14,
|
|
621
|
-
colors: 15
|
|
622
|
-
},
|
|
623
|
-
null,
|
|
624
|
-
[-1, -1]
|
|
625
|
-
);
|
|
626
|
-
|
|
627
|
-
if (options) {
|
|
628
|
-
if (options.target) {
|
|
629
|
-
insert(options.target, this, options.anchor);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
if (options.props) {
|
|
633
|
-
this.$set(options.props);
|
|
634
|
-
flush();
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
static get observedAttributes() {
|
|
640
|
-
return [
|
|
641
|
-
"data",
|
|
642
|
-
"chartheight",
|
|
643
|
-
"backgroundcolor",
|
|
644
|
-
"scalemax",
|
|
645
|
-
"ticknumbers",
|
|
646
|
-
"tickleftformat",
|
|
647
|
-
"tickbottomformat",
|
|
648
|
-
"margins",
|
|
649
|
-
"svgs",
|
|
650
|
-
"colors"
|
|
651
|
-
];
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
get data() {
|
|
655
|
-
return this.$$.ctx[7];
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
set data(data) {
|
|
659
|
-
this.$$set({ data });
|
|
660
|
-
flush();
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
get chartheight() {
|
|
664
|
-
return this.$$.ctx[8];
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
set chartheight(chartheight) {
|
|
668
|
-
this.$$set({ chartheight });
|
|
669
|
-
flush();
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
get backgroundcolor() {
|
|
673
|
-
return this.$$.ctx[0];
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
set backgroundcolor(backgroundcolor) {
|
|
677
|
-
this.$$set({ backgroundcolor });
|
|
678
|
-
flush();
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
get scalemax() {
|
|
682
|
-
return this.$$.ctx[9];
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
set scalemax(scalemax) {
|
|
686
|
-
this.$$set({ scalemax });
|
|
687
|
-
flush();
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
get ticknumbers() {
|
|
691
|
-
return this.$$.ctx[10];
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
set ticknumbers(ticknumbers) {
|
|
695
|
-
this.$$set({ ticknumbers });
|
|
696
|
-
flush();
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
get tickleftformat() {
|
|
700
|
-
return this.$$.ctx[11];
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
set tickleftformat(tickleftformat) {
|
|
704
|
-
this.$$set({ tickleftformat });
|
|
705
|
-
flush();
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
get tickbottomformat() {
|
|
709
|
-
return this.$$.ctx[12];
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
set tickbottomformat(tickbottomformat) {
|
|
713
|
-
this.$$set({ tickbottomformat });
|
|
714
|
-
flush();
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
get margins() {
|
|
718
|
-
return this.$$.ctx[13];
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
set margins(margins) {
|
|
722
|
-
this.$$set({ margins });
|
|
723
|
-
flush();
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
get svgs() {
|
|
727
|
-
return this.$$.ctx[14];
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
set svgs(svgs) {
|
|
731
|
-
this.$$set({ svgs });
|
|
732
|
-
flush();
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
get colors() {
|
|
736
|
-
return this.$$.ctx[15];
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
set colors(colors) {
|
|
740
|
-
this.$$set({ colors });
|
|
741
|
-
flush();
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
export { StackedBarChart as default };
|
|
1
|
+
import{S as t,i as e,a as r,b as n,f as s,s as o,e as a,d as i,T as c,n as l,y as f,g as d,o as h,J as u,a1 as g,t as m,j as p,k as x,K as b,v as $,Z as k}from"../../index-c33b3772.js";import{s as y}from"../../transform-15d69d5d.js";import{E as w}from"../../EventHandler-02058705.js";import{c as v,a as A}from"../../array-5b770a93.js";import{a as N,b as j}from"../../axis-fbc0f7b5.js";import{b as _}from"../../band-d7a07d2c.js";import{l as S}from"../../linear-f46d7e9e.js";function E(t,e){if((s=t.length)>1)for(var r,n,s,o=1,a=t[e[0]],i=a.length;o<s;++o)for(n=a,a=t[e[o]],r=0;r<i;++r)a[r][1]+=a[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function O(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function J(t,e){return t[e]}function z(t){const e=[];return e.key=t,e}function R(){var t=v([]),e=O,r=E,n=J;function s(s){var o,a,i=Array.from(t.apply(this,arguments),z),c=i.length,l=-1;for(const t of s)for(o=0,++l;o<c;++o)(i[o][l]=[0,+n(t,i[o].key,l,s)]).data=t;for(o=0,a=A(e(i));o<c;++o)i[a[o]].index=o;return r(i,a),i}return s.keys=function(e){return arguments.length?(t="function"==typeof e?e:v(Array.from(e)),s):t},s.value=function(t){return arguments.length?(n="function"==typeof t?t:v(+t),s):n},s.order=function(t){return arguments.length?(e=null==t?O:"function"==typeof t?t:v(Array.from(t)),s):e},s.offset=function(t){return arguments.length?(r=null==t?E:t,s):r},s}function C(t,e,r){const n=t.slice();return n[6]=e[r],n}function F(t,e,r){const n=t.slice();return n[32]=e[r],n}function q(t){let e,r,s,o=t[3].text+"";return{c(){e=a("div"),r=m(o),d(e,"class","tooltip"),d(e,"style",s=`top: ${t[3].top}px; left: ${t[3].left}px; width: ${t[3].width}px;`)},m(t,s){n(t,e,s),p(e,r)},p(t,n){8&n[0]&&o!==(o=t[3].text+"")&&x(r,o),8&n[0]&&s!==(s=`top: ${t[3].top}px; left: ${t[3].left}px; width: ${t[3].width}px;`)&&d(e,"style",s)},d(t){t&&h(e)}}}function I(t){let e,r,s,o,l,f,u,g,b=t[32]+"";return{c(){e=a("div"),r=c("svg"),s=c("rect"),l=i(),f=a("span"),u=m(b),g=i(),d(s,"x","0"),d(s,"y","0"),d(s,"width","24"),d(s,"height","16"),d(s,"fill",o=t[1][t[32]]),d(r,"class","legend__box"),d(f,"class","legend__title"),d(e,"class","legend__item")},m(t,o){n(t,e,o),p(e,r),p(r,s),p(e,l),p(e,f),p(f,u),p(e,g)},p(t,e){18&e[0]&&o!==(o=t[1][t[32]])&&d(s,"fill",o),16&e[0]&&b!==(b=t[32]+"")&&x(u,b)},d(t){t&&h(e)}}}function B(t){let e,r,s=t[6]+"";return{c(){e=new k(!1),r=b(),e.a=r},m(t,o){e.m(s,t,o),n(t,r,o)},p(t,r){32&r[0]&&s!==(s=t[6]+"")&&e.p(s)},d(t){t&&h(r),t&&e.d()}}}function D(t){let e,r,s,o,g,m,p,x,b=t[3].show&&q(t),$=t[4],k=[];for(let e=0;e<$.length;e+=1)k[e]=I(F(t,$,e));let y=t[5],w=[];for(let e=0;e<y.length;e+=1)w[e]=B(C(t,y,e));return{c(){e=a("div"),r=i(),b&&b.c(),s=i(),o=a("div");for(let t=0;t<k.length;t+=1)k[t].c();g=i(),m=a("div");for(let t=0;t<w.length;t+=1)w[t].c();p=i(),x=c("text"),this.c=l,f(e,"background-color",t[0]),d(o,"class","legend"),f(m,"height","0"),f(m,"width","0"),d(m,"class","pattern")},m(a,i){n(a,e,i),t[19](e),n(a,r,i),b&&b.m(a,i),n(a,s,i),n(a,o,i);for(let t=0;t<k.length;t+=1)k[t]&&k[t].m(o,null);n(a,g,i),n(a,m,i);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(m,null);n(a,p,i),n(a,x,i)},p(t,r){if(1&r[0]&&f(e,"background-color",t[0]),t[3].show?b?b.p(t,r):(b=q(t),b.c(),b.m(s.parentNode,s)):b&&(b.d(1),b=null),18&r[0]){let e;for($=t[4],e=0;e<$.length;e+=1){const n=F(t,$,e);k[e]?k[e].p(n,r):(k[e]=I(n),k[e].c(),k[e].m(o,null))}for(;e<k.length;e+=1)k[e].d(1);k.length=$.length}if(32&r[0]){let e;for(y=t[5],e=0;e<y.length;e+=1){const n=C(t,y,e);w[e]?w[e].p(n,r):(w[e]=B(n),w[e].c(),w[e].m(m,null))}for(;e<w.length;e+=1)w[e].d(1);w.length=y.length}},i:l,o:l,d(n){n&&h(e),t[19](null),n&&h(r),b&&b.d(n),n&&h(s),n&&h(o),u(k,n),n&&h(g),n&&h(m),u(w,n),n&&h(p),n&&h(x)}}}function H(t){return t?JSON.parse(t):{top:10,right:40,bottom:20,left:60,xAxis:20}}function K(t,e,r){let n,s,o,a,i,c,l,f,d,{data:h=""}=e,{chartheight:u="300"}=e,{backgroundcolor:m="#fff"}=e,{scalemax:p=50}=e,{ticknumbers:x=4}=e,{tickleftformat:b=(t=>`${Number(t)}`)}=e,{tickbottomformat:k=(t=>`${Number(t)}`)}=e,{margins:v}=e,{svgs:A}=e,{colors:E}=e,O=!1,J={show:!1,text:"",top:0,left:0,width:0},z=new w;function C(){let t=y(f).style("width");return""!==t&&t||(t=""+window.innerWidth/2),parseInt(t)}function F(t){return{x:_().domain(s).range([0,t-(H(v).left/2+H(v).right/2)]).padding(.2),y:S().domain([0,p]).range([a,0])}}function q(t,e){const s=R().keys(o)(n);d.append("g").selectAll("g").data(s).enter().append("g").attr("fill",(t=>c[t.key]||"black")).attr("class","bar").selectAll("rect").data((t=>t)).enter().append("rect").attr("x",(e=>t(e.data.group.toString()))).attr("y",(t=>e(t[1]))).attr("width",t.bandwidth()).attr("height",(t=>e(t[0])-e(t[1]))).style("cursor","pointer").on("mouseout",((t,e)=>{d.selectAll("rect").filter((function(t){return t!=e})).style("opacity",1),r(3,J.show=!1,J)})).on("mouseover",((t,e)=>{d.selectAll("rect").filter((function(t){return t!=e})).style("opacity",.7);const{left:n,top:s,width:o}=t.target.getBoundingClientRect();r(3,J={show:!0,text:e.data.customtooltip?e.data.customtooltip:""+(e[1]-e[0]),left:n,top:s-50,width:o})})).on("click",((t,e)=>{z.dispatch("bar-clicked",e)}))}function I(t,e){d.select(".x-axis").call(N(t).tickFormat(k)),d.select(".y-axis").call(j(e).ticks(x).tickFormat(b));const r=C();d.selectAll(".y-axis .tick line").attr("stroke","#EEEDEA").attr("stroke-width","1px").attr("x2",r)}function B(){var t;if(l){const e=C();null===(t=f.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:s}=F(e);I(r,s);const a=R().keys(o)(n);d.selectAll(".bar").data(a).selectAll("rect").data((t=>t)).attr("x",(t=>r(t.data.group.toString()))).attr("y",(t=>s(t[1]))).attr("width",r.bandwidth()).attr("height",(t=>s(t[0])-s(t[1])))}}return g((()=>{new ResizeObserver(B).observe(f),r(17,O=!0)})),t.$$set=t=>{"data"in t&&r(7,h=t.data),"chartheight"in t&&r(8,u=t.chartheight),"backgroundcolor"in t&&r(0,m=t.backgroundcolor),"scalemax"in t&&r(9,p=t.scalemax),"ticknumbers"in t&&r(10,x=t.ticknumbers),"tickleftformat"in t&&r(11,b=t.tickleftformat),"tickbottomformat"in t&&r(12,k=t.tickbottomformat),"margins"in t&&r(13,v=t.margins),"svgs"in t&&r(14,A=t.svgs),"colors"in t&&r(15,E=t.colors)},t.$$.update=()=>{128&t.$$.dirty[0]&&r(18,n=h?JSON.parse(h):[]),262144&t.$$.dirty[0]&&(s=n.map((t=>t.group))),262144&t.$$.dirty[0]&&r(4,o=n[0]?Object.keys(n[0]).filter((t=>"group"!==t)):[]),256&t.$$.dirty[0]&&(a=parseInt(u,10)),16384&t.$$.dirty[0]&&r(5,i=A?JSON.parse(A):[]),32768&t.$$.dirty[0]&&r(1,c=E?JSON.parse(E):{}),196736&t.$$.dirty[0]&&h.length>0&&O&&(l?h!==l&&(!function(){var t;const e=C();null===(t=f.querySelector("#svg-chart"))||void 0===t||t.setAttribute("width",`${e}px`);const{x:r,y:n}=F(e);I(r,n),d.selectAll(".bar").remove(),q(r,n)}(),r(16,l=h)):(!function(){const t=C(),{x:e,y:n}=F(t);r(6,d=y(f).append("svg").attr("width",t).attr("height",Number(a)+Number(H(v).top)+Number(H(v).bottom)+Number(H(v).xAxis)).attr("id","svg-chart").append("g").attr("transform",`translate(${H(v).left/2+H(v).right/2},${H(v).top})`)),d.append("g").attr("transform",`translate(0, ${Number(a)+Number(H(v).xAxis)})`).call(N(e)).attr("class","x-axis").attr("stroke-width","0"),d.append("g").call(j(n).ticks(x).tickFormat(b)).attr("class","y-axis").attr("stroke-width","0"),q(e,n)}(),r(16,l=h)))},[m,c,f,J,o,i,d,h,u,p,x,b,k,v,A,E,l,O,n,function(t){$[t?"unshift":"push"]((()=>{f=t,r(2,f)}))}]}class L extends t{constructor(t){super();const a=document.createElement("style");a.textContent='.legend{margin-top:1rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 1.5rem;height:100%;color:#000000;gap:1rem}.legend__item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:0.875rem;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.legend__title{white-space:nowrap;margin:0}.legend__box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:0.25rem;height:16px;width:24px}.tooltip{height:auto;background-color:#4d4d4d;border-radius:4px;color:#ffffff;text-align:center;padding:0.5rem 0;position:absolute}.pattern{z-index:-1;position:relative}text{font-family:"LeroyMerlin", sans-serif;font-size:0.875rem;color:#4d4d4d}',this.shadowRoot.appendChild(a),e(this,{target:this.shadowRoot,props:r(this.attributes),customElement:!0},K,D,o,{data:7,chartheight:8,backgroundcolor:0,scalemax:9,ticknumbers:10,tickleftformat:11,tickbottomformat:12,margins:13,svgs:14,colors:15},null,[-1,-1]),t&&(t.target&&n(t.target,this,t.anchor),t.props&&(this.$set(t.props),s()))}static get observedAttributes(){return["data","chartheight","backgroundcolor","scalemax","ticknumbers","tickleftformat","tickbottomformat","margins","svgs","colors"]}get data(){return this.$$.ctx[7]}set data(t){this.$$set({data:t}),s()}get chartheight(){return this.$$.ctx[8]}set chartheight(t){this.$$set({chartheight:t}),s()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),s()}get scalemax(){return this.$$.ctx[9]}set scalemax(t){this.$$set({scalemax:t}),s()}get ticknumbers(){return this.$$.ctx[10]}set ticknumbers(t){this.$$set({ticknumbers:t}),s()}get tickleftformat(){return this.$$.ctx[11]}set tickleftformat(t){this.$$set({tickleftformat:t}),s()}get tickbottomformat(){return this.$$.ctx[12]}set tickbottomformat(t){this.$$set({tickbottomformat:t}),s()}get margins(){return this.$$.ctx[13]}set margins(t){this.$$set({margins:t}),s()}get svgs(){return this.$$.ctx[14]}set svgs(t){this.$$set({svgs:t}),s()}get colors(){return this.$$.ctx[15]}set colors(t){this.$$set({colors:t}),s()}}export{L as default};
|
|
746
2
|
//# sourceMappingURL=StackedBarChart.js.map
|