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

@antv/g-plugin-3d

Package Overview
Dependencies
Maintainers
53
Versions
254
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-3d - npm Package Compare versions

Comparing version 1.0.0-alpha.24 to 1.0.0-alpha.25

8

dist/index.d.ts
import { RendererPlugin } from '@antv/g';
import { ContainerModule, Container } from 'inversify';
import { Syringe } from 'mana-syringe';
import { Cube } from './Cube';
import { Sphere } from './Sphere';
import { Grid } from './Grid';
export declare const containerModule: ContainerModule;
export declare const containerModule: import("mana-syringe").SyringeModule;
export declare class Plugin implements RendererPlugin {
init(container: Container): void;
destroy(container: Container): void;
init(container: Syringe.Container): void;
destroy(container: Syringe.Container): void;
}
export { Cube, Sphere, Grid };

@@ -1,3 +0,4 @@

import { Renderable, DisplayObject, container, GeometryAABBUpdater } from '@antv/g';
import { AttributeLocation, Batch, DeviceProgram, TextureMapping, makeTextureDescriptor2D, Format, TexturePool, registerModelBuilder } from '@antv/g-plugin-webgl-renderer';
import { singleton, inject, GlobalContainer, Module } from 'mana-syringe';
import { AttributeLocation, TexturePool, Batch, DeviceProgram, TextureMapping, makeTextureDescriptor2D, Format, registerModelBuilder } from '@antv/g-plugin-webgl-renderer';
import { GeometryAABBUpdater, Renderable, DisplayObject } from '@antv/g';

