@cognite/reveal 4.1.1-dev.20230303 → 4.1.1-dev.20230307

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.
@@ -12,15 +12,13 @@ export declare class IconCollection {
12
12
  private readonly _sharedTexture;
13
13
  private readonly _icons;
14
14
  private readonly _iconsSprite;
15
- private readonly _clusterSprites;
16
15
  private readonly _computeClustersEventHandler;
17
16
  private readonly _onBeforeSceneRenderedEvent;
18
17
  get icons(): Image360Icon[];
19
18
  constructor(points: Vector3[], sceneHandler: SceneHandler, onBeforeSceneRendered: EventTrigger<BeforeSceneRenderedDelegate>);
20
- private computeClusters;
19
+ private setIconClustersByLOD;
21
20
  private initializeImage360Icons;
22
21
  dispose(): void;
23
- private createClusterTexture;
24
22
  private createOuterRingsTexture;
25
23
  private createHoverIconTexture;
26
24
  }
@@ -2,20 +2,20 @@
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
4
  import { Node, PointOctant, PointOctree } from 'sparse-octree';
5
- import { Box3, Matrix4, Vector3 } from 'three';
5
+ import { Box3, Matrix4 } from 'three';
6
6
  import { Image360Icon } from '../icons/Image360Icon';
7
7
  export declare class IconOctree extends PointOctree<Image360Icon> {
8
8
  private readonly _nodeCenters;
9
9
  static getMinimalOctreeBoundsFromIcons(icons: Image360Icon[]): Box3;
10
10
  constructor(icons: Image360Icon[], bounds: Box3, maxLeafSize: number);
11
- getPointCenterOfNode(node: Node): Vector3 | undefined;
12
- getLODByScreenArea(areaThreshold: number, projection: Matrix4): Set<PointOctant<Image360Icon>>;
11
+ getNodeIcon(node: Node): Image360Icon | undefined;
12
+ getLODByScreenArea(areaThreshold: number, projection: Matrix4, minimumLevel?: number): Set<PointOctant<Image360Icon>>;
13
13
  private populateNodeCenters;
14
14
  private filterEmptyLeaves;
15
15
  private hasChildren;
16
16
  private isEmptyLeaf;
17
17
  private hasData;
18
18
  private isPointOctant;
19
- private centerOfPoints;
20
- private traverseLevelsBottomUp;
19
+ private getClosestToAverageIcon;
20
+ traverseLevelsBottomUp(func: (nodes: Node[]) => void): void;
21
21
  }
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * Copyright 2023 Cognite AS
3
3
  */
