diff --git a/package-lock.json b/package-lock.json index c678cb3d..4fc9b634 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cosmos.gl/graph", - "version": "2.6.2", + "version": "2.6.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@cosmos.gl/graph", - "version": "2.6.2", + "version": "2.6.4", "license": "MIT", "dependencies": { "d3-array": "^3.2.0", diff --git a/package.json b/package.json index 8c665316..f7443c38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cosmos.gl/graph", - "version": "2.6.2", + "version": "2.6.4", "description": "GPU-based force graph layout and rendering", "jsdelivr": "dist/index.min.js", "main": "dist/index.js", @@ -19,7 +19,8 @@ "lint": "eslint --cache ./src --ext .ts --ignore-path .gitignore", "lint:staged": "npx lint-staged", "storybook": "storybook dev -p 6006", - "build:storybook": "storybook build" + "build:storybook": "storybook build", + "prepublishOnly": "npm run build:vite" }, "engines": { "node": ">=12.2.0", diff --git a/src/modules/Lines/index.ts b/src/modules/Lines/index.ts index 961bff4f..7951d324 100644 --- a/src/modules/Lines/index.ts +++ b/src/modules/Lines/index.ts @@ -259,7 +259,16 @@ export class Lines extends CoreModule { public findHoveredLine (): void { if (!this.data.linksNumber || !this.store.isLinkHoveringEnabled) return - if (!this.linkIndexFbo) this.updateLinkIndexFbo() + + // Ensure all required buffers are initialized before hover detection + if (!this.pointsBuffer) return + if (!this.linkIndexFbo) return + if (!this.linkIndexBuffer) return + if (!this.colorBuffer) return + if (!this.widthBuffer) return + if (!this.arrowBuffer) return + if (!this.curveLineGeometry || !this.curveLineBuffer) return + this.reglInstance.clear({ framebuffer: this.linkIndexFbo as regl.Framebuffer2D, color: [0, 0, 0, 0],