From 156c3a5c3a04b31be6e039deb211eb75d5be28ba Mon Sep 17 00:00:00 2001 From: Mucahit Bilal GOKER <51519350+bimgeek@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:02:00 +0300 Subject: [PATCH 1/2] return model id instead of name (#81) --- src/powerbi-data-connector/speckle/helpers/ParseStreamUrl.pqm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powerbi-data-connector/speckle/helpers/ParseStreamUrl.pqm b/src/powerbi-data-connector/speckle/helpers/ParseStreamUrl.pqm index f858da7..a804e70 100644 --- a/src/powerbi-data-connector/speckle/helpers/ParseStreamUrl.pqm +++ b/src/powerbi-data-connector/speckle/helpers/ParseStreamUrl.pqm @@ -63,7 +63,7 @@ let urlType = urlType, server = server, id = streamId, - branch = model[name], + branch = modelId, commit = versionId, object = null ] From 8edc01b7d6174c60be68488672b36f5f4c8dae0f Mon Sep 17 00:00:00 2001 From: Alan Rynne Date: Tue, 5 Nov 2024 11:26:09 +0100 Subject: [PATCH 2/2] fix: Update viewer to version 2.21.0 (#82) --- src/powerbi-visual/package-lock.json | 145 ++++++++++++++---- src/powerbi-visual/package.json | 2 +- .../src/handlers/viewerHandler.ts | 16 +- src/powerbi-visual/src/utils/viewerUtils.ts | 3 +- 4 files changed, 124 insertions(+), 42 deletions(-) diff --git a/src/powerbi-visual/package-lock.json b/src/powerbi-visual/package-lock.json index c07de70..44d2d0e 100644 --- a/src/powerbi-visual/package-lock.json +++ b/src/powerbi-visual/package-lock.json @@ -6,6 +6,7 @@ "packages": { "": { "name": "@specklesystems/powerbi-visual", + "version": "2.0.0", "license": "MIT", "dependencies": { "@babel/runtime": "^7.21.5", @@ -14,7 +15,7 @@ "@heroicons/vue": "^2.0.12", "@speckle/tailwind-theme": "2.14.7", "@speckle/ui-components": "2.14.7", - "@speckle/viewer": "^2.18.14", + "@speckle/viewer": "^2.21.0", "color-interpolate": "^1.0.5", "core-js": "^3.30.2", "lodash": "^4.17.21", @@ -70,8 +71,7 @@ "webpack-bundle-analyzer": "^4.8.0", "webpack-cli": "^5.1.1", "webpack-dev-server": "^4.15.0" - }, - "version": "2.0.0" + } }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", @@ -2659,13 +2659,15 @@ } }, "node_modules/@speckle/objectloader": { - "version": "2.18.16", - "resolved": "https://registry.npmjs.org/@speckle/objectloader/-/objectloader-2.18.16.tgz", - "integrity": "sha512-YykdjxVkYlND+tgjHUL2I+Djaggm+w2v+UKZSIDSt7LVGIDg88JXJZ/JbO9B8ptx16i0E2oCQRuiTCntimoqZQ==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/@speckle/objectloader/-/objectloader-2.21.0.tgz", + "integrity": "sha512-kGsQ1UKDR8sYE2m2b5poVocH3bbmRWmvPPG/ST7td0QjsYBKWRFJAX8fDmT6PSwbtN8reA9wKRtMJoO2OJvjBA==", "dependencies": { "@babel/core": "^7.17.9", - "@speckle/shared": "^2.18.16", + "@speckle/shared": "^2.21.0", "core-js": "^3.21.1", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "regenerator-runtime": "^0.13.7" }, "engines": { @@ -2673,11 +2675,11 @@ } }, "node_modules/@speckle/shared": { - "version": "2.18.16", - "resolved": "https://registry.npmjs.org/@speckle/shared/-/shared-2.18.16.tgz", - "integrity": "sha512-I5/jmvbuOjDJYjFY04f3IsDnQ0/Rt6DQKekXWiuyfmuLUqsBvM9hbWZBsg3vPmvX2HFgfQxisZAD0bHwpNTb3A==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/@speckle/shared/-/shared-2.21.0.tgz", + "integrity": "sha512-g9DsCeliDwQsgHLrYXKpWSaFMoTQ5yOraiEUzdQFMZGmM9IZNRztq4/74YLS+Wy5MutT79KFYsOwng60IcaB/w==", "dependencies": { - "lodash": "^4.17.0", + "lodash": "^4.17.21", "lodash-es": "^4.17.21", "type-fest": "^3.11.1" }, @@ -2686,9 +2688,13 @@ }, "peerDependencies": { "@tiptap/core": "^2.0.0-beta.176", + "mixpanel": "^0.17.0", "pino": "^8.7.0", "pino-http": "^8.0.0", - "pino-pretty": ">=8.0.0" + "pino-pretty": ">=8.0.0", + "ua-parser-js": "^1.0.38", + "znv": "^0.4.0", + "zod": "^3.22.4" } }, "node_modules/@speckle/tailwind-theme": { @@ -2727,15 +2733,14 @@ } }, "node_modules/@speckle/viewer": { - "version": "2.18.16", - "resolved": "https://registry.npmjs.org/@speckle/viewer/-/viewer-2.18.16.tgz", - "integrity": "sha512-exIloJG6ZLDX5FgrxyTcbr1+7K3CXC8weKJkWc6d1nZITGiDZnPB6CG3ffEmudKEdbPirUpGuYX5QsqZvvcA5w==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/@speckle/viewer/-/viewer-2.21.0.tgz", + "integrity": "sha512-fok7WW0RTcJpe4HsRQd1wqq+ill+3o1eIAfAnHJuzLqMqqnO7e64bNE18b42fHJWOgC3FzQCmh/xPChpNU7w7w==", "dependencies": { - "@speckle/objectloader": "^2.18.16", - "@speckle/shared": "^2.18.16", + "@speckle/objectloader": "^2.21.0", + "@speckle/shared": "^2.21.0", "@types/flat": "^5.0.2", - "camera-controls": "^1.33.1", - "hold-event": "^0.1.0", + "flat": "^5.0.2", "js-logger": "1.6.1", "lodash-es": "^4.17.21", "string-to-color": "^2.2.2", @@ -3836,6 +3841,18 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4514,14 +4531,6 @@ "node": ">= 6" } }, - "node_modules/camera-controls": { - "version": "1.38.2", - "resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-1.38.2.tgz", - "integrity": "sha512-EfzbovxLssyWpJVG9uKcazSDDIEcd1hUsPhPF/OWWnICsKY9WbLY/2S4UPW73HHbvnVeR/Z9wsWaQKtANy/2Yg==", - "peerDependencies": { - "three": ">=0.126.1" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001625", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001625.tgz", @@ -6267,6 +6276,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "bin": { + "flat": "cli.js" + } + }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -6702,11 +6719,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hold-event": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/hold-event/-/hold-event-0.1.0.tgz", - "integrity": "sha512-k4RvgnpTn8ZIPmFoHYnSRfyhfUTV+L2K5ruuIHT2IdgJqvNc6BCHGd/fSck9imqxW25xsxONZo9NN1DPlnbnLg==" - }, "node_modules/hpack.js": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", @@ -6829,6 +6841,19 @@ "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", "dev": true }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -7935,6 +7960,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mixpanel": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/mixpanel/-/mixpanel-0.17.0.tgz", + "integrity": "sha512-DY5WeOy/hmkPrNiiZugJpWR0iMuOwuj1a3u0bgwB2eUFRV6oIew/pIahhpawdbNjb+Bye4a8ID3gefeNPvL81g==", + "peer": true, + "dependencies": { + "https-proxy-agent": "5.0.0" + }, + "engines": { + "node": ">=10.0" + } + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -12047,6 +12084,29 @@ "node": ">=12.20" } }, + "node_modules/ua-parser-js": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.38.tgz", + "integrity": "sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "peer": true, + "engines": { + "node": "*" + } + }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -12963,6 +13023,27 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/znv": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/znv/-/znv-0.4.0.tgz", + "integrity": "sha512-6/pGsQhBisLzKdyC90mUCRgYDtCfQ4aQ68sDybexq3GMzqqkp662GH6qIyuCHJC1i72hJPHbWAhccTJVuZUQfA==", + "peer": true, + "dependencies": { + "colorette": "^2.0.19" + }, + "peerDependencies": { + "zod": "^3.13.2" + } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/src/powerbi-visual/package.json b/src/powerbi-visual/package.json index a1add5a..4fad5a4 100644 --- a/src/powerbi-visual/package.json +++ b/src/powerbi-visual/package.json @@ -19,7 +19,7 @@ "@heroicons/vue": "^2.0.12", "@speckle/tailwind-theme": "2.14.7", "@speckle/ui-components": "2.14.7", - "@speckle/viewer": "^2.18.14", + "@speckle/viewer": "^2.21.0", "color-interpolate": "^1.0.5", "core-js": "^3.30.2", "lodash": "^4.17.21", diff --git a/src/powerbi-visual/src/handlers/viewerHandler.ts b/src/powerbi-visual/src/handlers/viewerHandler.ts index 655acfb..78cec58 100644 --- a/src/powerbi-visual/src/handlers/viewerHandler.ts +++ b/src/powerbi-visual/src/handlers/viewerHandler.ts @@ -6,7 +6,8 @@ import { DefaultViewerParams, Box3, SpeckleView, - CameraController + CameraController, + CameraEvent } from '@speckle/viewer' import { pickViewableHit, projectToScreen } from '../utils/viewerUtils' import _ from 'lodash' @@ -38,10 +39,9 @@ export default class ViewerHandler { break } - this.viewer.getExtension(CameraController).controls.maxPolarAngle = settings.camera - .allowCameraUnder.value - ? Math.PI - : Math.PI / 2 + var camController = this.viewer.getExtension(CameraController) + var angle = settings.camera.allowCameraUnder.value ? Math.PI : Math.PI / 2 + camController.options = { maximumPolarAngle: angle } // Lighting settings const newConfig = settings.lighting.getViewerConfiguration() @@ -72,7 +72,7 @@ export default class ViewerHandler { } public addCameraUpdateEventListener(listener: (ev) => void) { - this.viewer.getExtension(CameraController).controls.addEventListener('update', listener) + this.viewer.getExtension(CameraController).on(CameraEvent.LateFrameUpdate, listener) } public constructor(parent: HTMLElement) { @@ -213,13 +213,13 @@ export default class ViewerHandler { public getScreenPosition(worldPosition): { x: number; y: number } { return projectToScreen( - this.viewer.getExtension(CameraController).controls.camera, + this.viewer.getExtension(CameraController).renderingCamera, worldPosition ) } public dispose() { - this.viewer.getExtension(CameraController).controls.removeAllEventListeners() + this.viewer.getExtension(CameraController).dispose() this.viewer.dispose() this.viewer = null } diff --git a/src/powerbi-visual/src/utils/viewerUtils.ts b/src/powerbi-visual/src/utils/viewerUtils.ts index e08544d..b6cef7a 100644 --- a/src/powerbi-visual/src/utils/viewerUtils.ts +++ b/src/powerbi-visual/src/utils/viewerUtils.ts @@ -1,6 +1,7 @@ import { FilteringState } from '@speckle/viewer' +import { OrthographicCamera, PerspectiveCamera } from 'three' -export function projectToScreen(cam, loc) { +export function projectToScreen(cam: OrthographicCamera | PerspectiveCamera, loc) { cam.updateProjectionMatrix() const copy = loc.clone() copy.project(cam)