Skip to content

Commit 219b4ef

Browse files
committed
chore: 依赖 utility 脚本
1 parent 073d801 commit 219b4ef

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

src/components/BootstrapBlazor.Chart/Components/Chart/Chart.razor.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import '../../js/chart.umd.js'
22
import '../../js/chartjs-plugin-datalabels.js'
3+
import { deepMerge } from '../../../BootstrapBlazor/modules/utility.js'
34
import Data from '../../../BootstrapBlazor/modules/data.js'
45
import EventHandler from "../../../BootstrapBlazor/modules/event-handler.js"
56

67
Chart.register(ChartDataLabels);
78

8-
// WIP: wait net9 release
9-
// later will move into bootstrapblazor for global init make sure window.BootstrapBlazor is defined
10-
if (window.BootstrapBlazor === void 0) {
11-
window.BootstrapBlazor = {};
12-
}
13-
149
if (window.BootstrapBlazor.Chart === void 0) {
1510
const elementMap = new Map();
1611
window.BootstrapBlazor.Chart = new class {
@@ -99,20 +94,6 @@ const genericOptions = {
9994
radius: 0
10095
}
10196

102-
const deepMerge = (obj1, obj2) => {
103-
for (let key in obj2) {
104-
if (obj2.hasOwnProperty(key)) {
105-
if (obj2[key] instanceof Object && obj1[key] instanceof Object) {
106-
obj1[key] = deepMerge(obj1[key], obj2[key]);
107-
}
108-
else {
109-
obj1[key] = obj2[key];
110-
}
111-
}
112-
}
113-
return obj1;
114-
}
115-
11697
const getChartOption = function (option) {
11798
const appendData = option.appendData;
11899
delete option.appendData;

0 commit comments

Comments
 (0)