@vitessce/glb 4.0.0-test.0 → 4.0.0-test.1

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.
Files changed (2) hide show
  1. package/package.json +9 -9
  2. package/dist/index.js +0 -90
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/glb",
3
- "version": "4.0.0-test.0",
3
+ "version": "4.0.0-test.1",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -18,14 +18,14 @@
18
18
  "dependencies": {
19
19
  "d3-array": "^2.4.0",
20
20
  "lodash-es": "^4.17.21",
21
- "@vitessce/abstract": "4.0.0-test.0",
22
- "@vitessce/constants-internal": "4.0.0-test.0",
23
- "@vitessce/error": "4.0.0-test.0",
24
- "@vitessce/sets-utils": "4.0.0-test.0",
25
- "@vitessce/spatial-utils": "4.0.0-test.0",
26
- "@vitessce/gl": "4.0.0-test.0",
27
- "@vitessce/utils": "4.0.0-test.0",
28
- "@vitessce/image-utils": "4.0.0-test.0"
21
+ "@vitessce/abstract": "4.0.0-test.1",
22
+ "@vitessce/error": "4.0.0-test.1",
23
+ "@vitessce/gl": "4.0.0-test.1",
24
+ "@vitessce/sets-utils": "4.0.0-test.1",
25
+ "@vitessce/spatial-utils": "4.0.0-test.1",
26
+ "@vitessce/utils": "4.0.0-test.1",
27
+ "@vitessce/image-utils": "4.0.0-test.1",
28
+ "@vitessce/constants-internal": "4.0.0-test.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/three": "^0.159.0",
package/dist/index.js DELETED
@@ -1,90 +0,0 @@
1
- import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
2
- import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
3
- class GlbSource {
4
- constructor({ url, requestInit }) {
5
- this.url = url;
6
- this.requestInit = requestInit;
7
- }
8
- }
9
- class LoaderResult {
10
- /**
11
- * @param {LoaderDataType} data
12
- * @param {object[]|string|null} url Single URL or array of { url, name } objects.
13
- * @param {object|null} coordinationValues
14
- * @param {RequestInit|null} requestInit
15
- */
16
- constructor(data, url, coordinationValues = null, requestInit = null) {
17
- this.data = data;
18
- this.url = url;
19
- this.coordinationValues = coordinationValues;
20
- this.requestInit = requestInit;
21
- }
22
- }
23
- class AbstractLoader {
24
- /**
25
- *
26
- * @param {LoaderParams} params
27
- */
28
- constructor({ type, fileType, url, requestInit, options, coordinationValues }) {
29
- this.fileType = fileType;
30
- this.type = type;
31
- this.url = url;
32
- this.requestInit = requestInit;
33
- this.options = options;
34
- this.coordinationValues = coordinationValues;
35
- }
36
- /**
37
- *
38
- * @returns {Promise<LoaderResult<any>>}
39
- */
40
- // eslint-disable-next-line class-methods-use-this
41
- async load() {
42
- return Promise.resolve(new LoaderResult(true, null));
43
- }
44
- }
45
- class AbstractTwoStepLoader extends AbstractLoader {
46
- /**
47
- *
48
- * @param {DataSourceType} dataSource
49
- * @param {LoaderParams} params
50
- */
51
- constructor(dataSource, params) {
52
- super(params);
53
- this.dataSource = dataSource;
54
- }
55
- }
56
- class GlbDataLoader extends AbstractTwoStepLoader {
57
- async load() {
58
- const { url, options } = this;
59
- const loader = new GLTFLoader();
60
- const dracoLoader = new DRACOLoader();
61
- dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.6/");
62
- loader.setDRACOLoader(dracoLoader);
63
- return new Promise((resolve, reject) => {
64
- loader.load(
65
- url,
66
- // onLoad
67
- (gltf) => {
68
- const { scene } = gltf;
69
- resolve(new LoaderResult(
70
- {
71
- obsIndex: null,
72
- obsSegmentations: { scene, sceneOptions: options },
73
- obsSegmentationsType: "mesh"
74
- },
75
- url
76
- ));
77
- },
78
- // onProgress
79
- () => {
80
- },
81
- // onError
82
- (error) => reject(error)
83
- );
84
- });
85
- }
86
- }
87
- export {
88
- GlbDataLoader as GlbLoader,
89
- GlbSource
90
- };