@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,730 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { s as select } from '../../transform-15d69d5d.js';
|
|
3
|
-
import { E as EventHandler } from '../../EventHandler-02058705.js';
|
|
4
|
-
import { S as Symbol, s as symbolSquare, b as symbolCircle, a as symbolTriangle, c as symbolDiamond, l as line } from '../../symbol-b05a6e2b.js';
|
|
5
|
-
import { a as sqrt, t as tau, c as cos, s as sin, p as pi } from '../../path-1b5da959.js';
|
|
6
|
-
import { l as linear } from '../../linear-f46d7e9e.js';
|
|
7
|
-
import '../../array-5b770a93.js';
|
|
8
|
-
|
|
9
|
-
const ka = 0.89081309152928522810;
|
|
10
|
-
const kr = sin(pi / 10) / sin(7 * pi / 10);
|
|
11
|
-
const kx = sin(tau / 10) * kr;
|
|
12
|
-
const ky = -cos(tau / 10) * kr;
|
|
13
|
-
|
|
14
|
-
var symbolStar = {
|
|
15
|
-
draw(context, size) {
|
|
16
|
-
const r = sqrt(size * ka);
|
|
17
|
-
const x = kx * r;
|
|
18
|
-
const y = ky * r;
|
|
19
|
-
context.moveTo(0, -r);
|
|
20
|
-
context.lineTo(x, y);
|
|
21
|
-
for (let i = 1; i < 5; ++i) {
|
|
22
|
-
const a = tau * i / 5;
|
|
23
|
-
const c = cos(a);
|
|
24
|
-
const s = sin(a);
|
|
25
|
-
context.lineTo(s * r, -c * r);
|
|
26
|
-
context.lineTo(c * x - s * y, s * x + c * y);
|
|
27
|
-
}
|
|
28
|
-
context.closePath();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/* src/components/chart/Radar.svelte generated by Svelte v3.58.0 */
|
|
33
|
-
|
|
34
|
-
function get_each_context(ctx, list, i) {
|
|
35
|
-
const child_ctx = ctx.slice();
|
|
36
|
-
child_ctx[1] = list[i];
|
|
37
|
-
return child_ctx;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// (267:2) {#if tooltipData.show}
|
|
41
|
-
function create_if_block(ctx) {
|
|
42
|
-
let div1;
|
|
43
|
-
let span;
|
|
44
|
-
let b;
|
|
45
|
-
let t0_value = /*tooltipData*/ ctx[3].title + "";
|
|
46
|
-
let t0;
|
|
47
|
-
let t1;
|
|
48
|
-
let div0;
|
|
49
|
-
let each_value = /*tooltipData*/ ctx[3].text;
|
|
50
|
-
let each_blocks = [];
|
|
51
|
-
|
|
52
|
-
for (let i = 0; i < each_value.length; i += 1) {
|
|
53
|
-
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
c() {
|
|
58
|
-
div1 = element("div");
|
|
59
|
-
span = element("span");
|
|
60
|
-
b = element("b");
|
|
61
|
-
t0 = text(t0_value);
|
|
62
|
-
t1 = space();
|
|
63
|
-
div0 = element("div");
|
|
64
|
-
|
|
65
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
66
|
-
each_blocks[i].c();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
attr(div1, "class", "chart__tooltip");
|
|
70
|
-
set_style(div1, "left", /*tooltipData*/ ctx[3].left);
|
|
71
|
-
set_style(div1, "top", /*tooltipData*/ ctx[3].top);
|
|
72
|
-
},
|
|
73
|
-
m(target, anchor) {
|
|
74
|
-
insert(target, div1, anchor);
|
|
75
|
-
append(div1, span);
|
|
76
|
-
append(span, b);
|
|
77
|
-
append(b, t0);
|
|
78
|
-
append(div1, t1);
|
|
79
|
-
append(div1, div0);
|
|
80
|
-
|
|
81
|
-
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
82
|
-
if (each_blocks[i]) {
|
|
83
|
-
each_blocks[i].m(div0, null);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
p(ctx, dirty) {
|
|
88
|
-
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*tooltipData*/ ctx[3].title + "")) set_data(t0, t0_value);
|
|
89
|
-
|
|
90
|
-
if (dirty[0] & /*tooltipData*/ 8) {
|
|
91
|
-
each_value = /*tooltipData*/ ctx[3].text;
|
|
92
|
-
let i;
|
|
93
|
-
|
|
94
|
-
for (i = 0; i < each_value.length; i += 1) {
|
|
95
|
-
const child_ctx = get_each_context(ctx, each_value, i);
|
|
96
|
-
|
|
97
|
-
if (each_blocks[i]) {
|
|
98
|
-
each_blocks[i].p(child_ctx, dirty);
|
|
99
|
-
} else {
|
|
100
|
-
each_blocks[i] = create_each_block(child_ctx);
|
|
101
|
-
each_blocks[i].c();
|
|
102
|
-
each_blocks[i].m(div0, null);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
for (; i < each_blocks.length; i += 1) {
|
|
107
|
-
each_blocks[i].d(1);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
each_blocks.length = each_value.length;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (dirty[0] & /*tooltipData*/ 8) {
|
|
114
|
-
set_style(div1, "left", /*tooltipData*/ ctx[3].left);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (dirty[0] & /*tooltipData*/ 8) {
|
|
118
|
-
set_style(div1, "top", /*tooltipData*/ ctx[3].top);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
d(detaching) {
|
|
122
|
-
if (detaching) detach(div1);
|
|
123
|
-
destroy_each(each_blocks, detaching);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// (279:10) {:else}
|
|
129
|
-
function create_else_block(ctx) {
|
|
130
|
-
let div;
|
|
131
|
-
let span0;
|
|
132
|
-
let t0_value = /*data*/ ctx[1].name + "";
|
|
133
|
-
let t0;
|
|
134
|
-
let t1;
|
|
135
|
-
let span1;
|
|
136
|
-
let t2_value = /*data*/ ctx[1].value + "";
|
|
137
|
-
let t2;
|
|
138
|
-
let t3;
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
c() {
|
|
142
|
-
div = element("div");
|
|
143
|
-
span0 = element("span");
|
|
144
|
-
t0 = text(t0_value);
|
|
145
|
-
t1 = space();
|
|
146
|
-
span1 = element("span");
|
|
147
|
-
t2 = text(t2_value);
|
|
148
|
-
t3 = space();
|
|
149
|
-
attr(span0, "class", "chart__legend");
|
|
150
|
-
attr(span1, "class", "chart__elem");
|
|
151
|
-
attr(div, "class", "chart__list");
|
|
152
|
-
},
|
|
153
|
-
m(target, anchor) {
|
|
154
|
-
insert(target, div, anchor);
|
|
155
|
-
append(div, span0);
|
|
156
|
-
append(span0, t0);
|
|
157
|
-
append(div, t1);
|
|
158
|
-
append(div, span1);
|
|
159
|
-
append(span1, t2);
|
|
160
|
-
append(div, t3);
|
|
161
|
-
},
|
|
162
|
-
p(ctx, dirty) {
|
|
163
|
-
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*data*/ ctx[1].name + "")) set_data(t0, t0_value);
|
|
164
|
-
if (dirty[0] & /*tooltipData*/ 8 && t2_value !== (t2_value = /*data*/ ctx[1].value + "")) set_data(t2, t2_value);
|
|
165
|
-
},
|
|
166
|
-
d(detaching) {
|
|
167
|
-
if (detaching) detach(div);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// (275:10) {#if data.customtooltip}
|
|
173
|
-
function create_if_block_1(ctx) {
|
|
174
|
-
let div;
|
|
175
|
-
let span;
|
|
176
|
-
let t0_value = /*data*/ ctx[1].customtooltip + "";
|
|
177
|
-
let t0;
|
|
178
|
-
let t1;
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
c() {
|
|
182
|
-
div = element("div");
|
|
183
|
-
span = element("span");
|
|
184
|
-
t0 = text(t0_value);
|
|
185
|
-
t1 = space();
|
|
186
|
-
attr(span, "class", "chart__elem");
|
|
187
|
-
attr(div, "class", "chart__list");
|
|
188
|
-
},
|
|
189
|
-
m(target, anchor) {
|
|
190
|
-
insert(target, div, anchor);
|
|
191
|
-
append(div, span);
|
|
192
|
-
append(span, t0);
|
|
193
|
-
append(div, t1);
|
|
194
|
-
},
|
|
195
|
-
p(ctx, dirty) {
|
|
196
|
-
if (dirty[0] & /*tooltipData*/ 8 && t0_value !== (t0_value = /*data*/ ctx[1].customtooltip + "")) set_data(t0, t0_value);
|
|
197
|
-
},
|
|
198
|
-
d(detaching) {
|
|
199
|
-
if (detaching) detach(div);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// (274:8) {#each tooltipData.text as data}
|
|
205
|
-
function create_each_block(ctx) {
|
|
206
|
-
let if_block_anchor;
|
|
207
|
-
|
|
208
|
-
function select_block_type(ctx, dirty) {
|
|
209
|
-
if (/*data*/ ctx[1].customtooltip) return create_if_block_1;
|
|
210
|
-
return create_else_block;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
let current_block_type = select_block_type(ctx);
|
|
214
|
-
let if_block = current_block_type(ctx);
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
c() {
|
|
218
|
-
if_block.c();
|
|
219
|
-
if_block_anchor = empty();
|
|
220
|
-
},
|
|
221
|
-
m(target, anchor) {
|
|
222
|
-
if_block.m(target, anchor);
|
|
223
|
-
insert(target, if_block_anchor, anchor);
|
|
224
|
-
},
|
|
225
|
-
p(ctx, dirty) {
|
|
226
|
-
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
|
|
227
|
-
if_block.p(ctx, dirty);
|
|
228
|
-
} else {
|
|
229
|
-
if_block.d(1);
|
|
230
|
-
if_block = current_block_type(ctx);
|
|
231
|
-
|
|
232
|
-
if (if_block) {
|
|
233
|
-
if_block.c();
|
|
234
|
-
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
d(detaching) {
|
|
239
|
-
if_block.d(detaching);
|
|
240
|
-
if (detaching) detach(if_block_anchor);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function create_fragment(ctx) {
|
|
246
|
-
let div;
|
|
247
|
-
let if_block = /*tooltipData*/ ctx[3].show && create_if_block(ctx);
|
|
248
|
-
|
|
249
|
-
return {
|
|
250
|
-
c() {
|
|
251
|
-
div = element("div");
|
|
252
|
-
if (if_block) if_block.c();
|
|
253
|
-
this.c = noop;
|
|
254
|
-
attr(div, "class", "chart");
|
|
255
|
-
set_style(div, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
256
|
-
},
|
|
257
|
-
m(target, anchor) {
|
|
258
|
-
insert(target, div, anchor);
|
|
259
|
-
if (if_block) if_block.m(div, null);
|
|
260
|
-
/*div_binding*/ ctx[11](div);
|
|
261
|
-
},
|
|
262
|
-
p(ctx, dirty) {
|
|
263
|
-
if (/*tooltipData*/ ctx[3].show) {
|
|
264
|
-
if (if_block) {
|
|
265
|
-
if_block.p(ctx, dirty);
|
|
266
|
-
} else {
|
|
267
|
-
if_block = create_if_block(ctx);
|
|
268
|
-
if_block.c();
|
|
269
|
-
if_block.m(div, null);
|
|
270
|
-
}
|
|
271
|
-
} else if (if_block) {
|
|
272
|
-
if_block.d(1);
|
|
273
|
-
if_block = null;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (dirty[0] & /*backgroundcolor*/ 1) {
|
|
277
|
-
set_style(div, "background-color", /*backgroundcolor*/ ctx[0]);
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
i: noop,
|
|
281
|
-
o: noop,
|
|
282
|
-
d(detaching) {
|
|
283
|
-
if (detaching) detach(div);
|
|
284
|
-
if (if_block) if_block.d();
|
|
285
|
-
/*div_binding*/ ctx[11](null);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
function instance($$self, $$props, $$invalidate) {
|
|
291
|
-
let parsedData;
|
|
292
|
-
let dataset;
|
|
293
|
-
let scale;
|
|
294
|
-
let { data = '' } = $$props;
|
|
295
|
-
let { backgroundcolor = '#fff' } = $$props;
|
|
296
|
-
let { delay = 500 } = $$props;
|
|
297
|
-
let { sides = 5 } = $$props;
|
|
298
|
-
let { levels = 10 } = $$props;
|
|
299
|
-
let { valuemax = 20 } = $$props;
|
|
300
|
-
let { scalemax = 20 } = $$props;
|
|
301
|
-
let { hasgrades = false } = $$props;
|
|
302
|
-
|
|
303
|
-
const symbolPath = [
|
|
304
|
-
Symbol(symbolSquare),
|
|
305
|
-
Symbol(symbolCircle),
|
|
306
|
-
Symbol(symbolTriangle),
|
|
307
|
-
Symbol(symbolDiamond),
|
|
308
|
-
Symbol(symbolStar)
|
|
309
|
-
];
|
|
310
|
-
|
|
311
|
-
const colors = ['#605F9D', '#00919F', '#758992', '#0B96CC'];
|
|
312
|
-
let chart;
|
|
313
|
-
let svg;
|
|
314
|
-
let hasMounted = false;
|
|
315
|
-
let eventHandler = new EventHandler();
|
|
316
|
-
|
|
317
|
-
let tooltipData = {
|
|
318
|
-
left: '0px',
|
|
319
|
-
top: '0px',
|
|
320
|
-
text: [],
|
|
321
|
-
title: '',
|
|
322
|
-
show: false
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
let size = Math.min(window.innerWidth, window.innerHeight, 400);
|
|
326
|
-
let offset = Math.PI;
|
|
327
|
-
let polyangle = Math.PI * 2 / sides;
|
|
328
|
-
let r = 0.8 * size;
|
|
329
|
-
let radius = r / 2;
|
|
330
|
-
let center = { x: size / 2, y: size / 2 };
|
|
331
|
-
|
|
332
|
-
const getPoint = (length, angle) => {
|
|
333
|
-
const point = {
|
|
334
|
-
x: center.x + length * Math.sin(offset - angle),
|
|
335
|
-
y: center.y + length * Math.cos(offset - angle)
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
return point;
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
const graduations = levels => {
|
|
342
|
-
const grades = [];
|
|
343
|
-
const step = valuemax / levels;
|
|
344
|
-
|
|
345
|
-
for (let i = 0; i <= levels; i++) {
|
|
346
|
-
const num = step * i;
|
|
347
|
-
|
|
348
|
-
if (Number.isInteger(step)) {
|
|
349
|
-
grades.push(Number(num));
|
|
350
|
-
} else {
|
|
351
|
-
grades.push(num.toFixed(2));
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
return grades;
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
const getPath = (points, parent) => {
|
|
359
|
-
const lineGenerator = line().x(d => d.x).y(d => d.y);
|
|
360
|
-
parent.append('path').attr('d', lineGenerator(points));
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
const getAxis = (ticks, levels) => {
|
|
364
|
-
const radarLines = svg.append('g').attr('class', 'radar-lines');
|
|
365
|
-
const point = getPoint(radius, 0);
|
|
366
|
-
getPath([center, point], radarLines);
|
|
367
|
-
const gradeLabel = svg.append('g').attr('class', 'ticks');
|
|
368
|
-
|
|
369
|
-
ticks.forEach((grade, i) => {
|
|
370
|
-
const r = i / levels * radius;
|
|
371
|
-
const p = getPoint(r, 0);
|
|
372
|
-
const points = [p, Object.assign(Object.assign({}, p), { x: p.x - 10 })];
|
|
373
|
-
getPath(points, radarLines);
|
|
374
|
-
|
|
375
|
-
if (hasgrades) {
|
|
376
|
-
getText(grade, p, true, gradeLabel);
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
const getLevels = (levels, sides) => {
|
|
382
|
-
for (let level = 1; level <= levels; level++) {
|
|
383
|
-
const hyp = level / levels * radius;
|
|
384
|
-
const points = [];
|
|
385
|
-
|
|
386
|
-
for (let vertex = 0; vertex < sides; vertex++) {
|
|
387
|
-
const angle = vertex * polyangle;
|
|
388
|
-
points.push(getPoint(hyp, angle));
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
const svgLevel = svg.append('g').style('fill', 'none').attr('stroke', '#CCCCCC');
|
|
392
|
-
getPath([...points, points[0]], svgLevel);
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
const getLines = sides => {
|
|
397
|
-
for (let vertex = 1, i = 0; vertex <= sides; (vertex++, i++)) {
|
|
398
|
-
const svgLine = svg.append('g').attr('stroke', '#ccc');
|
|
399
|
-
const angle = vertex * polyangle;
|
|
400
|
-
|
|
401
|
-
const formatdata = () => {
|
|
402
|
-
const tooltipData = dataset.map((elem, dataIndex) => {
|
|
403
|
-
let elemPrincipal = elem[vertex];
|
|
404
|
-
|
|
405
|
-
if (dataset[0][vertex].name === elemPrincipal.name) {
|
|
406
|
-
return {
|
|
407
|
-
name: `Serie ${dataIndex + 1}`,
|
|
408
|
-
value: elemPrincipal.value
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return undefined;
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
return tooltipData;
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
svgLine.on('mouseover', _e => {
|
|
419
|
-
svgLine.attr('stroke-dasharray', '4');
|
|
420
|
-
svgLine.attr('stroke-width', '4px');
|
|
421
|
-
|
|
422
|
-
$$invalidate(3, tooltipData = {
|
|
423
|
-
left: _e.pageX + 10 + 'px',
|
|
424
|
-
title: dataset[0][i + 1].name,
|
|
425
|
-
top: _e.pageY - 25 + 'px',
|
|
426
|
-
text: formatdata(),
|
|
427
|
-
show: true
|
|
428
|
-
});
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
svgLine.on('mouseout', _e => {
|
|
432
|
-
svgLine.attr('stroke-dasharray', 0);
|
|
433
|
-
svgLine.attr('stroke-width', '1px');
|
|
434
|
-
|
|
435
|
-
$$invalidate(3, tooltipData = {
|
|
436
|
-
left: _e.pageX + 10 + 'px',
|
|
437
|
-
top: _e.pageY - 25 + 'px',
|
|
438
|
-
show: false,
|
|
439
|
-
text: [],
|
|
440
|
-
title: ''
|
|
441
|
-
});
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
svgLine.on('click', (_e, chartEvent) => {
|
|
445
|
-
eventHandler.dispatch('serie-clicked', chartEvent);
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
const point = getPoint(radius, angle);
|
|
449
|
-
getPath([center, point], svgLine);
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
const getSymbols = (points, colors, index) => {
|
|
454
|
-
svg.selectAll().data(points).enter().append('path').attr('fill', '#FFF').attr('stroke', colors[index]).attr('stroke-width', '2px').attr('d', symbolPath[index].size(50)).attr('opacity', 0.4).attr('transform', d => `translate(${d.x},${d.y})`);
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
const getData = (dataset, side, index) => {
|
|
458
|
-
let points = [];
|
|
459
|
-
|
|
460
|
-
dataset.forEach((d, i) => {
|
|
461
|
-
const len = scale(d.value);
|
|
462
|
-
const theta = i * (2 * Math.PI / side);
|
|
463
|
-
points.push(Object.assign(Object.assign({}, getPoint(len, theta)), { value: 'hihihi' }));
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
const group = svg.append('g').attr('stroke', colors[index]).attr('stroke-width', '1.5px').attr('fill-opacity', '0.2').attr('fill', colors[index]);
|
|
467
|
-
|
|
468
|
-
group.on('mousemove', _e => {
|
|
469
|
-
$$invalidate(3, tooltipData = {
|
|
470
|
-
left: _e.pageX + 10 + 'px',
|
|
471
|
-
title: `Serie-${index}`,
|
|
472
|
-
top: _e.pageY - 25 + 'px',
|
|
473
|
-
text: dataset,
|
|
474
|
-
show: true
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
group.attr('fill-opacity', '0.6');
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
group.on('mouseout', _e => {
|
|
481
|
-
$$invalidate(3, tooltipData = {
|
|
482
|
-
left: '0px',
|
|
483
|
-
top: '0px',
|
|
484
|
-
text: [],
|
|
485
|
-
title: '',
|
|
486
|
-
show: false
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
group.attr('fill-opacity', '0.2');
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
getPath([...points, points[0]], group);
|
|
493
|
-
getSymbols(points, colors, index);
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
const getText = (text, point, isAxis, group) => {
|
|
497
|
-
if (isAxis) {
|
|
498
|
-
group.append('text').attr('x', point.x).attr('y', point.y).html(text).style('text-anchor', 'middle').attr('fill', '#3A3936').style('font-size', '11px');
|
|
499
|
-
} else {
|
|
500
|
-
group.append('text').attr('x', point.x).attr('y', point.y).html(text).style('text-anchor', 'middle').attr('fill', '#3A3936').style('font-size', '12px');
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
const drawLabels = (dataset, sides) => {
|
|
505
|
-
const groupL = svg.append('g').attr('class', 'labels');
|
|
506
|
-
|
|
507
|
-
for (let vertex = 0; vertex < sides; vertex++) {
|
|
508
|
-
const angle = vertex * polyangle;
|
|
509
|
-
const label = dataset[vertex].name;
|
|
510
|
-
const point = getPoint(0.9 * (size / 2), angle);
|
|
511
|
-
getText(label, point, false, groupL);
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
const renderChart = () => {
|
|
516
|
-
const ticks = graduations(levels);
|
|
517
|
-
getLevels(levels, sides);
|
|
518
|
-
getAxis(ticks, levels);
|
|
519
|
-
getLines(sides);
|
|
520
|
-
|
|
521
|
-
dataset.forEach((dataValue, index) => {
|
|
522
|
-
getData(dataValue, sides, index);
|
|
523
|
-
drawLabels(dataValue, sides);
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
setTimeout(
|
|
527
|
-
() => {
|
|
528
|
-
updateChart(parsedData);
|
|
529
|
-
},
|
|
530
|
-
delay * parsedData.length
|
|
531
|
-
);
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
function updateChart(data) {
|
|
535
|
-
getLines(sides);
|
|
536
|
-
|
|
537
|
-
data.forEach((dataValue, index) => {
|
|
538
|
-
getData(dataValue, sides, index);
|
|
539
|
-
drawLabels(dataValue, sides);
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
onMount(() => $$invalidate(10, hasMounted = true));
|
|
544
|
-
|
|
545
|
-
function div_binding($$value) {
|
|
546
|
-
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
547
|
-
chart = $$value;
|
|
548
|
-
$$invalidate(2, chart);
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
$$self.$$set = $$props => {
|
|
553
|
-
if ('data' in $$props) $$invalidate(1, data = $$props.data);
|
|
554
|
-
if ('backgroundcolor' in $$props) $$invalidate(0, backgroundcolor = $$props.backgroundcolor);
|
|
555
|
-
if ('delay' in $$props) $$invalidate(4, delay = $$props.delay);
|
|
556
|
-
if ('sides' in $$props) $$invalidate(5, sides = $$props.sides);
|
|
557
|
-
if ('levels' in $$props) $$invalidate(6, levels = $$props.levels);
|
|
558
|
-
if ('valuemax' in $$props) $$invalidate(7, valuemax = $$props.valuemax);
|
|
559
|
-
if ('scalemax' in $$props) $$invalidate(8, scalemax = $$props.scalemax);
|
|
560
|
-
if ('hasgrades' in $$props) $$invalidate(9, hasgrades = $$props.hasgrades);
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
$$self.$$.update = () => {
|
|
564
|
-
if ($$self.$$.dirty[0] & /*data*/ 2) {
|
|
565
|
-
parsedData = data ? JSON.parse(data) : [];
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
if ($$self.$$.dirty[0] & /*data*/ 2) {
|
|
569
|
-
dataset = data ? JSON.parse(data) : [];
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
if ($$self.$$.dirty[0] & /*scalemax*/ 256) {
|
|
573
|
-
scale = linear().domain([0, scalemax]).range([0, radius]);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
if ($$self.$$.dirty[0] & /*data, hasMounted, chart*/ 1030) {
|
|
577
|
-
if (data.length > 0 && hasMounted) {
|
|
578
|
-
svg = select(chart).append('svg').attr('width', size).attr('height', size).append('g');
|
|
579
|
-
renderChart();
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
return [
|
|
585
|
-
backgroundcolor,
|
|
586
|
-
data,
|
|
587
|
-
chart,
|
|
588
|
-
tooltipData,
|
|
589
|
-
delay,
|
|
590
|
-
sides,
|
|
591
|
-
levels,
|
|
592
|
-
valuemax,
|
|
593
|
-
scalemax,
|
|
594
|
-
hasgrades,
|
|
595
|
-
hasMounted,
|
|
596
|
-
div_binding
|
|
597
|
-
];
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
class Radar extends SvelteElement {
|
|
601
|
-
constructor(options) {
|
|
602
|
-
super();
|
|
603
|
-
const style = document.createElement('style');
|
|
604
|
-
style.textContent = `@media screen and (min-width: 680px){}@media screen and (min-width: 1024px){}@media screen and (min-width: 1280px){}@media screen and (min-width: 1920px){}.chart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:#ffffff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chart__tooltip{position:absolute;width:auto;height:auto;background-color:white;border:1px solid #000;border-radius:4px;min-width:152px;color:grey;padding:0.25rem 0.5rem}.chart__list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}`;
|
|
605
|
-
this.shadowRoot.appendChild(style);
|
|
606
|
-
|
|
607
|
-
init(
|
|
608
|
-
this,
|
|
609
|
-
{
|
|
610
|
-
target: this.shadowRoot,
|
|
611
|
-
props: attribute_to_object(this.attributes),
|
|
612
|
-
customElement: true
|
|
613
|
-
},
|
|
614
|
-
instance,
|
|
615
|
-
create_fragment,
|
|
616
|
-
safe_not_equal,
|
|
617
|
-
{
|
|
618
|
-
data: 1,
|
|
619
|
-
backgroundcolor: 0,
|
|
620
|
-
delay: 4,
|
|
621
|
-
sides: 5,
|
|
622
|
-
levels: 6,
|
|
623
|
-
valuemax: 7,
|
|
624
|
-
scalemax: 8,
|
|
625
|
-
hasgrades: 9
|
|
626
|
-
},
|
|
627
|
-
null,
|
|
628
|
-
[-1, -1]
|
|
629
|
-
);
|
|
630
|
-
|
|
631
|
-
if (options) {
|
|
632
|
-
if (options.target) {
|
|
633
|
-
insert(options.target, this, options.anchor);
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
if (options.props) {
|
|
637
|
-
this.$set(options.props);
|
|
638
|
-
flush();
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
static get observedAttributes() {
|
|
644
|
-
return [
|
|
645
|
-
"data",
|
|
646
|
-
"backgroundcolor",
|
|
647
|
-
"delay",
|
|
648
|
-
"sides",
|
|
649
|
-
"levels",
|
|
650
|
-
"valuemax",
|
|
651
|
-
"scalemax",
|
|
652
|
-
"hasgrades"
|
|
653
|
-
];
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
get data() {
|
|
657
|
-
return this.$$.ctx[1];
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
set data(data) {
|
|
661
|
-
this.$$set({ data });
|
|
662
|
-
flush();
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
get backgroundcolor() {
|
|
666
|
-
return this.$$.ctx[0];
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
set backgroundcolor(backgroundcolor) {
|
|
670
|
-
this.$$set({ backgroundcolor });
|
|
671
|
-
flush();
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
get delay() {
|
|
675
|
-
return this.$$.ctx[4];
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
set delay(delay) {
|
|
679
|
-
this.$$set({ delay });
|
|
680
|
-
flush();
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
get sides() {
|
|
684
|
-
return this.$$.ctx[5];
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
set sides(sides) {
|
|
688
|
-
this.$$set({ sides });
|
|
689
|
-
flush();
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
get levels() {
|
|
693
|
-
return this.$$.ctx[6];
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
set levels(levels) {
|
|
697
|
-
this.$$set({ levels });
|
|
698
|
-
flush();
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
get valuemax() {
|
|
702
|
-
return this.$$.ctx[7];
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
set valuemax(valuemax) {
|
|
706
|
-
this.$$set({ valuemax });
|
|
707
|
-
flush();
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
get scalemax() {
|
|
711
|
-
return this.$$.ctx[8];
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
set scalemax(scalemax) {
|
|
715
|
-
this.$$set({ scalemax });
|
|
716
|
-
flush();
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
get hasgrades() {
|
|
720
|
-
return this.$$.ctx[9];
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
set hasgrades(hasgrades) {
|
|
724
|
-
this.$$set({ hasgrades });
|
|
725
|
-
flush();
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
export { Radar as default };
|
|
1
|
+
import{S as t,i as e,a,b as s,f as r,s as o,e as l,n,g as i,y as c,o as d,a1 as p,t as h,d as u,j as m,k as x,J as f,K as g,v as b}from"../../index-c33b3772.js";import{s as $}from"../../transform-15d69d5d.js";import{E as y}from"../../EventHandler-02058705.js";import{S as w,s as k,b as v,a as j,c as _,l as C}from"../../symbol-b05a6e2b.js";import{a as E,t as F,c as M,s as O,p as S}from"../../path-1b5da959.js";import{l as N}from"../../linear-f46d7e9e.js";import"../../array-5b770a93.js";const T=O(S/10)/O(7*S/10),z=O(F/10)*T,A=-M(F/10)*T;var I={draw(t,e){const a=E(.8908130915292852*e),s=z*a,r=A*a;t.moveTo(0,-a),t.lineTo(s,r);for(let e=1;e<5;++e){const o=F*e/5,l=M(o),n=O(o);t.lineTo(n*a,-l*a),t.lineTo(l*s-n*r,n*s+l*r)}t.closePath()}};function P(t,e,a){const s=t.slice();return s[1]=e[a],s}function J(t){let e,a,r,o,n,p,g=t[3].title+"",b=t[3].text,$=[];for(let e=0;e<b.length;e+=1)$[e]=H(P(t,b,e));return{c(){e=l("div"),a=l("span"),r=l("b"),o=h(g),n=u(),p=l("div");for(let t=0;t<$.length;t+=1)$[t].c();i(e,"class","chart__tooltip"),c(e,"left",t[3].left),c(e,"top",t[3].top)},m(t,l){s(t,e,l),m(e,a),m(a,r),m(r,o),m(e,n),m(e,p);for(let t=0;t<$.length;t+=1)$[t]&&$[t].m(p,null)},p(t,a){if(8&a[0]&&g!==(g=t[3].title+"")&&x(o,g),8&a[0]){let e;for(b=t[3].text,e=0;e<b.length;e+=1){const s=P(t,b,e);$[e]?$[e].p(s,a):($[e]=H(s),$[e].c(),$[e].m(p,null))}for(;e<$.length;e+=1)$[e].d(1);$.length=b.length}8&a[0]&&c(e,"left",t[3].left),8&a[0]&&c(e,"top",t[3].top)},d(t){t&&d(e),f($,t)}}}function X(t){let e,a,r,o,n,c,p,f=t[1].name+"",g=t[1].value+"";return{c(){e=l("div"),a=l("span"),r=h(f),o=u(),n=l("span"),c=h(g),p=u(),i(a,"class","chart__legend"),i(n,"class","chart__elem"),i(e,"class","chart__list")},m(t,l){s(t,e,l),m(e,a),m(a,r),m(e,o),m(e,n),m(n,c),m(e,p)},p(t,e){8&e[0]&&f!==(f=t[1].name+"")&&x(r,f),8&e[0]&&g!==(g=t[1].value+"")&&x(c,g)},d(t){t&&d(e)}}}function Y(t){let e,a,r,o,n=t[1].customtooltip+"";return{c(){e=l("div"),a=l("span"),r=h(n),o=u(),i(a,"class","chart__elem"),i(e,"class","chart__list")},m(t,l){s(t,e,l),m(e,a),m(a,r),m(e,o)},p(t,e){8&e[0]&&n!==(n=t[1].customtooltip+"")&&x(r,n)},d(t){t&&d(e)}}}function H(t){let e;function a(t,e){return t[1].customtooltip?Y:X}let r=a(t),o=r(t);return{c(){o.c(),e=g()},m(t,a){o.m(t,a),s(t,e,a)},p(t,s){r===(r=a(t))&&o?o.p(t,s):(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){o.d(t),t&&d(e)}}}function R(t){let e,a=t[3].show&&J(t);return{c(){e=l("div"),a&&a.c(),this.c=n,i(e,"class","chart"),c(e,"background-color",t[0])},m(r,o){s(r,e,o),a&&a.m(e,null),t[11](e)},p(t,s){t[3].show?a?a.p(t,s):(a=J(t),a.c(),a.m(e,null)):a&&(a.d(1),a=null),1&s[0]&&c(e,"background-color",t[0])},i:n,o:n,d(s){s&&d(e),a&&a.d(),t[11](null)}}}function B(t,e,a){let s,r,o,{data:l=""}=e,{backgroundcolor:n="#fff"}=e,{delay:i=500}=e,{sides:c=5}=e,{levels:d=10}=e,{valuemax:h=20}=e,{scalemax:u=20}=e,{hasgrades:m=!1}=e;const x=[w(k),w(v),w(j),w(_),w(I)],f=["#605F9D","#00919F","#758992","#0B96CC"];let g,E,F=!1,M=new y,O={left:"0px",top:"0px",text:[],title:"",show:!1},S=Math.min(window.innerWidth,window.innerHeight,400),T=Math.PI,z=2*Math.PI/c,A=.8*S/2,P={x:S/2,y:S/2};const J=(t,e)=>({x:P.x+t*Math.sin(T-e),y:P.y+t*Math.cos(T-e)}),X=(t,e)=>{const a=C().x((t=>t.x)).y((t=>t.y));e.append("path").attr("d",a(t))},Y=t=>{for(let e=1,s=0;e<=t;e++,s++){const t=E.append("g").attr("stroke","#ccc"),o=e*z,l=()=>r.map(((t,a)=>{let s=t[e];if(r[0][e].name===s.name)return{name:`Serie ${a+1}`,value:s.value}}));t.on("mouseover",(e=>{t.attr("stroke-dasharray","4"),t.attr("stroke-width","4px"),a(3,O={left:e.pageX+10+"px",title:r[0][s+1].name,top:e.pageY-25+"px",text:l(),show:!0})})),t.on("mouseout",(e=>{t.attr("stroke-dasharray",0),t.attr("stroke-width","1px"),a(3,O={left:e.pageX+10+"px",top:e.pageY-25+"px",show:!1,text:[],title:""})})),t.on("click",((t,e)=>{M.dispatch("serie-clicked",e)}));const n=J(A,o);X([P,n],t)}},H=(t,e,s)=>{let r=[];t.forEach(((t,a)=>{const s=o(t.value),l=a*(2*Math.PI/e);r.push(Object.assign(Object.assign({},J(s,l)),{value:"hihihi"}))}));const l=E.append("g").attr("stroke",f[s]).attr("stroke-width","1.5px").attr("fill-opacity","0.2").attr("fill",f[s]);l.on("mousemove",(e=>{a(3,O={left:e.pageX+10+"px",title:`Serie-${s}`,top:e.pageY-25+"px",text:t,show:!0}),l.attr("fill-opacity","0.6")})),l.on("mouseout",(t=>{a(3,O={left:"0px",top:"0px",text:[],title:"",show:!1}),l.attr("fill-opacity","0.2")})),X([...r,r[0]],l),((t,e,a)=>{E.selectAll().data(t).enter().append("path").attr("fill","#FFF").attr("stroke",e[a]).attr("stroke-width","2px").attr("d",x[a].size(50)).attr("opacity",.4).attr("transform",(t=>`translate(${t.x},${t.y})`))})(r,f,s)},R=(t,e,a,s)=>{a?s.append("text").attr("x",e.x).attr("y",e.y).html(t).style("text-anchor","middle").attr("fill","#3A3936").style("font-size","11px"):s.append("text").attr("x",e.x).attr("y",e.y).html(t).style("text-anchor","middle").attr("fill","#3A3936").style("font-size","12px")},B=(t,e)=>{const a=E.append("g").attr("class","labels");for(let s=0;s<e;s++){const e=s*z,r=t[s].name,o=J(S/2*.9,e);R(r,o,!1,a)}},D=()=>{const t=(t=>{const e=[],a=h/t;for(let s=0;s<=t;s++){const t=a*s;Number.isInteger(a)?e.push(Number(t)):e.push(t.toFixed(2))}return e})(d);((t,e)=>{for(let a=1;a<=t;a++){const s=a/t*A,r=[];for(let t=0;t<e;t++){const e=t*z;r.push(J(s,e))}const o=E.append("g").style("fill","none").attr("stroke","#CCCCCC");X([...r,r[0]],o)}})(d,c),((t,e)=>{const a=E.append("g").attr("class","radar-lines"),s=J(A,0);X([P,s],a);const r=E.append("g").attr("class","ticks");t.forEach(((t,s)=>{const o=J(s/e*A,0),l=[o,Object.assign(Object.assign({},o),{x:o.x-10})];X(l,a),m&&R(t,o,!0,r)}))})(t,d),Y(c),r.forEach(((t,e)=>{H(t,c,e),B(t,c)})),setTimeout((()=>{!function(t){Y(c),t.forEach(((t,e)=>{H(t,c,e),B(t,c)}))}(s)}),i*s.length)};return p((()=>a(10,F=!0))),t.$$set=t=>{"data"in t&&a(1,l=t.data),"backgroundcolor"in t&&a(0,n=t.backgroundcolor),"delay"in t&&a(4,i=t.delay),"sides"in t&&a(5,c=t.sides),"levels"in t&&a(6,d=t.levels),"valuemax"in t&&a(7,h=t.valuemax),"scalemax"in t&&a(8,u=t.scalemax),"hasgrades"in t&&a(9,m=t.hasgrades)},t.$$.update=()=>{2&t.$$.dirty[0]&&(s=l?JSON.parse(l):[]),2&t.$$.dirty[0]&&(r=l?JSON.parse(l):[]),256&t.$$.dirty[0]&&(o=N().domain([0,u]).range([0,A])),1030&t.$$.dirty[0]&&l.length>0&&F&&(E=$(g).append("svg").attr("width",S).attr("height",S).append("g"),D())},[n,l,g,O,i,c,d,h,u,m,F,function(t){b[t?"unshift":"push"]((()=>{g=t,a(2,g)}))}]}class D extends t{constructor(t){super();const l=document.createElement("style");l.textContent="@media screen and (min-width: 680px){}@media screen and (min-width: 1024px){}@media screen and (min-width: 1280px){}@media screen and (min-width: 1920px){}.chart{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:#ffffff;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chart__tooltip{position:absolute;width:auto;height:auto;background-color:white;border:1px solid #000;border-radius:4px;min-width:152px;color:grey;padding:0.25rem 0.5rem}.chart__list{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}",this.shadowRoot.appendChild(l),e(this,{target:this.shadowRoot,props:a(this.attributes),customElement:!0},B,R,o,{data:1,backgroundcolor:0,delay:4,sides:5,levels:6,valuemax:7,scalemax:8,hasgrades:9},null,[-1,-1]),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),r()))}static get observedAttributes(){return["data","backgroundcolor","delay","sides","levels","valuemax","scalemax","hasgrades"]}get data(){return this.$$.ctx[1]}set data(t){this.$$set({data:t}),r()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),r()}get delay(){return this.$$.ctx[4]}set delay(t){this.$$set({delay:t}),r()}get sides(){return this.$$.ctx[5]}set sides(t){this.$$set({sides:t}),r()}get levels(){return this.$$.ctx[6]}set levels(t){this.$$set({levels:t}),r()}get valuemax(){return this.$$.ctx[7]}set valuemax(t){this.$$set({valuemax:t}),r()}get scalemax(){return this.$$.ctx[8]}set scalemax(t){this.$$set({scalemax:t}),r()}get hasgrades(){return this.$$.ctx[9]}set hasgrades(t){this.$$set({hasgrades:t}),r()}}export{D as default};
|
|
730
2
|
//# sourceMappingURL=Radar.js.map
|