Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-webgpu

Package Overview
Dependencies
Maintainers
58
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-webgpu - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

275

dist/index.esm.js

@@ -14,52 +14,9 @@ import { CanvasConfig, ContextService, isString, setDOMSize, isBrowser, AbstractRenderer } from '@antv/g';

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
_setPrototypeOf(subClass, superClass);
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {

@@ -74,52 +31,2 @@ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {

function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
/******************************************************************************

@@ -153,4 +60,2 @@ Copyright (c) Microsoft Corporation.

function WebGLContextService() {
_classCallCheck(this, WebGLContextService);
this.$container = void 0;

@@ -163,92 +68,84 @@ this.$canvas = void 0;

_createClass(WebGLContextService, [{
key: "init",
value: function init() {
var _this$canvasConfig = this.canvasConfig,
container = _this$canvasConfig.container,
canvas = _this$canvasConfig.canvas,
devicePixelRatio = _this$canvasConfig.devicePixelRatio;
var _proto = WebGLContextService.prototype;
if (canvas) {
this.$canvas = canvas;
_proto.init = function init() {
var _this$canvasConfig = this.canvasConfig,
container = _this$canvasConfig.container,
canvas = _this$canvasConfig.canvas,
devicePixelRatio = _this$canvasConfig.devicePixelRatio;
if (container && canvas.parentElement !== container) {
container.appendChild(canvas);
}
if (canvas) {
this.$canvas = canvas;
this.$container = canvas.parentElement;
this.canvasConfig.container = this.$container;
} else if (container) {
// create container
this.$container = isString(container) ? document.getElementById(container) : container;
if (container && canvas.parentElement !== container) {
container.appendChild(canvas);
}
if (this.$container) {
// create canvas
var $canvas = document.createElement('canvas');
this.$container.appendChild($canvas);
this.$container = canvas.parentElement;
this.canvasConfig.container = this.$container;
} else if (container) {
// create container
this.$container = isString(container) ? document.getElementById(container) : container;
if (!this.$container.style.position) {
this.$container.style.position = 'relative';
}
if (this.$container) {
// create canvas
var $canvas = document.createElement('canvas');
this.$container.appendChild($canvas);
this.$canvas = $canvas;
if (!this.$container.style.position) {
this.$container.style.position = 'relative';
}
} // use user-defined dpr first
this.$canvas = $canvas;
}
} // use user-defined dpr first
var dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
this.dpr = dpr;
var dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
this.dpr = dpr;
};
_proto.getDomElement = function getDomElement() {
return this.$canvas;
};
_proto.getContext = function getContext() {
return this.context;
};
_proto.getBoundingClientRect = function getBoundingClientRect() {
if (this.$canvas.getBoundingClientRect) {
return this.$canvas.getBoundingClientRect();
}
}, {
key: "getDomElement",
value: function getDomElement() {
return this.$canvas;
}
}, {
key: "getContext",
value: function getContext() {
return this.context;
}
}, {
key: "getBoundingClientRect",
value: function getBoundingClientRect() {
if (this.$canvas.getBoundingClientRect) {
return this.$canvas.getBoundingClientRect();
}
}
}, {
key: "destroy",
value: function destroy() {
};
_proto.destroy = function destroy() {
// @ts-ignore
if (this.$container && this.$canvas && this.$canvas.parentNode) {
// @ts-ignore
if (this.$container && this.$canvas && this.$canvas.parentNode) {
// @ts-ignore
this.$container.removeChild(this.$canvas);
}
this.$container.removeChild(this.$canvas);
}
}, {
key: "resize",
value: function resize(width, height) {
if (this.$canvas) {
var dpr = this.getDPR(); // set canvas width & height
};
this.$canvas.width = dpr * width;
this.$canvas.height = dpr * height; // set CSS style width & height
_proto.resize = function resize(width, height) {
if (this.$canvas) {
var dpr = this.getDPR(); // set canvas width & height
setDOMSize(this.$canvas, width, height);
}
this.$canvas.width = dpr * width;
this.$canvas.height = dpr * height; // set CSS style width & height
setDOMSize(this.$canvas, width, height);
}
}, {
key: "getDPR",
value: function getDPR() {
return this.dpr;
};
_proto.getDPR = function getDPR() {
return this.dpr;
};
_proto.applyCursorStyle = function applyCursorStyle(cursor) {
if (this.$container && this.$container.style) {
this.$container.style.cursor = cursor;
}
}, {
key: "applyCursorStyle",
value: function applyCursorStyle(cursor) {
if (this.$container && this.$container.style) {
this.$container.style.cursor = cursor;
}
}
}]);
};

@@ -272,19 +169,15 @@ return WebGLContextService;

function ContextRegisterPlugin() {
_classCallCheck(this, ContextRegisterPlugin);
this.name = 'webgpu-context-register';
}
_createClass(ContextRegisterPlugin, [{
key: "init",
value: function init(container) {
container.load(containerModule, true);
}
}, {
key: "destroy",
value: function destroy(container) {
container.unload(containerModule);
}
}]);
var _proto = ContextRegisterPlugin.prototype;
_proto.init = function init(container) {
container.load(containerModule, true);
};
_proto.destroy = function destroy(container) {
container.unload(containerModule);
};
return ContextRegisterPlugin;

@@ -294,13 +187,9 @@ }();

var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
_inherits(Renderer, _AbstractRenderer);
_inheritsLoose(Renderer, _AbstractRenderer);
var _super = _createSuper(Renderer);
function Renderer(config) {
var _this;
_classCallCheck(this, Renderer);
_this = _AbstractRenderer.call(this, config) || this;
_this = _super.call(this, config);
_this.registerPlugin(new ContextRegisterPlugin());

@@ -319,5 +208,5 @@

return _createClass(Renderer);
return Renderer;
}(AbstractRenderer);
export { Renderer };

@@ -36,52 +36,9 @@ 'use strict';

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
_setPrototypeOf(subClass, superClass);
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {

@@ -96,52 +53,2 @@ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {

function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
} else if (call !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived),
result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
/******************************************************************************

@@ -175,4 +82,2 @@ Copyright (c) Microsoft Corporation.

function WebGLContextService() {
_classCallCheck(this, WebGLContextService);
this.$container = void 0;

@@ -185,92 +90,84 @@ this.$canvas = void 0;

_createClass(WebGLContextService, [{
key: "init",
value: function init() {
var _this$canvasConfig = this.canvasConfig,
container = _this$canvasConfig.container,
canvas = _this$canvasConfig.canvas,
devicePixelRatio = _this$canvasConfig.devicePixelRatio;
var _proto = WebGLContextService.prototype;
if (canvas) {
this.$canvas = canvas;
_proto.init = function init() {
var _this$canvasConfig = this.canvasConfig,
container = _this$canvasConfig.container,
canvas = _this$canvasConfig.canvas,
devicePixelRatio = _this$canvasConfig.devicePixelRatio;
if (container && canvas.parentElement !== container) {
container.appendChild(canvas);
}
if (canvas) {
this.$canvas = canvas;
this.$container = canvas.parentElement;
this.canvasConfig.container = this.$container;
} else if (container) {
// create container
this.$container = g.isString(container) ? document.getElementById(container) : container;
if (container && canvas.parentElement !== container) {
container.appendChild(canvas);
}
if (this.$container) {
// create canvas
var $canvas = document.createElement('canvas');
this.$container.appendChild($canvas);
this.$container = canvas.parentElement;
this.canvasConfig.container = this.$container;
} else if (container) {
// create container
this.$container = g.isString(container) ? document.getElementById(container) : container;
if (!this.$container.style.position) {
this.$container.style.position = 'relative';
}
if (this.$container) {
// create canvas
var $canvas = document.createElement('canvas');
this.$container.appendChild($canvas);
this.$canvas = $canvas;
if (!this.$container.style.position) {
this.$container.style.position = 'relative';
}
} // use user-defined dpr first
this.$canvas = $canvas;
}
} // use user-defined dpr first
var dpr = devicePixelRatio || g.isBrowser && window.devicePixelRatio || 1;
dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
this.dpr = dpr;
var dpr = devicePixelRatio || g.isBrowser && window.devicePixelRatio || 1;
dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
this.dpr = dpr;
};
_proto.getDomElement = function getDomElement() {
return this.$canvas;
};
_proto.getContext = function getContext() {
return this.context;
};
_proto.getBoundingClientRect = function getBoundingClientRect() {
if (this.$canvas.getBoundingClientRect) {
return this.$canvas.getBoundingClientRect();
}
}, {
key: "getDomElement",
value: function getDomElement() {
return this.$canvas;
}
}, {
key: "getContext",
value: function getContext() {
return this.context;
}
}, {
key: "getBoundingClientRect",
value: function getBoundingClientRect() {
if (this.$canvas.getBoundingClientRect) {
return this.$canvas.getBoundingClientRect();
}
}
}, {
key: "destroy",
value: function destroy() {
};
_proto.destroy = function destroy() {
// @ts-ignore
if (this.$container && this.$canvas && this.$canvas.parentNode) {
// @ts-ignore
if (this.$container && this.$canvas && this.$canvas.parentNode) {
// @ts-ignore
this.$container.removeChild(this.$canvas);
}
this.$container.removeChild(this.$canvas);
}
}, {
key: "resize",
value: function resize(width, height) {
if (this.$canvas) {
var dpr = this.getDPR(); // set canvas width & height
};
this.$canvas.width = dpr * width;
this.$canvas.height = dpr * height; // set CSS style width & height
_proto.resize = function resize(width, height) {
if (this.$canvas) {
var dpr = this.getDPR(); // set canvas width & height
g.setDOMSize(this.$canvas, width, height);
}
this.$canvas.width = dpr * width;
this.$canvas.height = dpr * height; // set CSS style width & height
g.setDOMSize(this.$canvas, width, height);
}
}, {
key: "getDPR",
value: function getDPR() {
return this.dpr;
};
_proto.getDPR = function getDPR() {
return this.dpr;
};
_proto.applyCursorStyle = function applyCursorStyle(cursor) {
if (this.$container && this.$container.style) {
this.$container.style.cursor = cursor;
}
}, {
key: "applyCursorStyle",
value: function applyCursorStyle(cursor) {
if (this.$container && this.$container.style) {
this.$container.style.cursor = cursor;
}
}
}]);
};

@@ -294,19 +191,15 @@ return WebGLContextService;

function ContextRegisterPlugin() {
_classCallCheck(this, ContextRegisterPlugin);
this.name = 'webgpu-context-register';
}
_createClass(ContextRegisterPlugin, [{
key: "init",
value: function init(container) {
container.load(containerModule, true);
}
}, {
key: "destroy",
value: function destroy(container) {
container.unload(containerModule);
}
}]);
var _proto = ContextRegisterPlugin.prototype;
_proto.init = function init(container) {
container.load(containerModule, true);
};
_proto.destroy = function destroy(container) {
container.unload(containerModule);
};
return ContextRegisterPlugin;

@@ -316,13 +209,9 @@ }();

var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
_inherits(Renderer, _AbstractRenderer);
_inheritsLoose(Renderer, _AbstractRenderer);
var _super = _createSuper(Renderer);
function Renderer(config) {
var _this;
_classCallCheck(this, Renderer);
_this = _AbstractRenderer.call(this, config) || this;
_this = _super.call(this, config);
_this.registerPlugin(new ContextRegisterPlugin());

@@ -341,3 +230,3 @@

return _createClass(Renderer);
return Renderer;
}(g.AbstractRenderer);

@@ -344,0 +233,0 @@

{
"name": "@antv/g-webgpu",
"version": "1.1.6",
"version": "1.1.7",
"description": "A renderer implemented by WebGPU",

@@ -30,6 +30,6 @@ "keywords": [

"dependencies": {
"@antv/g-plugin-device-renderer": "^1.1.6",
"@antv/g-plugin-dom-interaction": "^1.1.6",
"@antv/g-plugin-html-renderer": "^1.1.6",
"@antv/g-plugin-webgpu-device": "^1.1.6"
"@antv/g-plugin-device-renderer": "^1.1.7",
"@antv/g-plugin-dom-interaction": "^1.1.7",
"@antv/g-plugin-html-renderer": "^1.1.7",
"@antv/g-plugin-webgpu-device": "^1.1.7"
},

@@ -48,3 +48,3 @@ "devDependencies": {

},
"gitHead": "ee946c7c12c90946c37926b34ee5165bf0c35f25"
"gitHead": "1cc3651074e82fc185a7a65d01123706ab958f09"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc