From 4396a1648153eddee7e78073e8712ff57c9ac369 Mon Sep 17 00:00:00 2001 From: Ruben Thoms Date: Wed, 27 Nov 2024 17:00:23 +0100 Subject: [PATCH] wip --- python/package-lock.json | 355 +++++++++--------- python/package.json | 3 +- .../SubsurfaceViewer/SubsurfaceViewer.tsx | 26 +- python/webpack.config.js | 2 +- .../subsurface-viewer/src/components/View.tsx | 29 ++ .../useMultiViewCursorTracking.ts | 25 +- .../useMultiViewPicking.ts | 12 +- 7 files changed, 237 insertions(+), 215 deletions(-) create mode 100644 typescript/packages/subsurface-viewer/src/components/View.tsx diff --git a/python/package-lock.json b/python/package-lock.json index dedab73c8d..88a40b0608 100644 --- a/python/package-lock.json +++ b/python/package-lock.json @@ -10,7 +10,8 @@ "hasInstallScript": true, "license": "MPL", "dependencies": { - "@deck.gl/core": "^8.9.35", + "@deck.gl/core": "^9.0.36", + "@deck.gl/react": "^9.0.36", "@emerson-eps/color-tables": "^0.4.85", "@equinor/eds-core-react": "0.33.0", "@equinor/eds-icons": "^0.19.1", @@ -74,7 +75,7 @@ }, "../typescript/packages/group-tree-plot": { "name": "@webviz/group-tree-plot", - "version": "1.3.15", + "version": "1.3.20", "license": "MPL-2.0", "dependencies": { "d3": "^7.8.2", @@ -87,18 +88,18 @@ }, "../typescript/packages/subsurface-viewer": { "name": "@webviz/subsurface-viewer", - "version": "1.1.1", + "version": "1.3.1", "license": "MPL-2.0", "dependencies": { "@deck.gl-community/editable-layers": "^9.0.3", - "@deck.gl/aggregation-layers": "^9.0.33", - "@deck.gl/core": "^9.0.33", - "@deck.gl/extensions": "^9.0.33", - "@deck.gl/geo-layers": "^9.0.33", - "@deck.gl/json": "^9.0.33", - "@deck.gl/layers": "^9.0.33", - "@deck.gl/mesh-layers": "^9.0.33", - "@deck.gl/react": "^9.0.33", + "@deck.gl/aggregation-layers": "^9.0.36", + "@deck.gl/core": "^9.0.36", + "@deck.gl/extensions": "^9.0.36", + "@deck.gl/geo-layers": "^9.0.36", + "@deck.gl/json": "^9.0.36", + "@deck.gl/layers": "^9.0.36", + "@deck.gl/mesh-layers": "^9.0.36", + "@deck.gl/react": "^9.0.36", "@emerson-eps/color-tables": "^0.4.85", "@equinor/eds-core-react": "^0.36.0", "@equinor/eds-icons": "^0.21.0", @@ -115,10 +116,10 @@ "math.gl": "^4.0.1", "mathjs": "^13.2.0", "merge-refs": "^1.2.2", - "workerpool": "^9.1.3" + "workerpool": "^9.2.0" }, "devDependencies": { - "@reduxjs/toolkit": "^2.2.8", + "@reduxjs/toolkit": "^2.3.0", "react-redux": "^9.1.2" }, "peerDependencies": { @@ -143,7 +144,7 @@ }, "../typescript/packages/well-completions-plot": { "name": "@webviz/well-completions-plot", - "version": "1.5.11", + "version": "1.5.16", "license": "MPL-2.0", "dependencies": { "react-resize-detector": "^11.0.1", @@ -155,7 +156,7 @@ }, "../typescript/packages/well-log-viewer": { "name": "@webviz/well-log-viewer", - "version": "2.1.6", + "version": "2.2.1", "license": "MPL-2.0", "dependencies": { "@emerson-eps/color-tables": "^0.4.85", @@ -165,7 +166,7 @@ "d3": "^7.8.2" }, "devDependencies": { - "@reduxjs/toolkit": "^2.2.8", + "@reduxjs/toolkit": "^2.3.0", "react-redux": "^9.1.2" }, "peerDependencies": { @@ -179,10 +180,10 @@ }, "../typescript/packages/wsc-common": { "name": "@webviz/wsc-common", - "version": "1.0.6", + "version": "1.0.11", "license": "MPL-2.0", "dependencies": { - "@deck.gl/core": "^9.0.33", + "@deck.gl/core": "^9.0.36", "ajv": "^8.12.0" } }, @@ -557,27 +558,38 @@ "license": "MIT" }, "node_modules/@deck.gl/core": { - "version": "8.9.35", - "resolved": "https://registry.npmjs.org/@deck.gl/core/-/core-8.9.35.tgz", - "integrity": "sha512-xOASWScUCB5fpfuSjPaJrwas8pCJpbKXNIfwQElhvnfP3Yk8GGkAcRbPgiPNCfpkbEno7eDpAWJt6+6UJsSp9g==", - "dependencies": { - "@babel/runtime": "^7.0.0", - "@loaders.gl/core": "^3.4.13", - "@loaders.gl/images": "^3.4.13", - "@luma.gl/constants": "^8.5.21", - "@luma.gl/core": "^8.5.21", - "@luma.gl/webgl": "^8.5.21", - "@math.gl/core": "^3.6.2", - "@math.gl/sun": "^3.6.2", - "@math.gl/web-mercator": "^3.6.2", - "@probe.gl/env": "^3.5.0", - "@probe.gl/log": "^3.5.0", - "@probe.gl/stats": "^3.5.0", + "version": "9.0.36", + "resolved": "https://registry.npmjs.org/@deck.gl/core/-/core-9.0.36.tgz", + "integrity": "sha512-Muhty9C5smnITbx7XoiiG465DI+qpNT7y2yfQPPdBYrUkKLYTD9qJRMHZcLcwSuEJj6JmopmkcqOpraxiOc0Ew==", + "dependencies": { + "@loaders.gl/core": "^4.2.0", + "@loaders.gl/images": "^4.2.0", + "@luma.gl/constants": "~9.0.27", + "@luma.gl/core": "~9.0.27", + "@luma.gl/engine": "~9.0.27", + "@luma.gl/shadertools": "~9.0.27", + "@luma.gl/webgl": "~9.0.27", + "@math.gl/core": "^4.0.0", + "@math.gl/sun": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/env": "^4.0.9", + "@probe.gl/log": "^4.0.9", + "@probe.gl/stats": "^4.0.9", + "@types/offscreencanvas": "^2019.6.4", "gl-matrix": "^3.0.0", - "math.gl": "^3.6.2", "mjolnir.js": "^2.7.0" } }, + "node_modules/@deck.gl/react": { + "version": "9.0.36", + "resolved": "https://registry.npmjs.org/@deck.gl/react/-/react-9.0.36.tgz", + "integrity": "sha512-x7EaxkUCT2N9x6rPyL+Lchh3CvitZLZI8G4QvXvlwglvdamUCI42L7+91HecpI5DDYkxuZluql2c9TWGoC7TXQ==", + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "react": ">=16.3.0", + "react-dom": ">=16.3.0" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "dev": true, @@ -1174,132 +1186,124 @@ "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" }, "node_modules/@loaders.gl/core": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-3.4.14.tgz", - "integrity": "sha512-5PFcjv7xC8AYL17juDMrvo8n0Fcwg9s8F4BaM2YCNUsb9RCI2SmLuIFJMcx1GgHO5vL0WiTIKO+JT4n1FuNR6w==", - "dependencies": { - "@babel/runtime": "^7.3.1", - "@loaders.gl/loader-utils": "3.4.14", - "@loaders.gl/worker-utils": "3.4.14", - "@probe.gl/log": "^4.0.1" - } - }, - "node_modules/@loaders.gl/core/node_modules/@probe.gl/env": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-4.0.4.tgz", - "integrity": "sha512-sYNGqesDfWD6dFP5oNZtTeFA4Z6ak5T4a8BNPdNhoqy7PK9w70JHrb6mv+RKWqKXq33KiwCDWL7fYxx2HuEH2w==", - "dependencies": { - "@babel/runtime": "^7.0.0" - } - }, - "node_modules/@loaders.gl/core/node_modules/@probe.gl/log": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-4.0.4.tgz", - "integrity": "sha512-WpmXl6njlBMwrm8HBh/b4kSp/xnY1VVmeT4PWUKF+RkVbFuKQbsU11dA1IxoMd7gSY+5DGIwxGfAv1H5OMzA4A==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-4.3.3.tgz", + "integrity": "sha512-RaQ3uNg4ZaVqDRgvJ2CjaOjeeHdKvbKuzFFgbGnflVB9is5bu+h3EKc3Jke7NGVvLBsZ6oIXzkwHijVsMfxv8g==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@probe.gl/env": "4.0.4" + "@loaders.gl/loader-utils": "4.3.3", + "@loaders.gl/schema": "4.3.3", + "@loaders.gl/worker-utils": "4.3.3", + "@probe.gl/log": "^4.0.2" } }, "node_modules/@loaders.gl/images": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-3.4.14.tgz", - "integrity": "sha512-tL447hTWhOKBOB87SE4hvlC8OkbRT0mEaW1a/wIS9f4HnYDa/ycRLMV+nvdvYMZur4isNPam44oiRqi7GcILkg==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-4.3.3.tgz", + "integrity": "sha512-s4InjIXqEu0T7anZLj4OBUuDBt2BNnAD0GLzSexSkBfQZfpXY0XJNl4mMf5nUKb5NDfXhIKIqv8y324US+I28A==", + "license": "MIT", "dependencies": { - "@loaders.gl/loader-utils": "3.4.14" + "@loaders.gl/loader-utils": "4.3.3" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.3.0" } }, "node_modules/@loaders.gl/loader-utils": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-3.4.14.tgz", - "integrity": "sha512-HCTY2/F83RLbZWcTvWLVJ1vke3dl6Bye20HU1AqkA37J2vzHwOZ8kj6eee8eeSkIkf7VIFwjyhVJxe0flQE/Bw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-4.3.3.tgz", + "integrity": "sha512-8erUIwWLiIsZX36fFa/seZsfTsWlLk72Sibh/YZJrPAefuVucV4mGGzMBZ96LE2BUfJhadn250eio/59TUFbNw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.3.1", - "@loaders.gl/worker-utils": "3.4.14", - "@probe.gl/stats": "^4.0.1" + "@loaders.gl/schema": "4.3.3", + "@loaders.gl/worker-utils": "4.3.3", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.3.0" } }, - "node_modules/@loaders.gl/loader-utils/node_modules/@probe.gl/stats": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-4.0.4.tgz", - "integrity": "sha512-SDuSY/D4yDL6LQDa69l/GCcnZLRiGYdyvYkxWb0CgnzTPdPrcdrzGkzkvpC3zsA4fEFw2smlDje370QGHwlisg==", + "node_modules/@loaders.gl/schema": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-4.3.3.tgz", + "integrity": "sha512-zacc9/8je+VbuC6N/QRfiTjRd+BuxsYlddLX1u5/X/cg9s36WZZBlU1oNKUgTYe8eO6+qLyYx77yi+9JbbEehw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0" + "@types/geojson": "^7946.0.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.3.0" } }, "node_modules/@loaders.gl/worker-utils": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-3.4.14.tgz", - "integrity": "sha512-PUSwxoAYbskisXd0KfYEQ902b0igBA2UAWdP6PzPvY+tJmobfh74dTNwrrBQ1rGXQxxmGx6zc6/ksX6mlIzIrg==", - "dependencies": { - "@babel/runtime": "^7.3.1" + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-4.3.3.tgz", + "integrity": "sha512-eg45Ux6xqsAfqPUqJkhmbFZh9qfmYuPfA+34VcLtfeXIwAngeP6o4SrTmm9LWLGUKiSh47anCEV1p7borDgvGQ==", + "license": "MIT", + "peerDependencies": { + "@loaders.gl/core": "^4.3.0" } }, "node_modules/@luma.gl/constants": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/constants/-/constants-8.5.21.tgz", - "integrity": "sha512-aJxayGxTT+IRd1vfpcgD/cKSCiVJjBNiuiChS96VulrmCvkzUOLvYXr42y5qKB4RyR7vOIda5uQprNzoHrhQAA==" + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@luma.gl/constants/-/constants-9.0.27.tgz", + "integrity": "sha512-NBkMim3u0xt4UDe4e69L6E/pq5XNxfX60GrggJDzfilVRfIbx5XwKhBXTyNjjtNEk4oc6uYLHWd/05jGRHcfLg==", + "license": "MIT" }, "node_modules/@luma.gl/core": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/core/-/core-8.5.21.tgz", - "integrity": "sha512-11jQJQEMoR/IN2oIsd4zFxiQJk6FE+xgVIMUcsCTBuzafTtQZ8Po9df8mt+MVewpDyBlTVs6g8nxHRH4np1ukA==", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@luma.gl/core/-/core-9.0.27.tgz", + "integrity": "sha512-7OXM8ZknTuqt10nL8XHg3YzaHESzU2pSh+6BknLJbLM+UjNWOkDHArF6pRYu96Om0QsnOMK/RXKqXBr+Ni0gvw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/engine": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@luma.gl/shadertools": "8.5.21", - "@luma.gl/webgl": "8.5.21" + "@math.gl/types": "^4.0.0", + "@probe.gl/env": "^4.0.2", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2", + "@types/offscreencanvas": "^2019.6.4" } }, "node_modules/@luma.gl/engine": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/engine/-/engine-8.5.21.tgz", - "integrity": "sha512-IG3WQSKXFNUEs8QG7ZjHtGiOtsakUu+BAxtJ6997A6/F06yynZ44tPe5NU70jG9Yfu3kV0LykPZg7hO3vXZDiA==", - "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@luma.gl/shadertools": "8.5.21", - "@luma.gl/webgl": "8.5.21", - "@math.gl/core": "^3.5.0", - "@probe.gl/env": "^3.5.0", - "@probe.gl/stats": "^3.5.0", - "@types/offscreencanvas": "^2019.7.0" - } - }, - "node_modules/@luma.gl/gltools": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/gltools/-/gltools-8.5.21.tgz", - "integrity": "sha512-6qZ0LaT2Mxa4AJT5F44TFoaziokYiHUwO45vnM/NYUOIu9xevcmS6VtToawytMEACGL6PDeDyVqP3Y80SDzq5g==", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@luma.gl/engine/-/engine-9.0.27.tgz", + "integrity": "sha512-O4e7RbIjBJX5WLs8HJLjpccYEkcans4pz8+TI8Y7BO7gDq9ZbEASbVd5CT53jFLfTjnRuqAOpElfaXwQ/B7oWg==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@probe.gl/env": "^3.5.0", - "@probe.gl/log": "^3.5.0", - "@types/offscreencanvas": "^2019.7.0" + "@luma.gl/shadertools": "9.0.27", + "@math.gl/core": "^4.0.0", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, "node_modules/@luma.gl/shadertools": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/shadertools/-/shadertools-8.5.21.tgz", - "integrity": "sha512-WQah7yFDJ8cNCLPYpIm3r0wSlXLvjoA279fcknmATvvkW3/i8PcCJ/nYEBJO3hHEwwMQxD16+YZu/uwGiifLMg==", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@luma.gl/shadertools/-/shadertools-9.0.27.tgz", + "integrity": "sha512-JcOuYH2Fh4uljinXKbR04en1dqEthlJNdqV5efQ0fE9NetJul7Pkq+N1v/Oo8/vmJn9ZqEC49dgZHwtbzY8UnQ==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@math.gl/core": "^3.5.0" + "@math.gl/core": "^4.0.0", + "@math.gl/types": "^4.0.0", + "wgsl_reflect": "^1.0.1" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, "node_modules/@luma.gl/webgl": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/webgl/-/webgl-8.5.21.tgz", - "integrity": "sha512-ZVLO4W5UuaOlzZIwmFWhnmZ1gYoU97a+heMqxLrSSmCUAsSu3ZETUex9gOmzdM1WWxcdWaa3M68rvKCNEgwz0Q==", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@luma.gl/webgl/-/webgl-9.0.27.tgz", + "integrity": "sha512-GOzOiDfTFgT4If1XSeCqXswKrgXVwTyuf/1W21Vv7fs5inub5p3LISmZglrt/RcdaGyXQQ5zEqf/+x67dGTeYw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@probe.gl/env": "^3.5.0", - "@probe.gl/stats": "^3.5.0" + "@luma.gl/constants": "9.0.27", + "@probe.gl/env": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, "node_modules/@material-ui/types": { @@ -1316,35 +1320,33 @@ } }, "node_modules/@math.gl/core": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-3.6.3.tgz", - "integrity": "sha512-jBABmDkj5uuuE0dTDmwwss7Cup5ZwQ6Qb7h1pgvtkEutTrhkcv8SuItQNXmF45494yIHeoGue08NlyeY6wxq2A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-4.1.0.tgz", + "integrity": "sha512-FrdHBCVG3QdrworwrUSzXIaK+/9OCRLscxI2OUy6sLOHyHgBMyfnEGs99/m3KNvs+95BsnQLWklVfpKfQzfwKA==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.0", - "@math.gl/types": "3.6.3", - "gl-matrix": "^3.4.0" + "@math.gl/types": "4.1.0" } }, "node_modules/@math.gl/sun": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/sun/-/sun-3.6.3.tgz", - "integrity": "sha512-mrx6CGYYeTNSQttvcw0KVUy+35YDmnjMqpO/o0t06Vcghrt0HNruB/ScRgUSbJrgkbOg1Vcqm23HBd++clzQzw==", - "dependencies": { - "@babel/runtime": "^7.12.0" - } + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@math.gl/sun/-/sun-4.1.0.tgz", + "integrity": "sha512-i3q6OCBLSZ5wgZVhXg+X7gsjY/TUtuFW/2KBiq/U1ypLso3S4sEykoU/MGjxUv1xiiGtr+v8TeMbO1OBIh/HmA==", + "license": "MIT" }, "node_modules/@math.gl/types": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-3.6.3.tgz", - "integrity": "sha512-3uWLVXHY3jQxsXCr/UCNPSc2BG0hNUljhmOBt9l+lNFDp7zHgm0cK2Tw4kj2XfkJy4TgwZTBGwRDQgWEbLbdTA==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-4.1.0.tgz", + "integrity": "sha512-clYZdHcmRvMzVK5fjeDkQlHUzXQSNdZ7s4xOqC3nJPgz4C/TZkUecTo9YS4PruZqtDda/ag4erndP0MIn40dGA==", + "license": "MIT" }, "node_modules/@math.gl/web-mercator": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-3.6.3.tgz", - "integrity": "sha512-UVrkSOs02YLehKaehrxhAejYMurehIHPfFQvPFZmdJHglHOU4V2cCUApTVEwOksvCp161ypEqVp+9H6mGhTTcw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-4.1.0.tgz", + "integrity": "sha512-HZo3vO5GCMkXJThxRJ5/QYUYRr3XumfT8CzNNCwoJfinxy5NtKUd7dusNTXn7yJ40UoB8FMIwkVwNlqaiRZZAw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.0", - "gl-matrix": "^3.4.0" + "@math.gl/core": "4.1.0" } }, "node_modules/@mui/base": { @@ -1835,29 +1837,25 @@ } }, "node_modules/@probe.gl/env": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-3.6.0.tgz", - "integrity": "sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==", - "dependencies": { - "@babel/runtime": "^7.0.0" - } + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-4.0.9.tgz", + "integrity": "sha512-AOmVMD0/j78mX+k4+qX7ZhE0sY9H+EaJgIO6trik0BwV6VcrwxTGCGFAeuRsIGhETDnye06tkLXccYatYxAYwQ==", + "license": "MIT" }, "node_modules/@probe.gl/log": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-3.6.0.tgz", - "integrity": "sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-4.0.9.tgz", + "integrity": "sha512-ebuZaodSRE9aC+3bVC7cKRHT8garXeT1jTbj1R5tQRqQYc9iGeT3iemVOHx5bN9Q6gAs/0j54iPI+1DvWMAW4A==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.0.0", - "@probe.gl/env": "3.6.0" + "@probe.gl/env": "4.0.9" } }, "node_modules/@probe.gl/stats": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.6.0.tgz", - "integrity": "sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==", - "dependencies": { - "@babel/runtime": "^7.0.0" - } + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-4.0.9.tgz", + "integrity": "sha512-Q9Xt/sJUQaMsbjRKjOscv2t7wXIymTrOEJ4a3da4FTCn7bkKvcdxdyFAQySCrtPxE+YZ5I5lXpWPgv9BwmpE1g==", + "license": "MIT" }, "node_modules/@react-hook/latest": { "version": "1.0.3", @@ -2254,8 +2252,7 @@ "node_modules/@types/geojson": { "version": "7946.0.11", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", - "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==", - "dev": true + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==" }, "node_modules/@types/hammerjs": { "version": "2.0.42", @@ -2347,9 +2344,10 @@ "license": "MIT" }, "node_modules/@types/offscreencanvas": { - "version": "2019.7.1", - "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.1.tgz", - "integrity": "sha512-+HSrJgjBW77ALieQdMJvXhRZUIRN1597L+BKvsyeiIlHHERnqjcuOLyodK3auJ3Y3zRezNKtKAhuQWYJfEgFHQ==" + "version": "2019.7.3", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", + "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==", + "license": "MIT" }, "node_modules/@types/parse-json": { "version": "4.0.2", @@ -6099,7 +6097,8 @@ "node_modules/gl-matrix": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", - "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", + "license": "MIT" }, "node_modules/glob": { "version": "7.2.3", @@ -7623,14 +7622,6 @@ "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" }, - "node_modules/math.gl": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/math.gl/-/math.gl-3.6.3.tgz", - "integrity": "sha512-Yq9CyECvSDox9+5ETi2+x1bGTY5WvGUGL3rJfC4KPoCZAM51MGfrCm6rIn4yOJUVfMPs2a5RwMD+yGS/n1g3gg==", - "dependencies": { - "@math.gl/core": "3.6.3" - } - }, "node_modules/mathjs": { "version": "9.5.2", "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-9.5.2.tgz", @@ -12016,6 +12007,12 @@ "node": ">=10.13.0" } }, + "node_modules/wgsl_reflect": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/wgsl_reflect/-/wgsl_reflect-1.0.16.tgz", + "integrity": "sha512-OE3urfXXbHMD5lhKZwxOxC9SFYynEGEkWXQmvi7B1gzzr5jb9+drh9A8MeBvVqKqznCoBuh8WOzVuSGSZs4CkQ==", + "license": "MIT" + }, "node_modules/which": { "version": "2.0.2", "dev": true, diff --git a/python/package.json b/python/package.json index 46112a02f3..ac407b45e3 100644 --- a/python/package.json +++ b/python/package.json @@ -28,7 +28,8 @@ "validate": "npm run typecheck && npm run lint" }, "dependencies": { - "@deck.gl/core": "^8.9.35", + "@deck.gl/core": "^9.0.36", + "@deck.gl/react": "^9.0.36", "@emerson-eps/color-tables": "^0.4.85", "@equinor/eds-core-react": "0.33.0", "@equinor/eds-icons": "^0.19.1", diff --git a/python/src/components/SubsurfaceViewer/SubsurfaceViewer.tsx b/python/src/components/SubsurfaceViewer/SubsurfaceViewer.tsx index c4fdb2fcf8..d00a5d96ad 100644 --- a/python/src/components/SubsurfaceViewer/SubsurfaceViewer.tsx +++ b/python/src/components/SubsurfaceViewer/SubsurfaceViewer.tsx @@ -4,7 +4,7 @@ import { SubsurfaceViewerProps, ViewStateType, } from "@webviz/subsurface-viewer"; -import { DeckGLRef, View } from "@deck.gl/core"; +import { DeckGLRef } from "@deck.gl/react"; import { useMultiViewPicking } from "@webviz/subsurface-viewer/src/hooks/useMultiViewPicking"; import { useMultiViewCursorTracking } from "@webviz/subsurface-viewer/src/hooks/useMultiViewCursorTracking"; import { isEqual } from "lodash"; @@ -19,13 +19,13 @@ const SubsurfaceViewerComponent = React.lazy(() => ); const SubsurfaceViewer: React.FC = (props) => { - const { children, ...rest } = props; + const { views, children, ...rest } = props; - if (!props.views) { + if (!views) { return ( Loading...}> - {children ? mapAnnotation(children) : null} + {children} ); @@ -33,8 +33,8 @@ const SubsurfaceViewer: React.FC = (props) => { return ( Loading...}> - - {children ? mapAnnotation(children) : null} + + {children} ); @@ -64,7 +64,7 @@ function MultiViewSubsurfaceViewer( useMultiViewPicking({ deckGlRef, multiPicking: true, - pickDepth: 2, + pickDepth: 1, }); const handleMouseEvent = React.useCallback( @@ -128,18 +128,6 @@ function MultiViewSubsurfaceViewer( ); } -function mapAnnotation(annotationContainers: React.ReactNode) { - return React.Children.map(annotationContainers, (annotationContainer) => { - const viewId = (annotationContainer as React.ReactElement).key; - return ( - // @ts-expect-error This is proven to work in JavaScript - - {annotationContainer} - - ); - }); -} - SubsurfaceViewer.displayName = "SubsurfaceViewer"; export default SubsurfaceViewer; diff --git a/python/webpack.config.js b/python/webpack.config.js index d3acfa6fd9..9581b2b6e7 100644 --- a/python/webpack.config.js +++ b/python/webpack.config.js @@ -125,7 +125,7 @@ module.exports = function (env, argv) { ], }, optimization: { - minimize: true, + minimize: false, splitChunks: { name: "[name].js", cacheGroups: { diff --git a/typescript/packages/subsurface-viewer/src/components/View.tsx b/typescript/packages/subsurface-viewer/src/components/View.tsx new file mode 100644 index 0000000000..f852d186ee --- /dev/null +++ b/typescript/packages/subsurface-viewer/src/components/View.tsx @@ -0,0 +1,29 @@ +import { Deck, Viewport, View } from "@deck.gl/core"; +import { DeckGLRef } from "@deck.gl/react"; +import React from "react"; + +export type ViewProps = { + id: string; + deckGlRef: React.RefObject; + children?: React.ReactNode; +}; + +export function ViewContent(props: ViewProps): React.ReactNode { + const deckRef = React.useRef(null); + + React.useEffect( + function onMount() { + if (props.deckGlRef.current) { + deckRef.current = props.deckGlRef.current.deck ?? null; + if (deckRef.current) { + const views = deckRef.current.getViews(); + const view = views.find((v) => v.id === props.id); + if (view) { + deckRef.current.props.onViewStateChange + } + } + } + }, + [props.deckGlRef] + ); +} \ No newline at end of file diff --git a/typescript/packages/subsurface-viewer/src/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.ts b/typescript/packages/subsurface-viewer/src/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.ts index 2eafde60e7..b483424101 100644 --- a/typescript/packages/subsurface-viewer/src/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.ts +++ b/typescript/packages/subsurface-viewer/src/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.ts @@ -1,8 +1,10 @@ import React from "react"; -import { CrosshairLayer, CrosshairLayerProps } from "../../layers"; -import { ViewportType } from "../../views/viewport"; -import { TLayerDefinition } from "../../SubsurfaceViewer"; import { v4 } from "uuid"; +import { CrosshairLayer } from "../../layers"; + +import type { CrosshairLayerProps } from "../../layers"; +import type { ViewportType } from "../../views/viewport"; +import type { TLayerDefinition } from "../../SubsurfaceViewer"; export type UseMultiViewCursorTrackingProps = { worldCoordinates: number[] | null; @@ -22,12 +24,17 @@ export function useMultiViewCursorTracking( ): UseMultiViewCursorTrackingReturnType { const id = React.useRef(`crosshair-${v4()}`); - const worldCoordinates: [number, number, number] | null = - props.worldCoordinates?.length === 3 - ? (props.worldCoordinates as [number, number, number]) - : props.worldCoordinates?.length === 2 - ? ([...props.worldCoordinates, 0] as [number, number, number]) - : null; + let worldCoordinates: [number, number, number] | null = null; + if (props.worldCoordinates?.length === 3) { + worldCoordinates = props.worldCoordinates as [number, number, number]; + } + if (props.worldCoordinates?.length === 2) { + worldCoordinates = [...props.worldCoordinates, 0] as [ + number, + number, + number, + ]; + } const crosshairLayer = new CrosshairLayer({ id: id.current, diff --git a/typescript/packages/subsurface-viewer/src/hooks/useMultiViewPicking/useMultiViewPicking.ts b/typescript/packages/subsurface-viewer/src/hooks/useMultiViewPicking/useMultiViewPicking.ts index d6b79724c8..00b7c38000 100644 --- a/typescript/packages/subsurface-viewer/src/hooks/useMultiViewPicking/useMultiViewPicking.ts +++ b/typescript/packages/subsurface-viewer/src/hooks/useMultiViewPicking/useMultiViewPicking.ts @@ -1,10 +1,10 @@ -import { DeckGLRef } from "@deck.gl/react"; -import { - MultiViewPickingInfoAssembler, - PickingInfoPerView, -} from "./MultiViewPickingInfoAssembler"; import React from "react"; -import { MapMouseEvent } from "../../SubsurfaceViewer"; + +import { MultiViewPickingInfoAssembler } from "./MultiViewPickingInfoAssembler"; + +import type { DeckGLRef } from "@deck.gl/react"; +import type { PickingInfoPerView } from "./MultiViewPickingInfoAssembler"; +import type { MapMouseEvent } from "../../SubsurfaceViewer"; export type UseMultiViewPickingProps = { deckGlRef: React.RefObject;