4
- import { Group, Texture, Vector3 } from 'three';
4
+ import { Color, Group, Texture, Vector3 } from 'three';
5
5
  export declare class InstancedIconSprite extends Group {
6
6
  private readonly _geometry;
7
7
  private readonly _frontMaterial;
8
8
  private readonly _backMaterial;
9
9
  private readonly _positionBuffer;
10
10
  private readonly _positionAttribute;
11
- constructor(maxNumberOfPoints: number, spriteTexture: Texture, minPixelSize: number, maxPixelSize: number, radius: number);
11
+ constructor(maxNumberOfPoints: number, spriteTexture: Texture, minPixelSize: number, maxPixelSize: number, radius: number, colorTint?: Color);
12
12
  setPoints(points: Vector3[]): void;
13
13
  dispose(): void;
14
14
  private initializePoints;
@@ -451,7 +451,7 @@ export declare class Cognite3DViewer {
451
451
  requestRedraw(): void;
452
452
  /**
453
453
  * Convert a point in world space to its coordinates in the canvas. This can be used to place HTML objects near 3D objects on top of the 3D viewer.
454
- * @see {@link https://www.w3schools.com/graphics/canvas_coordinates.asp https://www.w3schools.com/graphics/canvas_coordinates.asp}.
454
+ * @see {@link https://www.w3schools.com/graphics/canvas_coordinates.asp} For details on HTML Canvas Coordinates.
455
455
  * @param point World space coordinate.
456
456
  * @param normalize Optional. If true, coordinates are normalized into [0,1]. If false, the values are in the range [0, <canvas_size>).
457
457
  * @returns Returns 2D coordinates if the point is visible on screen, or `null` if object is outside screen.
@@ -513,8 +513,7 @@ export declare class Cognite3DViewer {
513
513
  * @param offsetY Y coordinate in pixels (relative to the domElement).
514
514
  * @returns A promise that if there was an intersection then return the intersection object - otherwise it
515
515
  * returns `null` if there were no intersections.
516
- * @see {@link https://en.wikipedia.org/wiki/Ray_casting}.
517
- *
516
+ * @see {@link https://en.wikipedia.org/wiki/Ray_casting} For more details on Ray casting.
518
517
  * @example For CAD model
519
518
  * ```js
520
519
  * const offsetX = 50 // pixels from the left
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognite/reveal",
3
- "version": "4.1.1-dev.20230303",
3
+ "version": "4.1.1-dev.20230307",
4
4
  "description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
5
5
  "homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
6
6
  "repository": {
@@ -55,12 +55,6 @@
55
55
  "coverage": "yarn run build:wasm-test && cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage",
56
56
  "lint": "eslint . --ext .ts,.js --max-warnings 0 --cache",
57
57
  "update-api": "api-extractor run --local && shx rm -rf api-extractor-temp/",
58
- "prebump": "yarn version --no-git-tag-version && yarn && cd ../documentation && yarn replace-latest-by-next",
59
- "bump": " yarn bump:commit && yarn bump:tag && yarn bump:push",
60
- "bump:commit": "git add -A && cross-var git commit -m \"chore(viewer): bump version $npm_package_version\"",
61
- "bump:tag": "cross-var git tag $npm_package_name@$npm_package_version",
62
- "bump:push": "git push -u origin head && git push --tags",
63
- "release": "yarn build:prod && cd dist && yarn publish --non-interactive",
64
58
  "ws:serve": "yarn run build:wasm && webpack-dev-server --config packages/webpack.config.js",
65
59
  "ws:test": "cd $INIT_CWD && jest --runInBand",
66
60
  "ws:test:wasm": "cd $INIT_CWD && wasm-pack test --chrome --headless ./wasm",
@@ -81,37 +75,36 @@
81
75
  "rxjs": "7.8.0",
82
76
  "skmeans": "0.11.3",
83
77
  "sparse-octree": "7.1.6",
84
- "three-stdlib": "2.21.1"
78
+ "three-stdlib": "2.21.8"
85
79
  },
86
80
  "devDependencies": {
87
81
  "@azure/msal-browser": "2.33.0",
88
- "@cognite/sdk": "7.18.0",
82
+ "@cognite/sdk": "7.19.1",
89
83
  "@microsoft/api-extractor": "^7.33.6",
90
84
  "@types/dat.gui": "0.7.7",
91
85
  "@types/gl": "^6.0.2",
92
- "@types/glob": "8.0.0",
86
+ "@types/glob": "8.1.0",
93
87
  "@types/jest": "29.4.0",
94
88
  "@types/jest-environment-puppeteer": "5.0.3",
95
89
  "@types/jest-image-snapshot": "6.1.0",
96
90
  "@types/jsdom": "21.1.0",
97
91
  "@types/lodash": "4.14.191",
98
92
  "@types/mixpanel-browser": "2.38.1",
99
- "@types/node": "18.11.3",
93
+ "@types/node": "18.14.4",
100
94
  "@types/random-seed": "0.3.3",
101
95
  "@types/skmeans": "0.11.4",
102
96
  "@types/stats": "0.16.30",
103
97
  "@types/three": "0.149.0",
104
98
  "@types/tween.js": "18.5.1",
105
- "@typescript-eslint/eslint-plugin": "5.52.0",
106
- "@typescript-eslint/parser": "5.52.0",
99
+ "@typescript-eslint/eslint-plugin": "5.54.0",
100
+ "@typescript-eslint/parser": "5.54.0",
107
101
  "concurrently": "7.6.0",
108
102
  "cross-env": "7.0.3",
109
- "cross-var": "1.1.0",
110
103
  "dat.gui": "0.7.9",
111
- "eslint": "8.26.0",
112
- "eslint-config-prettier": "8.6.0",
104
+ "eslint": "8.35.0",
105
+ "eslint-config-prettier": "8.7.0",
113
106
  "eslint-plugin-header": "3.1.1",
114
- "eslint-plugin-jsdoc": "39.3.13",
107
+ "eslint-plugin-jsdoc": "40.0.0",
115
108
  "eslint-plugin-lodash": "7.4.0",
116
109
  "eslint-plugin-prettier": "4.2.1",
117
110
  "eslint-plugin-unused-imports": "2.0.0",
@@ -123,15 +116,15 @@
123
116
  "jest": "29.4.3",
124
117
  "jest-canvas-mock": "2.4.0",
125
118
  "jest-environment-jsdom": "29.4.3",
126
- "jest-extended": "3.2.3",
119
+ "jest-extended": "3.2.4",
127
120
  "jest-image-snapshot": "6.1.0",
128
- "jest-puppeteer": "7.0.0",
121
+ "jest-puppeteer": "7.0.1",
129
122
  "jsdom": "21.1.0",
130
123
  "moq.ts": "10.0.2",
131
124
  "nock": "13.3.0",
132
- "prettier": "2.8.2",
125
+ "prettier": "2.8.4",
133
126
  "process": "0.11.10",
134
- "puppeteer": "19.7.1",
127
+ "puppeteer": "19.7.2",
135
128
  "random-seed": "0.3.0",
136
129
  "raw-loader": "4.0.2",
137
130
  "remove-files-webpack-plugin": "1.5.0",