@onetype/framework 2.0.26 → 2.0.27
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/addons/core/assets/back/functions/utils/transform.js +1 -1
- package/addons/render/directives/front/js/functions/process/data.js +0 -1
- package/addons/render/transforms/addon.js +2 -0
- package/addons/render/transforms/functions/data.js +21 -0
- package/addons/render/transforms/functions/run.js +11 -0
- package/addons/render/transforms/item/functions/load.js +55 -0
- package/addons/render/transforms/item/functions/run.js +12 -0
- package/addons/render/transforms/items/directives/transform.js +15 -18
- package/lib/items/elements/global/heading/heading.css +1 -1
- package/lib/items/elements/global/markdown/markdown.js +207 -3
- package/lib/items/elements/{sections → navigation}/navbar/navbar.css +9 -9
- package/lib/items/elements/{sections → navigation}/navbar/navbar.js +2 -2
- package/lib/items/elements/navigation/sidebar/sidebar.css +101 -0
- package/lib/items/elements/navigation/sidebar/sidebar.js +56 -0
- package/lib/items/elements/{global → navigation}/tabs/tabs.css +6 -6
- package/lib/items/elements/{global → navigation}/tabs/tabs.js +2 -2
- package/lib/items/elements/sections/pricing/pricing.css +148 -0
- package/lib/items/elements/sections/pricing/pricing.js +76 -0
- package/lib/items/transforms/accordion/accordion.js +139 -141
- package/lib/items/transforms/chart/area.js +130 -133
- package/lib/items/transforms/chart/bar.js +116 -119
- package/lib/items/transforms/chart/bubble.js +142 -145
- package/lib/items/transforms/chart/doughnut.js +104 -107
- package/lib/items/transforms/chart/line.js +127 -130
- package/lib/items/transforms/chart/pie.js +102 -105
- package/lib/items/transforms/chart/radar.js +134 -137
- package/lib/items/transforms/chart/scatter.js +127 -130
- package/lib/items/transforms/codeflask/codeflask.js +10 -12
- package/lib/items/transforms/codemirror/codemirror.js +186 -189
- package/lib/items/transforms/comparison/comparison.js +130 -133
- package/lib/items/transforms/heatmap/heatmap.js +406 -407
- package/lib/items/transforms/interact/interact.js +240 -241
- package/lib/items/transforms/particles/particles.js +282 -283
- package/lib/items/transforms/sparkline/sparkline.js +207 -208
- package/lib/items/transforms/swiper/swiper.js +115 -118
- package/lib/items/transforms/tabs/tabs.js +383 -384
- package/lib/items/transforms/typed/typed.js +146 -147
- package/lib/load.js +8 -16
- package/lib/src/mixins/addons.js +10 -10
- package/lib/styles/variables.css +1 -1
- package/package.json +1 -1
- package/addons/render/transforms/functions/load/assets.js +0 -49
- /package/{addons/render/directives/front/js/items → lib/items/directives}/100-if.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/1000-render.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/110-show.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/160-slot.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/200-for.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-blur.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-change.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-click-outside.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-click.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-double-click.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-focus.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-input.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-keydown.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-keyup.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-enter.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-leave.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-mouse-move.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-scroll.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/500-submit.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/650-fetch.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/660-form.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/700-text.js +0 -0
- /package/{addons/render/directives/front/js/items → lib/items/directives}/750-html.js +0 -0
|
@@ -1,156 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
transforms.ItemAdd({
|
|
2
|
+
id: 'ot-chart-area',
|
|
3
|
+
icon: 'area_chart',
|
|
4
|
+
name: 'Area Chart',
|
|
5
|
+
description: 'Filled area chart visualization. Show data trends with colored regions under the line.',
|
|
6
|
+
js: [
|
|
7
|
+
'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
|
|
8
|
+
],
|
|
9
|
+
config: {
|
|
10
|
+
'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
|
|
11
|
+
'datasets': ['array', []],
|
|
12
|
+
'stacked': ['boolean', false],
|
|
13
|
+
'smooth': ['boolean', true],
|
|
14
|
+
'options': ['object', {}]
|
|
15
|
+
},
|
|
16
|
+
code: function(data, node, transformer)
|
|
17
|
+
{
|
|
18
|
+
this.setup = () =>
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
node.innerHTML = '';
|
|
23
|
-
node.classList.add('ot-chart-area');
|
|
20
|
+
node.innerHTML = '';
|
|
21
|
+
node.classList.add('ot-chart-area');
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const canvas = document.createElement('canvas');
|
|
24
|
+
this.canvas = canvas;
|
|
25
|
+
node.appendChild(canvas);
|
|
26
|
+
};
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
this.colors = () =>
|
|
29
|
+
{
|
|
30
|
+
const style = getComputedStyle(document.body);
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
32
|
+
return {
|
|
33
|
+
brand: style.getPropertyValue('--ot-brand').trim(),
|
|
34
|
+
blue: style.getPropertyValue('--ot-blue').trim(),
|
|
35
|
+
green: style.getPropertyValue('--ot-green').trim(),
|
|
36
|
+
orange: style.getPropertyValue('--ot-orange').trim(),
|
|
37
|
+
red: style.getPropertyValue('--ot-red').trim(),
|
|
38
|
+
brandOpacity: style.getPropertyValue('--ot-brand-opacity').trim(),
|
|
39
|
+
blueOpacity: style.getPropertyValue('--ot-blue-opacity').trim(),
|
|
40
|
+
greenOpacity: style.getPropertyValue('--ot-green-opacity').trim(),
|
|
41
|
+
orangeOpacity: style.getPropertyValue('--ot-orange-opacity').trim(),
|
|
42
|
+
redOpacity: style.getPropertyValue('--ot-red-opacity').trim()
|
|
46
43
|
};
|
|
44
|
+
};
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if(datasets.length === 0)
|
|
57
|
-
{
|
|
58
|
-
return [{
|
|
59
|
-
label: 'Sample Data',
|
|
60
|
-
data: [30, 45, 28, 56, 42, 65],
|
|
61
|
-
backgroundColor: paletteOpacity[0],
|
|
62
|
-
borderColor: palette[0],
|
|
63
|
-
borderWidth: 2,
|
|
64
|
-
fill: true,
|
|
65
|
-
tension: smooth ? 0.4 : 0
|
|
66
|
-
}];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return datasets.map((dataset, index) =>
|
|
70
|
-
{
|
|
71
|
-
const color = palette[index % palette.length];
|
|
72
|
-
const colorOpacity = paletteOpacity[index % paletteOpacity.length];
|
|
46
|
+
this.datasets = () =>
|
|
47
|
+
{
|
|
48
|
+
const datasets = data['datasets'];
|
|
49
|
+
const colors = this.colors();
|
|
50
|
+
const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
|
|
51
|
+
const paletteOpacity = [colors.brandOpacity, colors.blueOpacity, colors.greenOpacity, colors.orangeOpacity, colors.redOpacity];
|
|
52
|
+
const smooth = data['smooth'];
|
|
73
53
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
54
|
+
if(datasets.length === 0)
|
|
55
|
+
{
|
|
56
|
+
return [{
|
|
57
|
+
label: 'Sample Data',
|
|
58
|
+
data: [30, 45, 28, 56, 42, 65],
|
|
59
|
+
backgroundColor: paletteOpacity[0],
|
|
60
|
+
borderColor: palette[0],
|
|
61
|
+
borderWidth: 2,
|
|
62
|
+
fill: true,
|
|
63
|
+
tension: smooth ? 0.4 : 0
|
|
64
|
+
}];
|
|
65
|
+
}
|
|
84
66
|
|
|
85
|
-
|
|
67
|
+
return datasets.map((dataset, index) =>
|
|
86
68
|
{
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
|
|
90
|
-
const stacked = data['stacked'].value;
|
|
69
|
+
const color = palette[index % palette.length];
|
|
70
|
+
const colorOpacity = paletteOpacity[index % paletteOpacity.length];
|
|
91
71
|
|
|
92
72
|
return {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
...dataset,
|
|
74
|
+
backgroundColor: dataset.backgroundColor || colorOpacity,
|
|
75
|
+
borderColor: dataset.borderColor || color,
|
|
76
|
+
borderWidth: dataset.borderWidth || 2,
|
|
77
|
+
fill: dataset.fill !== undefined ? dataset.fill : true,
|
|
78
|
+
tension: dataset.tension !== undefined ? dataset.tension : (smooth ? 0.4 : 0)
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
this.config = () =>
|
|
84
|
+
{
|
|
85
|
+
const style = getComputedStyle(document.body);
|
|
86
|
+
const textColor = style.getPropertyValue('--ot-text-1').trim();
|
|
87
|
+
const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
|
|
88
|
+
const stacked = data['stacked'];
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
type: 'line',
|
|
92
|
+
data: {
|
|
93
|
+
labels: data['labels'],
|
|
94
|
+
datasets: this.datasets()
|
|
95
|
+
},
|
|
96
|
+
options: {
|
|
97
|
+
responsive: true,
|
|
98
|
+
maintainAspectRatio: false,
|
|
99
|
+
interaction: {
|
|
100
|
+
intersect: false,
|
|
101
|
+
mode: 'index'
|
|
97
102
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
plugins: {
|
|
106
|
-
legend: {
|
|
107
|
-
labels: {
|
|
108
|
-
color: textColor,
|
|
109
|
-
font: {
|
|
110
|
-
family: style.getPropertyValue('--ot-font-primary').trim()
|
|
111
|
-
}
|
|
103
|
+
plugins: {
|
|
104
|
+
legend: {
|
|
105
|
+
labels: {
|
|
106
|
+
color: textColor,
|
|
107
|
+
font: {
|
|
108
|
+
family: style.getPropertyValue('--ot-font-primary').trim()
|
|
112
109
|
}
|
|
113
|
-
},
|
|
114
|
-
filler: {
|
|
115
|
-
propagate: false
|
|
116
110
|
}
|
|
117
111
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
grid: { color: gridColor },
|
|
127
|
-
beginAtZero: true
|
|
128
|
-
}
|
|
112
|
+
filler: {
|
|
113
|
+
propagate: false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
scales: {
|
|
117
|
+
x: {
|
|
118
|
+
ticks: { color: textColor },
|
|
119
|
+
grid: { color: gridColor }
|
|
129
120
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
121
|
+
y: {
|
|
122
|
+
stacked: stacked,
|
|
123
|
+
ticks: { color: textColor },
|
|
124
|
+
grid: { color: gridColor },
|
|
125
|
+
beginAtZero: true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
...data['options']
|
|
129
|
+
}
|
|
133
130
|
};
|
|
131
|
+
};
|
|
134
132
|
|
|
135
|
-
|
|
133
|
+
this.initialize = () =>
|
|
134
|
+
{
|
|
135
|
+
setTimeout(() =>
|
|
136
136
|
{
|
|
137
|
-
|
|
137
|
+
if(typeof Chart === 'undefined')
|
|
138
138
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
139
|
+
console.error('Chart.js library not loaded');
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
144
142
|
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
const context = this.canvas.getContext('2d');
|
|
144
|
+
this.instance = new Chart(context, this.config());
|
|
147
145
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
node.chart = this.instance;
|
|
147
|
+
}, 100);
|
|
148
|
+
};
|
|
151
149
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
150
|
+
this.setup();
|
|
151
|
+
this.initialize();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
@@ -1,140 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
transforms.ItemAdd({
|
|
2
|
+
id: 'ot-chart-bar',
|
|
3
|
+
icon: 'bar_chart',
|
|
4
|
+
name: 'Bar Chart',
|
|
5
|
+
description: 'Vertical or horizontal bar charts. Compare values across categories with bars.',
|
|
6
|
+
js: [
|
|
7
|
+
'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'
|
|
8
|
+
],
|
|
9
|
+
config: {
|
|
10
|
+
'labels': ['array', ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']],
|
|
11
|
+
'datasets': ['array', []],
|
|
12
|
+
'stacked': ['boolean', false],
|
|
13
|
+
'horizontal': ['boolean', false],
|
|
14
|
+
'options': ['object', {}]
|
|
15
|
+
},
|
|
16
|
+
code: function(data, node, transformer)
|
|
17
|
+
{
|
|
18
|
+
this.setup = () =>
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
node.innerHTML = '';
|
|
23
|
-
node.classList.add('ot-chart-bar');
|
|
20
|
+
node.innerHTML = '';
|
|
21
|
+
node.classList.add('ot-chart-bar');
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const canvas = document.createElement('canvas');
|
|
24
|
+
this.canvas = canvas;
|
|
25
|
+
node.appendChild(canvas);
|
|
26
|
+
};
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
this.colors = () =>
|
|
29
|
+
{
|
|
30
|
+
const style = getComputedStyle(document.body);
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
32
|
+
return {
|
|
33
|
+
brand: style.getPropertyValue('--ot-brand').trim(),
|
|
34
|
+
blue: style.getPropertyValue('--ot-blue').trim(),
|
|
35
|
+
green: style.getPropertyValue('--ot-green').trim(),
|
|
36
|
+
orange: style.getPropertyValue('--ot-orange').trim(),
|
|
37
|
+
red: style.getPropertyValue('--ot-red').trim()
|
|
41
38
|
};
|
|
39
|
+
};
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if(datasets.length === 0)
|
|
50
|
-
{
|
|
51
|
-
return [{
|
|
52
|
-
label: 'Sample Data',
|
|
53
|
-
data: [42, 56, 28, 84, 65, 39],
|
|
54
|
-
backgroundColor: palette[0],
|
|
55
|
-
borderColor: palette[0],
|
|
56
|
-
borderWidth: 0
|
|
57
|
-
}];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return datasets.map((dataset, index) =>
|
|
61
|
-
{
|
|
62
|
-
const color = palette[index % palette.length];
|
|
41
|
+
this.datasets = () =>
|
|
42
|
+
{
|
|
43
|
+
const datasets = data['datasets'];
|
|
44
|
+
const colors = this.colors();
|
|
45
|
+
const palette = [colors.brand, colors.blue, colors.green, colors.orange, colors.red];
|
|
63
46
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
if(datasets.length === 0)
|
|
48
|
+
{
|
|
49
|
+
return [{
|
|
50
|
+
label: 'Sample Data',
|
|
51
|
+
data: [42, 56, 28, 84, 65, 39],
|
|
52
|
+
backgroundColor: palette[0],
|
|
53
|
+
borderColor: palette[0],
|
|
54
|
+
borderWidth: 0
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
72
57
|
|
|
73
|
-
|
|
58
|
+
return datasets.map((dataset, index) =>
|
|
74
59
|
{
|
|
75
|
-
const
|
|
76
|
-
const textColor = style.getPropertyValue('--ot-text-1').trim();
|
|
77
|
-
const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
|
|
78
|
-
const stacked = data['stacked'].value;
|
|
79
|
-
const horizontal = data['horizontal'].value;
|
|
60
|
+
const color = palette[index % palette.length];
|
|
80
61
|
|
|
81
62
|
return {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
63
|
+
...dataset,
|
|
64
|
+
backgroundColor: dataset.backgroundColor || color,
|
|
65
|
+
borderColor: dataset.borderColor || color,
|
|
66
|
+
borderWidth: dataset.borderWidth || 0
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
this.config = () =>
|
|
72
|
+
{
|
|
73
|
+
const style = getComputedStyle(document.body);
|
|
74
|
+
const textColor = style.getPropertyValue('--ot-text-1').trim();
|
|
75
|
+
const gridColor = style.getPropertyValue('--ot-bg-3-border').trim();
|
|
76
|
+
const stacked = data['stacked'];
|
|
77
|
+
const horizontal = data['horizontal'];
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
type: horizontal ? 'bar' : 'bar',
|
|
81
|
+
data: {
|
|
82
|
+
labels: data['labels'],
|
|
83
|
+
datasets: this.datasets()
|
|
84
|
+
},
|
|
85
|
+
options: {
|
|
86
|
+
indexAxis: horizontal ? 'y' : 'x',
|
|
87
|
+
responsive: true,
|
|
88
|
+
maintainAspectRatio: false,
|
|
89
|
+
plugins: {
|
|
90
|
+
legend: {
|
|
91
|
+
labels: {
|
|
92
|
+
color: textColor,
|
|
93
|
+
font: {
|
|
94
|
+
family: style.getPropertyValue('--ot-font-primary').trim()
|
|
98
95
|
}
|
|
99
96
|
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
scales: {
|
|
100
|
+
x: {
|
|
101
|
+
stacked: stacked,
|
|
102
|
+
ticks: { color: textColor },
|
|
103
|
+
grid: { color: gridColor }
|
|
100
104
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
grid: { color: gridColor },
|
|
111
|
-
beginAtZero: true
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
...data['options'].value
|
|
115
|
-
}
|
|
116
|
-
};
|
|
105
|
+
y: {
|
|
106
|
+
stacked: stacked,
|
|
107
|
+
ticks: { color: textColor },
|
|
108
|
+
grid: { color: gridColor },
|
|
109
|
+
beginAtZero: true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
...data['options']
|
|
113
|
+
}
|
|
117
114
|
};
|
|
115
|
+
};
|
|
118
116
|
|
|
119
|
-
|
|
117
|
+
this.initialize = () =>
|
|
118
|
+
{
|
|
119
|
+
setTimeout(() =>
|
|
120
120
|
{
|
|
121
|
-
|
|
121
|
+
if(typeof Chart === 'undefined')
|
|
122
122
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
123
|
+
console.error('Chart.js library not loaded');
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
128
126
|
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
const context = this.canvas.getContext('2d');
|
|
128
|
+
this.instance = new Chart(context, this.config());
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
node.chart = this.instance;
|
|
131
|
+
}, 100);
|
|
132
|
+
};
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
});
|
|
134
|
+
this.setup();
|
|
135
|
+
this.initialize();
|
|
136
|
+
}
|
|
137
|
+
});
|