@@ -226,163 +227,2 @@ function ownKeys(object, enumerableOnly) {

var NAMED_TAG = "named";
var INJECT_TAG = "inject";
var TAGGED = "inversify:tagged";
var TAGGED_PROP = "inversify:tagged_props";
var PARAM_TYPES = "inversify:paramtypes";
var DESIGN_PARAM_TYPES = "design:paramtypes";
var idCounter = 0;
function id() {
return idCounter++;
}
var DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
var DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
var UNDEFINED_INJECT_ANNOTATION = function (name) {
return "@inject called with undefined this could mean that the class " + name + " has " +
"a circular dependency problem. You can use a LazyServiceIdentifer to " +
"overcome this limitation.";
};
var INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
"must be applied to the parameters of a class constructor or a class property.";
var Metadata = (function () {
function Metadata(key, value) {
this.key = key;
this.value = value;
}
Metadata.prototype.toString = function () {
if (this.key === NAMED_TAG) {
return "named: " + this.value.toString() + " ";
}
else {
return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }";
}
};
return Metadata;
}());
function tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {
var metadataKey = TAGGED;
_tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);
}
function tagProperty(annotationTarget, propertyName, metadata) {
var metadataKey = TAGGED_PROP;
_tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);
}
function _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {
var paramsOrPropertiesMetadata = {};
var isParameterDecorator = (typeof parameterIndex === "number");
var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;
if (isParameterDecorator && propertyName !== undefined) {
throw new Error(INVALID_DECORATOR_OPERATION);
}
if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
}
var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
if (!Array.isArray(paramOrPropertyMetadata)) {
paramOrPropertyMetadata = [];
}
else {
for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {
var m = paramOrPropertyMetadata_1[_i];
if (m.key === metadata.key) {
throw new Error(DUPLICATED_METADATA + " " + m.key.toString());
}
}
}
paramOrPropertyMetadata.push(metadata);
paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
}
function inject(serviceIdentifier) {
return function (target, targetKey, index) {
if (serviceIdentifier === undefined) {
throw new Error(UNDEFINED_INJECT_ANNOTATION(target.name));
}
var metadata = new Metadata(INJECT_TAG, serviceIdentifier);
if (typeof index === "number") {
tagParameter(target, targetKey, index, metadata);
}
else {
tagProperty(target, targetKey, metadata);
}
};
}
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var ContainerModule = (function () {
function ContainerModule(registry) {
this.id = id();
this.registry = registry;
}
return ContainerModule;
}());
function injectable() {
return function (target) {
if (Reflect.hasOwnMetadata(PARAM_TYPES, target)) {
throw new Error(DUPLICATED_INJECTABLE_DECORATOR);
}
var types = Reflect.getMetadata(DESIGN_PARAM_TYPES, target) || [];
Reflect.defineMetadata(PARAM_TYPES, types, target);
return target;
};
}
/*! *****************************************************************************

@@ -414,2 +254,10 @@ Copyright (c) Microsoft Corporation.

var SHAPE_3D;
(function (SHAPE_3D) {
SHAPE_3D["Cube"] = "cube";
SHAPE_3D["Sphere"] = "sphere";
SHAPE_3D["Grid"] = "grid";
})(SHAPE_3D || (SHAPE_3D = {}));
var CubeUpdater = /*#__PURE__*/function () {

@@ -443,3 +291,8 @@ function CubeUpdater() {

CubeUpdater = __decorate([injectable()], CubeUpdater);
CubeUpdater = __decorate([singleton({
token: {
token: GeometryAABBUpdater,
named: SHAPE_3D.Cube
}
})], CubeUpdater);

@@ -477,3 +330,8 @@ var SphereUpdater =

SphereUpdater = __decorate([injectable() // @ts-ignore
SphereUpdater = __decorate([singleton({
token: {
token: GeometryAABBUpdater,
named: SHAPE_3D.Sphere
}
}) // @ts-ignore
], SphereUpdater);

@@ -509,3 +367,8 @@

GridUpdater = __decorate([injectable() // @ts-ignore
GridUpdater = __decorate([singleton({
token: {
token: GeometryAABBUpdater,
named: SHAPE_3D.Grid
}
}) // @ts-ignore
], GridUpdater);

@@ -957,3 +820,3 @@

CubeModelBuilder = __decorate([injectable()], CubeModelBuilder);
CubeModelBuilder = __decorate([singleton()], CubeModelBuilder);

@@ -1073,12 +936,4 @@ var GridProgram = /*#__PURE__*/function (_DeviceProgram) {

GridModelBuilder = __decorate([injectable()], GridModelBuilder);
GridModelBuilder = __decorate([singleton()], GridModelBuilder);
var SHAPE_3D;
(function (SHAPE_3D) {
SHAPE_3D["Cube"] = "cube";
SHAPE_3D["Sphere"] = "sphere";
SHAPE_3D["Grid"] = "grid";
})(SHAPE_3D || (SHAPE_3D = {}));
var _excluded = ["style"];

@@ -1160,6 +1015,6 @@ var Cube = /*#__PURE__*/function (_DisplayObject) {

container.bind(GeometryAABBUpdater).to(CubeUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Cube);
container.bind(GeometryAABBUpdater).to(SphereUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Sphere);
container.bind(GeometryAABBUpdater).to(GridUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Grid);
var containerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
GlobalContainer.register(CubeUpdater);
GlobalContainer.register(SphereUpdater);
GlobalContainer.register(GridUpdater);
var containerModule = Module(function (register) {
registerModelBuilder(CubeModelBuilder, SHAPE_3D.Cube); // registerModelBuilder(SphereModelBuilder, SHAPE_3D.Sphere);

@@ -1181,4 +1036,4 @@

key: "destroy",
value: function destroy(container) {
container.unload(containerModule);
value: function destroy(container) {// @ts-ignore
// container.container.unload(containerModule);
}

@@ -1185,0 +1040,0 @@ }]);

@@ -5,4 +5,5 @@ 'use strict';

var manaSyringe = require('mana-syringe');
var gPluginWebglRenderer = require('@antv/g-plugin-webgl-renderer');
var g = require('@antv/g');
var gPluginWebglRenderer = require('@antv/g-plugin-webgl-renderer');

@@ -231,163 +232,2 @@ function ownKeys(object, enumerableOnly) {

var NAMED_TAG = "named";
var INJECT_TAG = "inject";
var TAGGED = "inversify:tagged";
var TAGGED_PROP = "inversify:tagged_props";
var PARAM_TYPES = "inversify:paramtypes";
var DESIGN_PARAM_TYPES = "design:paramtypes";
var idCounter = 0;
function id() {
return idCounter++;
}
var DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
var DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
var UNDEFINED_INJECT_ANNOTATION = function (name) {
return "@inject called with undefined this could mean that the class " + name + " has " +
"a circular dependency problem. You can use a LazyServiceIdentifer to " +
"overcome this limitation.";
};
var INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
"must be applied to the parameters of a class constructor or a class property.";
var Metadata = (function () {
function Metadata(key, value) {
this.key = key;
this.value = value;
}
Metadata.prototype.toString = function () {
if (this.key === NAMED_TAG) {
return "named: " + this.value.toString() + " ";
}
else {
return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }";
}
};
return Metadata;
}());
function tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {
var metadataKey = TAGGED;
_tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);
}
function tagProperty(annotationTarget, propertyName, metadata) {
var metadataKey = TAGGED_PROP;
_tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);
}
function _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {
var paramsOrPropertiesMetadata = {};
var isParameterDecorator = (typeof parameterIndex === "number");
var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;
if (isParameterDecorator && propertyName !== undefined) {
throw new Error(INVALID_DECORATOR_OPERATION);
}
if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
}
var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
if (!Array.isArray(paramOrPropertyMetadata)) {
paramOrPropertyMetadata = [];
}
else {
for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {
var m = paramOrPropertyMetadata_1[_i];
if (m.key === metadata.key) {
throw new Error(DUPLICATED_METADATA + " " + m.key.toString());
}
}
}
paramOrPropertyMetadata.push(metadata);
paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
}
function inject(serviceIdentifier) {
return function (target, targetKey, index) {
if (serviceIdentifier === undefined) {
throw new Error(UNDEFINED_INJECT_ANNOTATION(target.name));
}
var metadata = new Metadata(INJECT_TAG, serviceIdentifier);
if (typeof index === "number") {
tagParameter(target, targetKey, index, metadata);
}
else {
tagProperty(target, targetKey, metadata);
}
};
}
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
var ContainerModule = (function () {
function ContainerModule(registry) {
this.id = id();
this.registry = registry;
}
return ContainerModule;
}());
function injectable() {
return function (target) {
if (Reflect.hasOwnMetadata(PARAM_TYPES, target)) {
throw new Error(DUPLICATED_INJECTABLE_DECORATOR);
}
var types = Reflect.getMetadata(DESIGN_PARAM_TYPES, target) || [];
Reflect.defineMetadata(PARAM_TYPES, types, target);
return target;
};
}
/*! *****************************************************************************

@@ -419,2 +259,10 @@ Copyright (c) Microsoft Corporation.

var SHAPE_3D;
(function (SHAPE_3D) {
SHAPE_3D["Cube"] = "cube";
SHAPE_3D["Sphere"] = "sphere";
SHAPE_3D["Grid"] = "grid";
})(SHAPE_3D || (SHAPE_3D = {}));
var CubeUpdater = /*#__PURE__*/function () {

@@ -448,3 +296,8 @@ function CubeUpdater() {

CubeUpdater = __decorate([injectable()], CubeUpdater);
CubeUpdater = __decorate([manaSyringe.singleton({
token: {
token: g.GeometryAABBUpdater,
named: SHAPE_3D.Cube
}
})], CubeUpdater);

@@ -482,3 +335,8 @@ var SphereUpdater =

SphereUpdater = __decorate([injectable() // @ts-ignore
SphereUpdater = __decorate([manaSyringe.singleton({
token: {
token: g.GeometryAABBUpdater,
named: SHAPE_3D.Sphere
}
}) // @ts-ignore
], SphereUpdater);

@@ -514,3 +372,8 @@

GridUpdater = __decorate([injectable() // @ts-ignore
GridUpdater = __decorate([manaSyringe.singleton({
token: {
token: g.GeometryAABBUpdater,
named: SHAPE_3D.Grid
}
}) // @ts-ignore
], GridUpdater);

@@ -960,5 +823,5 @@

__decorate([inject(gPluginWebglRenderer.TexturePool), __metadata("design:type", gPluginWebglRenderer.TexturePool)], CubeModelBuilder.prototype, "texturePool", void 0);
__decorate([manaSyringe.inject(gPluginWebglRenderer.TexturePool), __metadata("design:type", gPluginWebglRenderer.TexturePool)], CubeModelBuilder.prototype, "texturePool", void 0);
CubeModelBuilder = __decorate([injectable()], CubeModelBuilder);
CubeModelBuilder = __decorate([manaSyringe.singleton()], CubeModelBuilder);

@@ -1078,12 +941,4 @@ var GridProgram = /*#__PURE__*/function (_DeviceProgram) {

GridModelBuilder = __decorate([injectable()], GridModelBuilder);
GridModelBuilder = __decorate([manaSyringe.singleton()], GridModelBuilder);
var SHAPE_3D;
(function (SHAPE_3D) {
SHAPE_3D["Cube"] = "cube";
SHAPE_3D["Sphere"] = "sphere";
SHAPE_3D["Grid"] = "grid";
})(SHAPE_3D || (SHAPE_3D = {}));
var _excluded = ["style"];

@@ -1165,6 +1020,6 @@ var Cube = /*#__PURE__*/function (_DisplayObject) {

g.container.bind(g.GeometryAABBUpdater).to(CubeUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Cube);
g.container.bind(g.GeometryAABBUpdater).to(SphereUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Sphere);
g.container.bind(g.GeometryAABBUpdater).to(GridUpdater).inSingletonScope().whenTargetNamed(SHAPE_3D.Grid);
var containerModule = new ContainerModule(function (bind, unbind, isBound, rebind) {
manaSyringe.GlobalContainer.register(CubeUpdater);
manaSyringe.GlobalContainer.register(SphereUpdater);
manaSyringe.GlobalContainer.register(GridUpdater);
var containerModule = manaSyringe.Module(function (register) {
gPluginWebglRenderer.registerModelBuilder(CubeModelBuilder, SHAPE_3D.Cube); // registerModelBuilder(SphereModelBuilder, SHAPE_3D.Sphere);

@@ -1186,4 +1041,4 @@

key: "destroy",
value: function destroy(container) {
container.unload(containerModule);
value: function destroy(container) {// @ts-ignore
// container.container.unload(containerModule);
}

@@ -1190,0 +1045,0 @@ }]);

{
"name": "@antv/g-plugin-3d",
"version": "1.0.0-alpha.24",
"version": "1.0.0-alpha.25",
"description": "Provide 3D extension for G",

@@ -40,8 +40,9 @@ "main": "dist/index.js",

"dependencies": {
"@antv/g": "^1.0.0-alpha.25",
"@antv/g-plugin-dom-interaction": "^1.0.0-alpha.24",
"@antv/g-plugin-webgl-renderer": "^1.0.0-alpha.25",
"@antv/util": "^2.0.13"
"@antv/g": "^1.0.0-alpha.26",
"@antv/g-plugin-dom-interaction": "^1.0.0-alpha.25",
"@antv/g-plugin-webgl-renderer": "^1.0.0-alpha.26",
"@antv/util": "^2.0.13",
"mana-syringe": "^0.1.0"
},
"gitHead": "e2b8bc287c7faa181013d9e5df071ff97d702c94"
"gitHead": "04974923388e3c1e3c47d591c251380058372376"
}
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