fluency-v8-components 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +99 -99
- package/dist/{index-q2NbjdVo.mjs → index-BBxccHNP.mjs} +7 -6
- package/dist/{index.es-PAPL4E6Y.mjs → index.es-D_XhLSeH.mjs} +1 -1
- package/package.json +3 -2
- package/src/assets/images/ai.svg +1 -0
- package/src/assets/images/github-dark.svg +1 -0
- package/src/assets/images/github.svg +1 -0
- package/src/assets/images/high-priority.svg +1 -0
- package/src/assets/images/power-off.svg +1 -0
- package/src/assets/images/save.svg +1 -0
- package/src/assets/index.ts +15 -0
- package/src/assets/main.css +505 -0
- package/src/assets/prism-theme.css +290 -0
- package/src/components/buttons/ActionButtons.vue +374 -0
- package/src/components/buttons/DropdownButton.vue +104 -0
- package/src/components/buttons/IconButton.vue +63 -0
- package/src/components/buttons/ImageButton.vue +16 -0
- package/src/components/buttons/MenuButton.vue +138 -0
- package/src/components/buttons/SubmitButtons.vue +51 -0
- package/src/components/buttons/TextButton.vue +40 -0
- package/src/components/charts/AlertChart.vue +376 -0
- package/src/components/charts/BarChart.vue +212 -0
- package/src/components/charts/BarChartHorizontal.vue +243 -0
- package/src/components/charts/CronChart.vue +146 -0
- package/src/components/charts/EmptyChart.vue +76 -0
- package/src/components/charts/GradientChart.vue +310 -0
- package/src/components/charts/LineChart.test.js +59 -0
- package/src/components/charts/LineChart.vue +434 -0
- package/src/components/charts/PieChart.vue +293 -0
- package/src/components/charts/ProgressChart.vue +106 -0
- package/src/components/charts/StackedChart.vue +364 -0
- package/src/components/charts/StackedChartClustered.vue +395 -0
- package/src/components/charts/TimelineChart.vue +215 -0
- package/src/components/charts/WorkflowChart.vue +520 -0
- package/src/components/common/AutoCompleteSearchBar.vue +100 -0
- package/src/components/common/AutoRefreshButton.vue +53 -0
- package/src/components/common/Breadcrumb.vue +45 -0
- package/src/components/common/ButtonToggle.vue +24 -0
- package/src/components/common/Card.vue +116 -0
- package/src/components/common/Carousel.vue +66 -0
- package/src/components/common/CategoryCard.vue +28 -0
- package/src/components/common/CodeEditor.vue +59 -0
- package/src/components/common/DatePicker.vue +21 -0
- package/src/components/common/DatePickerInput.vue +109 -0
- package/src/components/common/Dialog.vue +103 -0
- package/src/components/common/EditorHeading.vue +10 -0
- package/src/components/common/EventList.vue +41 -0
- package/src/components/common/Facet.vue +206 -0
- package/src/components/common/Feed.vue +58 -0
- package/src/components/common/Flag.vue +27 -0
- package/src/components/common/HomeCard.vue +20 -0
- package/src/components/common/ItemBox.vue +49 -0
- package/src/components/common/Loading.vue +19 -0
- package/src/components/common/LoadingDots.vue +12 -0
- package/src/components/common/PageHeading.vue +30 -0
- package/src/components/common/Pagination.vue +105 -0
- package/src/components/common/Popover.vue +24 -0
- package/src/components/common/PowerToggle.vue +130 -0
- package/src/components/common/ProgressBar.vue +33 -0
- package/src/components/common/RadioButtons.vue +52 -0
- package/src/components/common/Schedule.vue +79 -0
- package/src/components/common/SearchBar.vue +30 -0
- package/src/components/common/Separator.vue +3 -0
- package/src/components/common/Slideout.vue +95 -0
- package/src/components/common/Sort.vue +83 -0
- package/src/components/common/Table.vue +48 -0
- package/src/components/common/Tabs.vue +129 -0
- package/src/components/common/Tag.vue +53 -0
- package/src/components/common/Tooltip.vue +49 -0
- package/src/components/common/VerticalTabs.vue +34 -0
- package/src/components/common/card/CardItem.vue +27 -0
- package/src/components/common/card/CardItemGroup.vue +45 -0
- package/src/components/common/facet/Leaf.vue +97 -0
- package/src/components/common/facet/TriState.vue +37 -0
- package/src/components/common/table/TableData.vue +48 -0
- package/src/components/common/table/TableHeader.vue +21 -0
- package/src/components/dialogs/ChooseValueDialog.vue +97 -0
- package/src/components/dialogs/ConfirmDialog.vue +73 -0
- package/src/components/dialogs/CopyDialog.vue +51 -0
- package/src/components/dialogs/DownloadDialog.vue +48 -0
- package/src/components/dialogs/NameDescDialog.vue +74 -0
- package/src/components/dialogs/NameDialog.vue +56 -0
- package/src/components/dialogs/PopupEditor.vue +113 -0
- package/src/components/dialogs/ProgressDialog.vue +58 -0
- package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
- package/src/components/dialogs/Wizard.vue +99 -0
- package/src/components/dialogs/wizard/Stepper.vue +31 -0
- package/src/components/form/CheckBox.vue +26 -0
- package/src/components/form/Editor.vue +93 -0
- package/src/components/form/FormCol.vue +19 -0
- package/src/components/form/FormRow.vue +19 -0
- package/src/components/form/FormSection.vue +21 -0
- package/src/components/form/GreyForm.vue +7 -0
- package/src/components/form/GreyInput.vue +51 -0
- package/src/components/form/GreyInputAutocomplete.vue +100 -0
- package/src/components/form/GreyInputCopy.vue +66 -0
- package/src/components/form/GreyInputGrow.vue +42 -0
- package/src/components/form/GreyInputToken.vue +78 -0
- package/src/components/form/GreyPassword.vue +36 -0
- package/src/components/form/GreySelect.vue +154 -0
- package/src/components/form/GreySelectInput.vue +123 -0
- package/src/components/form/GreySelectInputMultiple.vue +218 -0
- package/src/components/form/GreyTel.vue +58 -0
- package/src/components/form/HamburgerItem.vue +95 -0
- package/src/components/form/KeyValueEntry.vue +74 -0
- package/src/components/form/RadioInput.vue +38 -0
- package/src/components/form/UploadFile.vue +99 -0
- package/src/components/icons/AiIcon.vue +6 -0
- package/src/components/icons/GithubIcon.vue +18 -0
- package/src/components/icons/HighPriorityIcon.vue +6 -0
- package/src/components/icons/PowerOffIcon.vue +6 -0
- package/src/components/icons/SaveIcon.vue +6 -0
- package/src/components/index.js +134 -0
- package/src/components/menu/DialogMenu.vue +142 -0
- package/src/components/menu/GrandChild.vue +39 -0
- package/src/components/menu/GridMenu.vue +88 -0
- package/src/components/menu/MenuAvatar.vue +66 -0
- package/src/components/menu/MenuDesktop.vue +90 -0
- package/src/components/notifications/Notify.vue +123 -0
- package/src/components/notifications/NotifyList.vue +130 -0
- package/src/components/page-structure/FacetPage.vue +77 -0
- package/src/components/query/Child.vue +63 -0
- package/src/components/query/LVDBQuery.vue +38 -0
- package/src/components/status/Active.vue +44 -0
- package/src/components/status/ScoreLevel.vue +43 -0
- package/src/components/status/Status.vue +51 -0
- package/src/components/status/TaskDot.vue +25 -0
- package/src/components/status/TaskStatus.vue +26 -0
- package/src/components/status/TicketStatus.vue +201 -0
- package/src/components/status/Trend.vue +20 -0
- package/src/components/tables/ArgumentRunTable.vue +96 -0
- package/src/components/tables/ArgumentTable.vue +67 -0
- package/src/components/tables/CloudFormationParameters.vue +25 -0
- package/src/constants/colors.js +248 -0
- package/src/constants/font-map.js +128 -0
- package/src/constants/fpl2.js +162 -0
- package/src/constants/icon-svg.js +405 -0
- package/src/constants/schedule.js +52 -0
- package/src/fpl/AddPanel.vue +237 -0
- package/src/fpl/Configs/Alert.vue +16 -0
- package/src/fpl/Configs/AlertSprite.vue +2 -0
- package/src/fpl/Configs/Chart.vue +63 -0
- package/src/fpl/Configs/Config.js +154 -0
- package/src/fpl/Configs/Counter.vue +35 -0
- package/src/fpl/Configs/Histogram.vue +70 -0
- package/src/fpl/Configs/IPMap.vue +37 -0
- package/src/fpl/Configs/Image.vue +163 -0
- package/src/fpl/Configs/MetricChart.vue +20 -0
- package/src/fpl/Configs/PieChart.vue +37 -0
- package/src/fpl/Configs/SparkChart.vue +41 -0
- package/src/fpl/Configs/StackedBarChart.vue +49 -0
- package/src/fpl/Configs/Table.vue +211 -0
- package/src/fpl/Configs/Text.vue +14 -0
- package/src/fpl/Configs/TopNChart.vue +37 -0
- package/src/fpl/Outputs/FPLAlert.vue +64 -0
- package/src/fpl/Outputs/FPLStream.vue +41 -0
- package/src/fpl/Outputs/FPLTable.vue +77 -0
- package/src/fpl/Panel.vue +202 -0
- package/src/fpl/Panels/Alert.vue +85 -0
- package/src/fpl/Panels/AlertSprite.vue +9 -0
- package/src/fpl/Panels/Chart.vue +98 -0
- package/src/fpl/Panels/Counter.vue +43 -0
- package/src/fpl/Panels/Histogram.vue +138 -0
- package/src/fpl/Panels/IPMap.vue +48 -0
- package/src/fpl/Panels/Image.vue +35 -0
- package/src/fpl/Panels/MetricChart.vue +97 -0
- package/src/fpl/Panels/PieChart.vue +54 -0
- package/src/fpl/Panels/SparkChart.vue +166 -0
- package/src/fpl/Panels/StackedBarChart.vue +74 -0
- package/src/fpl/Panels/Table.vue +103 -0
- package/src/fpl/Panels/Text.vue +24 -0
- package/src/fpl/Panels/TopNChart.vue +69 -0
- package/src/fpl/index.js +39 -0
- package/src/utils/download.js +220 -0
- package/src/utils/formatOutput.js +156 -0
- package/src/utils/random.js +32 -0
- package/src/utils/timeUtils.js +138 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :id="id">
|
|
3
|
+
<div :id="id + 'tooltip'" role="tooltip" class="tooltip"></div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import * as d3 from "d3";
|
|
8
|
+
import { colors } from "@/constants/colors";
|
|
9
|
+
import { humanCount, dataCount } from "@/utils/formatOutput";
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
props: {
|
|
13
|
+
id: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
data: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
change: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "neutral",
|
|
24
|
+
},
|
|
25
|
+
unit: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "Count",
|
|
28
|
+
},
|
|
29
|
+
width: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 350,
|
|
32
|
+
},
|
|
33
|
+
height: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 200,
|
|
36
|
+
},
|
|
37
|
+
hideAxis: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
hideTooltip: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
resizable: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
tooltipOffset: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "layer",
|
|
52
|
+
},
|
|
53
|
+
valueName: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "Value",
|
|
56
|
+
},
|
|
57
|
+
theme: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "light",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
svg: null,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
watch: {
|
|
68
|
+
data: {
|
|
69
|
+
handler() {
|
|
70
|
+
this.createChart(this.data);
|
|
71
|
+
},
|
|
72
|
+
deep: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
mounted() {
|
|
76
|
+
this.initializeChart();
|
|
77
|
+
this.createChart(this.data);
|
|
78
|
+
},
|
|
79
|
+
methods: {
|
|
80
|
+
initializeChart() {
|
|
81
|
+
if (this.resizable) {
|
|
82
|
+
this.svg = d3
|
|
83
|
+
.select("#" + this.id)
|
|
84
|
+
.append("svg")
|
|
85
|
+
.attr("viewBox", `0 0 ${this.width} ${this.height}`);
|
|
86
|
+
} else {
|
|
87
|
+
this.svg = d3
|
|
88
|
+
.select("#" + this.id)
|
|
89
|
+
.append("svg")
|
|
90
|
+
.attr("width", this.width)
|
|
91
|
+
.attr("height", this.height);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// determine gradient color
|
|
95
|
+
const color = this.data.color
|
|
96
|
+
? this.data.color
|
|
97
|
+
: colors[this.theme][this.change];
|
|
98
|
+
|
|
99
|
+
// set the gradient fill
|
|
100
|
+
const gradientFill = this.svg
|
|
101
|
+
.append("defs")
|
|
102
|
+
.append("linearGradient")
|
|
103
|
+
.attr("id", "gradientFill" + this.id)
|
|
104
|
+
.attr("x1", "0%")
|
|
105
|
+
.attr("x2", "0%")
|
|
106
|
+
.attr("y1", "100%")
|
|
107
|
+
.attr("y2", "0%");
|
|
108
|
+
gradientFill
|
|
109
|
+
.append("stop")
|
|
110
|
+
.attr("offset", "0%")
|
|
111
|
+
.style("stop-color", colors[this.theme]["canvas"])
|
|
112
|
+
.style("stop-opacity", 0.5);
|
|
113
|
+
gradientFill
|
|
114
|
+
.append("stop")
|
|
115
|
+
.attr("offset", "100%")
|
|
116
|
+
.style("stop-color", color)
|
|
117
|
+
.style("stop-opacity", 1);
|
|
118
|
+
},
|
|
119
|
+
createChart(data) {
|
|
120
|
+
// Declare the chart dimensions and margins.
|
|
121
|
+
const width = this.width;
|
|
122
|
+
const height = this.height;
|
|
123
|
+
const marginTop = this.hideAxis ? 2 : 20;
|
|
124
|
+
const marginRight = this.hideAxis ? 2 : 15;
|
|
125
|
+
const marginBottom = this.hideAxis ? 2 : 30;
|
|
126
|
+
const marginLeft = this.hideAxis ? 2 : 50;
|
|
127
|
+
|
|
128
|
+
// constant sizes
|
|
129
|
+
const pointSize = width > 300 ? 3 : 2;
|
|
130
|
+
const enlargedPointSize = width > 300 ? 5 : 3;
|
|
131
|
+
const color = data.color ? data.color : colors[this.theme][this.change];
|
|
132
|
+
|
|
133
|
+
// get the longest slots array and largest value
|
|
134
|
+
let largestValue = this.unit === "Percent (%)" ? 100 : 0;
|
|
135
|
+
data.values.forEach((d) => {
|
|
136
|
+
if (d > largestValue) {
|
|
137
|
+
largestValue = d;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Declare the x (horizontal position) scale.
|
|
142
|
+
const x = d3.scaleUtc(d3.extent(data.slots), [
|
|
143
|
+
marginLeft,
|
|
144
|
+
width - marginRight,
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
// Declare the y (vertical position) scale.
|
|
148
|
+
const y = d3.scaleLinear(
|
|
149
|
+
[0, largestValue],
|
|
150
|
+
[height - marginBottom, marginTop]
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
// Declare the tooltip mouseover functions
|
|
154
|
+
const mouseover = (event, d) => {
|
|
155
|
+
const slot = new Date(d.slots).toUTCString();
|
|
156
|
+
const value =
|
|
157
|
+
this.unit === "Bytes (B)"
|
|
158
|
+
? dataCount(d.values) + "B"
|
|
159
|
+
: this.unit === "Percent (%)"
|
|
160
|
+
? d.values.toFixed(2) + "%"
|
|
161
|
+
: humanCount(d.values);
|
|
162
|
+
event.target.r.baseVal.value = enlargedPointSize;
|
|
163
|
+
d3.select("#" + this.id + "tooltip")
|
|
164
|
+
.html(`Time: ${slot}<br>${this.valueName}: ${value}`)
|
|
165
|
+
.style("opacity", 1)
|
|
166
|
+
.style("left", event[this.tooltipOffset + "X"] + 15 + "px")
|
|
167
|
+
.style("top", event[this.tooltipOffset + "Y"] + "px");
|
|
168
|
+
};
|
|
169
|
+
const mouseout = (event, d) => {
|
|
170
|
+
event.target.r.baseVal.value = pointSize;
|
|
171
|
+
d3.select("#" + this.id + "tooltip")
|
|
172
|
+
.style("opacity", 0)
|
|
173
|
+
.style("left", "0px")
|
|
174
|
+
.style("top", "0px");
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// Declare the line generator.
|
|
178
|
+
const line = d3
|
|
179
|
+
.line()
|
|
180
|
+
.x((d, i) => {
|
|
181
|
+
return x(d.slots);
|
|
182
|
+
})
|
|
183
|
+
.y((d, i) => {
|
|
184
|
+
return y(d.values);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const area = d3
|
|
188
|
+
.area()
|
|
189
|
+
.x((d, i) => {
|
|
190
|
+
return x(d.slots);
|
|
191
|
+
})
|
|
192
|
+
.y0(height - marginBottom)
|
|
193
|
+
.y1((d, i) => {
|
|
194
|
+
return y(d.values);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
const svg = this.svg;
|
|
198
|
+
const handle = this;
|
|
199
|
+
svg
|
|
200
|
+
.selectAll("g")
|
|
201
|
+
.data([data])
|
|
202
|
+
.join(
|
|
203
|
+
(enter) => enterChart(enter),
|
|
204
|
+
(update) => enterChart(update),
|
|
205
|
+
(exit) => exitChart(exit)
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
function enterChart(enter) {
|
|
209
|
+
enter
|
|
210
|
+
.append("g")
|
|
211
|
+
.call((g) => {
|
|
212
|
+
g.append("g").call((g) => {
|
|
213
|
+
// add x-axis
|
|
214
|
+
g.append("g")
|
|
215
|
+
.attr("id", handle.id + "xaxis")
|
|
216
|
+
.attr("transform", `translate(0,${height - marginBottom})`)
|
|
217
|
+
.call(
|
|
218
|
+
d3
|
|
219
|
+
.axisBottom(x)
|
|
220
|
+
.ticks(handle.hideAxis ? 0 : width / 80)
|
|
221
|
+
.tickSizeOuter(0)
|
|
222
|
+
);
|
|
223
|
+
// add y-axis
|
|
224
|
+
g.append("g")
|
|
225
|
+
.attr("id", handle.id + "yaxis")
|
|
226
|
+
.attr("transform", `translate(${marginLeft},0)`)
|
|
227
|
+
.call(
|
|
228
|
+
d3
|
|
229
|
+
.axisLeft(y)
|
|
230
|
+
.ticks(handle.hideAxis ? 0 : height / 40)
|
|
231
|
+
.tickFormat((d) => {
|
|
232
|
+
return handle.unit === "Bytes (B)"
|
|
233
|
+
? dataCount(d)
|
|
234
|
+
: humanCount(d);
|
|
235
|
+
})
|
|
236
|
+
)
|
|
237
|
+
.call((g) =>
|
|
238
|
+
handle.hideAxis
|
|
239
|
+
? g.select(".domain").attr("stroke-width", 0.5)
|
|
240
|
+
: g.select(".domain").remove()
|
|
241
|
+
)
|
|
242
|
+
.call((g) =>
|
|
243
|
+
g
|
|
244
|
+
.selectAll(".tick line")
|
|
245
|
+
.clone()
|
|
246
|
+
.attr("x2", width - marginLeft - marginRight)
|
|
247
|
+
.attr("stroke-opacity", 0.1)
|
|
248
|
+
)
|
|
249
|
+
.call((g) =>
|
|
250
|
+
g
|
|
251
|
+
.append("text")
|
|
252
|
+
.attr("x", -marginLeft)
|
|
253
|
+
.attr("y", 10)
|
|
254
|
+
.attr("fill", "currentColor")
|
|
255
|
+
.attr("text-anchor", "start")
|
|
256
|
+
.text(handle.hideAxis ? "" : handle.unit)
|
|
257
|
+
);
|
|
258
|
+
});
|
|
259
|
+
})
|
|
260
|
+
.call((g) => {
|
|
261
|
+
// add the line
|
|
262
|
+
g.append("g").call((g) => {
|
|
263
|
+
g.append("path")
|
|
264
|
+
.attr("class", (d) => handle.id + "line")
|
|
265
|
+
.attr("z-index", 1)
|
|
266
|
+
.attr("stroke", color)
|
|
267
|
+
.attr("stroke-width", 1.5)
|
|
268
|
+
.attr("d", function (d) {
|
|
269
|
+
const series = d.slots.map((slot, i) => {
|
|
270
|
+
return { slots: slot, values: data.values[i] };
|
|
271
|
+
});
|
|
272
|
+
return line(series);
|
|
273
|
+
})
|
|
274
|
+
.attr("class", "area")
|
|
275
|
+
.attr("d", function (d) {
|
|
276
|
+
const series = d.slots.map((slot, i) => {
|
|
277
|
+
return { slots: slot, values: data.values[i] };
|
|
278
|
+
});
|
|
279
|
+
return area(series);
|
|
280
|
+
})
|
|
281
|
+
.attr("fill", "url(#gradientFill" + handle.id + ")");
|
|
282
|
+
// add the points
|
|
283
|
+
if (!handle.hideTooltip) {
|
|
284
|
+
const series = handle.data.slots.map((slot, i) => {
|
|
285
|
+
return { slots: slot, values: handle.data.values[i] };
|
|
286
|
+
});
|
|
287
|
+
g.append("g").call((g) =>
|
|
288
|
+
series.forEach((dat) => {
|
|
289
|
+
g.append("circle")
|
|
290
|
+
.attr("class", (d) => handle.id + "points")
|
|
291
|
+
.attr("stroke", color)
|
|
292
|
+
.attr("r", pointSize)
|
|
293
|
+
.attr("cx", (d) => x(dat.slots))
|
|
294
|
+
.attr("cy", (d) => y(dat.values))
|
|
295
|
+
.on("mouseover", (event) => mouseover(event, dat))
|
|
296
|
+
.on("mouseout", (event) => mouseout(event, dat));
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function exitChart(exit) {
|
|
305
|
+
exit.call((g) => g.style("opacity", 0).remove());
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import LineChart from "./LineChart.vue";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function setup() {
|
|
7
|
+
return mount(LineChart, {
|
|
8
|
+
props: {
|
|
9
|
+
id: "SystemCPU",
|
|
10
|
+
data: [
|
|
11
|
+
{
|
|
12
|
+
pool: "asghec",
|
|
13
|
+
instance: "asghec_69",
|
|
14
|
+
name: "SystemCPU",
|
|
15
|
+
unit: "Percent",
|
|
16
|
+
slots: [
|
|
17
|
+
1727726460000, 1727730060000, 1727733660000, 1727737260000,
|
|
18
|
+
1727740860000, 1727744460000, 1727748060000, 1727751660000,
|
|
19
|
+
1727755260000, 1727758860000, 1727762460000, 1727766060000,
|
|
20
|
+
1727769660000, 1727773260000, 1727776860000, 1727780460000,
|
|
21
|
+
1727784060000, 1727787660000, 1727791260000, 1727794860000,
|
|
22
|
+
1727798460000, 1727802060000, 1727805660000, 1727809260000,
|
|
23
|
+
1727812860000,
|
|
24
|
+
],
|
|
25
|
+
values: [
|
|
26
|
+
0.4609135726073291, 0.46387690727001674, 0.4396994732378043,
|
|
27
|
+
0.4323871989693043, 0.41986672515070844, 0.43824043469520263,
|
|
28
|
+
0.41920535822274174, 0.4008273634894002, 0.4430878622827318,
|
|
29
|
+
0.4372730820277241, 0.43317372803133747, 0.3873811847060125,
|
|
30
|
+
0.42702333342512083, 0.42665168084388333, 0.4149052751704168,
|
|
31
|
+
0.4440249469874862, 0.4248958219144292, 0.42897200685068754,
|
|
32
|
+
0.41062538904069157, 0.44647002886044995, 0.40325322202094177,
|
|
33
|
+
0.4156716054225666, 0.4447364776078542, 0.5106685417976082,
|
|
34
|
+
0.4646321581445835,
|
|
35
|
+
],
|
|
36
|
+
action: "Node_69",
|
|
37
|
+
index: 0,
|
|
38
|
+
total: 10.838463378777034,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
unit: "Percent (%)",
|
|
42
|
+
width: 325,
|
|
43
|
+
height: 175,
|
|
44
|
+
hideZeros: true,
|
|
45
|
+
isTime: true,
|
|
46
|
+
tooltipOffset: "layer",
|
|
47
|
+
slotName: "Field",
|
|
48
|
+
valueName: "Value",
|
|
49
|
+
useLegend: false,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
describe("LineChart", () => {
|
|
55
|
+
it("renders", () => {
|
|
56
|
+
const wrapper = setup();
|
|
57
|
+
expect(wrapper.exists()).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
});
|