@antv/l7-renderer 2.18.0 → 2.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-renderer",
3
- "version": "2.18.0",
3
+ "version": "2.18.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -25,18 +25,18 @@
25
25
  "author": "xiaoiver",
26
26
  "license": "ISC",
27
27
  "devDependencies": {
28
- "@antv/l7-test-utils": "2.18.0",
28
+ "@antv/l7-test-utils": "^2.18.2",
29
29
  "gl": "^5.0.3"
30
30
  },
31
31
  "dependencies": {
32
- "@antv/l7-core": "2.18.0",
33
- "@antv/l7-utils": "2.18.0",
32
+ "@antv/l7-core": "^2.18.2",
33
+ "@antv/l7-utils": "^2.18.2",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "inversify": "^5.0.1",
36
36
  "reflect-metadata": "^0.1.13",
37
37
  "regl": "^1.7.0"
38
38
  },
39
- "gitHead": "89fc0b84737ea58f9eda2fe28d70773a900939f6",
39
+ "gitHead": "89de0cd3f4d2e6e71132577a2ae4e571e2acf0b8",
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  }
package/es/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- *
3
- */
4
- import ReglRendererService from './regl';
5
- export { ReglRendererService };
package/es/index.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- *
3
- */
4
- import ReglRendererService from "./regl";
5
- export { ReglRendererService };
@@ -1,16 +0,0 @@
1
- import { IAttribute, IAttributeInitializationOptions } from '@antv/l7-core';
2
- import regl from 'regl';
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
- */
6
- export default class ReglAttribute implements IAttribute {
7
- private attribute;
8
- private buffer;
9
- constructor(gl: regl.Regl, options: IAttributeInitializationOptions);
10
- get(): regl.Attribute;
11
- updateBuffer(options: {
12
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
13
- offset: number;
14
- }): void;
15
- destroy(): void;
16
- }
@@ -1,45 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
- */
6
- var ReglAttribute = /*#__PURE__*/function () {
7
- function ReglAttribute(gl, options) {
8
- _classCallCheck(this, ReglAttribute);
9
- var buffer = options.buffer,
10
- offset = options.offset,
11
- stride = options.stride,
12
- normalized = options.normalized,
13
- size = options.size,
14
- divisor = options.divisor;
15
- this.buffer = buffer;
16
- this.attribute = {
17
- buffer: buffer.get(),
18
- offset: offset || 0,
19
- stride: stride || 0,
20
- normalized: normalized || false,
21
- divisor: divisor || 0
22
- };
23
- if (size) {
24
- this.attribute.size = size;
25
- }
26
- }
27
- _createClass(ReglAttribute, [{
28
- key: "get",
29
- value: function get() {
30
- return this.attribute;
31
- }
32
- }, {
33
- key: "updateBuffer",
34
- value: function updateBuffer(options) {
35
- this.buffer.subData(options);
36
- }
37
- }, {
38
- key: "destroy",
39
- value: function destroy() {
40
- this.buffer.destroy();
41
- }
42
- }]);
43
- return ReglAttribute;
44
- }();
45
- export { ReglAttribute as default };
@@ -1,17 +0,0 @@
1
- import { IBuffer, IBufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'regl';
3
- /**
4
- * adaptor for regl.Buffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
6
- */
7
- export default class ReglBuffer implements IBuffer {
8
- private buffer;
9
- private isDestroyed;
10
- constructor(reGl: regl.Regl, options: IBufferInitializationOptions);
11
- get(): regl.Buffer;
12
- destroy(): void;
13
- subData({ data, offset, }: {
14
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
15
- offset: number;
16
- }): void;
17
- }
@@ -1,48 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import { gl } from '@antv/l7-core';
5
- import { dataTypeMap, usageMap } from "./constants";
6
-
7
- /**
8
- * adaptor for regl.Buffer
9
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
10
- */
11
- var ReglBuffer = /*#__PURE__*/function () {
12
- function ReglBuffer(reGl, options) {
13
- _classCallCheck(this, ReglBuffer);
14
- _defineProperty(this, "isDestroyed", false);
15
- var data = options.data,
16
- usage = options.usage,
17
- type = options.type;
18
- this.buffer = reGl.buffer({
19
- data: data,
20
- usage: usageMap[usage || gl.STATIC_DRAW],
21
- type: dataTypeMap[type || gl.UNSIGNED_BYTE]
22
- // length: 0,
23
- });
24
- }
25
- _createClass(ReglBuffer, [{
26
- key: "get",
27
- value: function get() {
28
- return this.buffer;
29
- }
30
- }, {
31
- key: "destroy",
32
- value: function destroy() {
33
- if (!this.isDestroyed) {
34
- this.buffer.destroy();
35
- }
36
- this.isDestroyed = true;
37
- }
38
- }, {
39
- key: "subData",
40
- value: function subData(_ref) {
41
- var data = _ref.data,
42
- offset = _ref.offset;
43
- this.buffer.subdata(data, offset);
44
- }
45
- }]);
46
- return ReglBuffer;
47
- }();
48
- export { ReglBuffer as default };
@@ -1,14 +0,0 @@
1
- import { IElements, IElementsInitializationOptions } from '@antv/l7-core';
2
- import regl from 'regl';
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements
5
- */
6
- export default class ReglElements implements IElements {
7
- private elements;
8
- constructor(reGl: regl.Regl, options: IElementsInitializationOptions);
9
- get(): regl.Elements;
10
- subData({ data, }: {
11
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
12
- }): void;
13
- destroy(): void;
14
- }
@@ -1,42 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import { gl } from '@antv/l7-core';
4
- import { dataTypeMap, usageMap } from "./constants";
5
-
6
- /**
7
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements
8
- */
9
- var ReglElements = /*#__PURE__*/function () {
10
- function ReglElements(reGl, options) {
11
- _classCallCheck(this, ReglElements);
12
- var data = options.data,
13
- usage = options.usage,
14
- type = options.type,
15
- count = options.count;
16
- this.elements = reGl.elements({
17
- data: data,
18
- usage: usageMap[usage || gl.STATIC_DRAW],
19
- type: dataTypeMap[type || gl.UNSIGNED_BYTE],
20
- count: count
21
- });
22
- }
23
- _createClass(ReglElements, [{
24
- key: "get",
25
- value: function get() {
26
- return this.elements;
27
- }
28
- }, {
29
- key: "subData",
30
- value: function subData(_ref) {
31
- var data = _ref.data;
32
- this.elements.subdata(data);
33
- }
34
- }, {
35
- key: "destroy",
36
- value: function destroy() {
37
- // this.elements.destroy();
38
- }
39
- }]);
40
- return ReglElements;
41
- }();
42
- export { ReglElements as default };
@@ -1,16 +0,0 @@
1
- import { IFramebuffer, IFramebufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'regl';
3
- /**
4
- * adaptor for regl.Framebuffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
6
- */
7
- export default class ReglFramebuffer implements IFramebuffer {
8
- private framebuffer;
9
- constructor(reGl: regl.Regl, options: IFramebufferInitializationOptions);
10
- get(): regl.Framebuffer;
11
- destroy(): void;
12
- resize({ width, height }: {
13
- width: number;
14
- height: number;
15
- }): void;
16
- }
@@ -1,51 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- /**
4
- * adaptor for regl.Framebuffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
6
- */
7
- var ReglFramebuffer = /*#__PURE__*/function () {
8
- function ReglFramebuffer(reGl, options) {
9
- _classCallCheck(this, ReglFramebuffer);
10
- var width = options.width,
11
- height = options.height,
12
- color = options.color,
13
- colors = options.colors;
14
- var framebufferOptions = {
15
- width: width,
16
- height: height
17
- };
18
- if (Array.isArray(colors)) {
19
- framebufferOptions.colors = colors.map(function (c) {
20
- return c.get();
21
- });
22
- }
23
- if (color && typeof color !== 'boolean') {
24
- framebufferOptions.color = color.get();
25
- }
26
-
27
- // TODO: depth & stencil
28
-
29
- this.framebuffer = reGl.framebuffer(framebufferOptions);
30
- }
31
- _createClass(ReglFramebuffer, [{
32
- key: "get",
33
- value: function get() {
34
- return this.framebuffer;
35
- }
36
- }, {
37
- key: "destroy",
38
- value: function destroy() {
39
- this.framebuffer.destroy();
40
- }
41
- }, {
42
- key: "resize",
43
- value: function resize(_ref) {
44
- var width = _ref.width,
45
- height = _ref.height;
46
- this.framebuffer.resize(width, height);
47
- }
48
- }]);
49
- return ReglFramebuffer;
50
- }();
51
- export { ReglFramebuffer as default };
@@ -1,46 +0,0 @@
1
- import { IAttribute, IElements, IModel, IModelDrawOptions, IModelInitializationOptions, IUniform } from '@antv/l7-core';
2
- import regl from 'regl';
3
- /**
4
- * adaptor for regl.DrawCommand
5
- */
6
- export default class ReglModel implements IModel {
7
- private reGl;
8
- private destroyed;
9
- private drawCommand;
10
- private drawParams;
11
- private options;
12
- private uniforms;
13
- constructor(reGl: regl.Regl, options: IModelInitializationOptions);
14
- updateAttributesAndElements(attributes: {
15
- [key: string]: IAttribute;
16
- }, elements: IElements): void;
17
- updateAttributes(attributes: {
18
- [key: string]: IAttribute;
19
- }): void;
20
- addUniforms(uniforms: {
21
- [key: string]: IUniform;
22
- }): void;
23
- draw(options: IModelDrawOptions, pick?: boolean): void;
24
- destroy(): void;
25
- /**
26
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#depth-buffer
27
- */
28
- private initDepthDrawParams;
29
- private getBlendDrawParams;
30
- /**
31
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#stencil
32
- */
33
- private getStencilDrawParams;
34
- private getColorMaskDrawParams;
35
- /**
36
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#culling
37
- */
38
- private initCullDrawParams;
39
- /**
40
- * 考虑结构体命名, eg:
41
- * a: { b: 1 } -> 'a.b'
42
- * a: [ { b: 1 } ] -> 'a[0].b'
43
- */
44
- private extractUniforms;
45
- private extractUniformsRecursively;
46
- }