StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
const LoadScript = {
|
|
install: function (Vue) {
|
|
Vue.loadScript = Vue.prototype.$loadScript = function (src) { // eslint-disable-line no-param-reassign
|
|
return new Promise(function (resolve, reject) {
|
|
if (document.querySelector('script[src="' + src + '"]')) {
|
|
resolve();
|
|
|
|
return;
|
|
}
|
|
|
|
const el = document.createElement('script');
|
|
|
|
el.type = 'text/javascript';
|
|
el.async = true;
|
|
el.src = src;
|
|
|
|
el.addEventListener('load', resolve);
|
|
el.addEventListener('error', reject);
|
|
el.addEventListener('abort', reject);
|
|
|
|
document.head.appendChild(el);
|
|
});
|
|
};
|
|
|
|
Vue.unloadScript = Vue.prototype.$unloadScript = function (src) { // eslint-disable-line no-param-reassign
|
|
return new Promise(function (resolve, reject) {
|
|
const el = document.querySelector('script[src="' + src + '"]');
|
|
|
|
if (!el) {
|
|
reject();
|
|
|
|
return;
|
|
}
|
|
|
|
document.head.removeChild(el);
|
|
|
|
resolve();
|
|
});
|
|
};
|
|
},
|
|
};
|
|
|
|
export default LoadScript;
|
|
|