bytev-charts
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
37 lines (33 loc) • 1.16 kB
JavaScript
import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck";
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
var WebGPU = /*#__PURE__*/function () {
function WebGPU() {
_classCallCheck(this, WebGPU);
}
_createClass(WebGPU, null, [{
key: "isAvailable",
value: function isAvailable() {
return navigator.gpu !== undefined;
}
}, {
key: "getErrorMessage",
value: function getErrorMessage() {
var message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:#000">WebGPU</a>.';
var element = document.createElement('div');
element.id = 'webgpumessage';
element.style.fontFamily = 'monospace';
element.style.fontSize = '13px';
element.style.fontWeight = 'normal';
element.style.textAlign = 'center';
element.style.background = '#fff';
element.style.color = '#000';
element.style.padding = '1.5em';
element.style.width = '400px';
element.style.margin = '5em auto 0';
element.innerHTML = message;
return element;
}
}]);
return WebGPU;
}();
export default WebGPU;