Skip to content

Commit 47a0727

Browse files
committed
0 parents  commit 47a0727

File tree

697 files changed

+250272
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

697 files changed

+250272
-0
lines changed

.nojekyll

Whitespace-only changes.

.spa

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This file is used to enable gitee pages' spa mode.
2+
https://gitee.com/help/articles/4237

404.html

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Single Page Apps for GitHub Pages</title>
6+
<script type="text/javascript">
7+
// Single Page Apps for GitHub Pages
8+
// https://github.com/rafrex/spa-github-pages
9+
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
10+
// ----------------------------------------------------------------------
11+
// This script takes the current url and converts the path and query
12+
// string into just a query string, and then redirects the browser
13+
// to the new url with only a query string and hash fragment,
14+
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
15+
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
16+
// Note: this 404.html file must be at least 512 bytes for it to work
17+
// with Internet Explorer (it is currently > 512 bytes)
18+
19+
// If you're creating a Project Pages site and NOT using a custom domain,
20+
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
21+
// This way the code will only replace the route part of the path, and not
22+
// the real directory in which the app resides, for example:
23+
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
24+
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
25+
// Otherwise, leave segmentCount as 0.
26+
var segmentCount = 0;
27+
28+
var l = window.location;
29+
l.replace(
30+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
31+
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
32+
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
33+
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
34+
l.hash
35+
);
36+
</script>
37+
</head>
38+
<body>
39+
</body>
40+
</html>

CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
antblazor.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// This file is to show how a library package may provide JavaScript interop features
2+
// wrapped in a .NET API
3+
4+
window.AntDesignCharts = {
5+
interop: {
6+
create: (type, domRef, domId, config, others) => {
7+
domRef.innerHTML = '';
8+
9+
removeNullItem(config);
10+
deepObjectMerge(config, others);
11+
try {
12+
const plot = new G2Plot[type](domRef, config);
13+
plot.render();
14+
window.AntDesignCharts.chartsContainer[domId] = plot;
15+
//console.log("create:" + domId)
16+
} catch (err) {
17+
console.error(err, config);
18+
}
19+
},
20+
destroy(domId) {
21+
//console.log("destroy:" + domId);
22+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
23+
window.AntDesignCharts.chartsContainer[domId].destroy();
24+
delete window.AntDesignCharts.chartsContainer[domId];
25+
},
26+
render(domId) {
27+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
28+
window.AntDesignCharts.chartsContainer[domId].render();
29+
},
30+
repaint(domId) {
31+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
32+
window.AntDesignCharts.chartsContainer[domId].repaint();
33+
},
34+
updateConfig(domId, config, others, all) {
35+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
36+
removeNullItem(config)
37+
deepObjectMerge(config, others)
38+
window.AntDesignCharts.chartsContainer[domId].updateConfig(config, all);
39+
window.AntDesignCharts.chartsContainer[domId].render();
40+
},
41+
changeData(domId, data, all) {
42+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
43+
window.AntDesignCharts.chartsContainer[domId].changeData(data, all);
44+
},
45+
setActive(domId, condition, style) {
46+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
47+
window.AntDesignCharts.chartsContainer[domId].setActive(condition, style);
48+
},
49+
setSelected(domId, condition, style) {
50+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
51+
window.AntDesignCharts.chartsContainer[domId].setSelected(condition, style);
52+
},
53+
setDisable(domId, condition, style) {
54+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
55+
window.AntDesignCharts.chartsContainer[domId].setDisable(condition, style);
56+
},
57+
setDefault(domId, condition, style) {
58+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
59+
window.AntDesignCharts.chartsContainer[domId].setDefault(condition, style);
60+
},
61+
62+
setEvent(domId, event, dotnetHelper, func) {
63+
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return;
64+
65+
console.log("setEvent");
66+
window.AntDesignCharts.chartsContainer[domId].on(event, ev => {
67+
let e = {};
68+
for (let attr in ev) {
69+
if (typeof ev[attr] !== "function" && typeof ev[attr] !== "object") {
70+
e[attr] = ev[attr];
71+
}
72+
}
73+
dotnetHelper.invokeMethodAsync(func, e);
74+
})
75+
}
76+
},
77+
chartsContainer: {}
78+
}
79+
80+
81+
//清除没有赋值的项
82+
function isEmptyObj(o) {
83+
for (let attr in o) return !1;
84+
return !0
85+
}
86+
87+
function processArray(arr) {
88+
for (let i = arr.length - 1; i >= 0; i--) {
89+
if (arr[i] === null || arr[i] === undefined) arr.splice(i, 1);
90+
else if (typeof arr[i] == 'object') removeNullItem(arr[i], arr, i);
91+
}
92+
return arr.length == 0
93+
}
94+
95+
function proccessObject(o) {
96+
for (let attr in o) {
97+
if (o[attr] === null || o[attr] === undefined) delete o[attr];
98+
else if (typeof o[attr] == 'object') {
99+
removeNullItem(o[attr]);
100+
if (isEmptyObj(o[attr])) delete o[attr];
101+
}
102+
}
103+
}
104+
105+
function removeNullItem(o, arr, i) {
106+
let s = ({}).toString.call(o);
107+
if (s == '[object Array]') {
108+
if (processArray(o) === true) { //o也是数组,并且删除完子项,从所属数组中删除
109+
if (arr) arr.splice(i, 1);
110+
}
111+
} else if (s == '[object Object]') {
112+
proccessObject(o);
113+
if (arr && isEmptyObj(o)) arr.splice(i, 1);
114+
}
115+
}
116+
117+
// 深度合并对象
118+
function deepObjectMerge(source, target) {
119+
for (var key in target) {
120+
if (source[key] && source[key].toString() === "[object Object]") {
121+
deepObjectMerge(source[key], target[key])
122+
} else {
123+
source[key] = target[key]
124+
}
125+
}
126+
return source;
127+
}

_content/AntDesign.Charts/g2plot.js

+37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)