PauloMigAlmeida / directed-acyclic-graph-builder-js

dag-builder-js is a simple-to-use Javascript DAG library with support for N:N vertices/edges. It supports validating that no cycle can be created in real-time, import/export states and it's built on SVG so you can render graphs pretty much anywhere.
https://paulomigalmeida.github.io/directed-acyclic-graph-builder-js/demo/public/index.html
GNU General Public License v3.0
25 stars 4 forks source link

Console errors running the demo #1

Closed kinow closed 2 years ago

kinow commented 2 years ago

Hi,

I just cloned the project after seeing a tweet, but got a JS console error when trying to connect two nodes. First I built everything with yarn, then tried with npm following the instructions from the README.md but got the same error. Any idea what I could be doing wrong?

image

I added a "Dataset Reader", and a "Split Dataset". Then clicked on the diamon icon on the right hand-side of the Dataset Reader node, and the error occurred.

Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at GenericActionHolder.edgeConnectorGenericDragHandler [as callback] (dag.debug.js:1498:1)
    at GenericActionHolder.invoke (dag.debug.js:1033:1)
    at dag.debug.js:1075:1
    at Array.forEach (<anonymous>)
    at OutputVertexConnector.triggerEvent (dag.debug.js:1075:1)
    at SVGRectElement.<anonymous> (dag.debug.js:1897:1)
    at Dispatch.call (dag.debug.js:3442:56)
    at gesture (dag.debug.js:3651:1)
    at SVGRectElement.mousedowned (dag.debug.js:3565:1)
    at SVGRectElement.<anonymous> (dag.debug.js:5705:1)
edgeConnectorGenericDragHandler @ dag.debug.js:1498
invoke @ dag.debug.js:1033
(anonymous) @ dag.debug.js:1075
triggerEvent @ dag.debug.js:1075
(anonymous) @ dag.debug.js:1897
call @ dag.debug.js:3442
gesture @ dag.debug.js:3651
mousedowned @ dag.debug.js:3565
(anonymous) @ dag.debug.js:5705
24dag.debug.js:1498 Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at GenericActionHolder.edgeConnectorGenericDragHandler [as callback] (dag.debug.js:1498:1)
    at GenericActionHolder.invoke (dag.debug.js:1033:1)
    at dag.debug.js:1075:1
    at Array.forEach (<anonymous>)
    at OutputVertexConnector.triggerEvent (dag.debug.js:1075:1)
    at SVGRectElement.<anonymous> (dag.debug.js:1898:1)
    at Dispatch.call (dag.debug.js:3442:56)
    at Object.gesture [as mouse] (dag.debug.js:3651:1)
    at mousemoved (dag.debug.js:3574:1)
    at dag.debug.js:5705:1
edgeConnectorGenericDragHandler @ dag.debug.js:1498
invoke @ dag.debug.js:1033
(anonymous) @ dag.debug.js:1075
triggerEvent @ dag.debug.js:1075
(anonymous) @ dag.debug.js:1898
call @ dag.debug.js:3442
gesture @ dag.debug.js:3651
mousemoved @ dag.debug.js:3574
(anonymous) @ dag.debug.js:5705
dag.debug.js:1498 Uncaught TypeError: Cannot read properties of undefined (reading '0')
    at GenericActionHolder.edgeConnectorGenericDragHandler [as callback] (dag.debug.js:1498:1)
    at GenericActionHolder.invoke (dag.debug.js:1033:1)
    at dag.debug.js:1075:1
    at Array.forEach (<anonymous>)
    at OutputVertexConnector.triggerEvent (dag.debug.js:1075:1)
    at SVGRectElement.<anonymous> (dag.debug.js:1899:1)
    at Dispatch.call (dag.debug.js:3442:56)
    at Object.gesture (dag.debug.js:3651:1)
    at mouseupped (dag.debug.js:3581:1)
    at dag.debug.js:5705:1

Thanks

PauloMigAlmeida commented 2 years ago

Hey buddy, thanks for the heads up. I tried locally and I couldn't replicate that :( Which node version are you using?

As a side node, I just upgraded the package-lock.json to use the current node LTS version (v16). Try with that one and see if that fixes it. Otherwise, I'm happy to catch up with you to get to the bottom of this 😄

kinow commented 2 years ago

Hey buddy, thanks for the heads up. I tried locally and I couldn't replicate that :( Which node version are you using?

kinow@ranma:~$ node -v
v14.17.6

As a side node, I just upgraded the package-lock.json to use the current node LTS version (v16). Try with that one and see if that fixes it. Otherwise, I'm happy to catch up with you to get to the bottom of this smile

I updated to node LTS too, and tried again.

kinow@ranma:~/Development/javascript/workspace/directed-acyclic-graph-builder-js/demo$ git log -n 1
commit 4e8b7cf750b75210304fe64d88d9c1b78120c45c (HEAD -> main, upstream/main, upstream/HEAD)
Author: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Date:   Tue Sep 6 20:36:29 2022 +1200

    Update issue templates
kinow@ranma:~/Development/javascript/workspace/directed-acyclic-graph-builder-js/demo$ node -v
v16.17.0
# npm install, npm run build, cd demo, npm install, npm run start

Same error :disappointed_relieved:

kinow commented 2 years ago

Also see comment in #2, I'm getting the same in the deployed demo. I checked browser extensions, but it doesn't look like an issue with any extension? Thanks!

PauloMigAlmeida commented 2 years ago

@kinow I found out a way to replicate the error - Good catch!

It turns out that the .path attribute has been deprecated and not all browsers have removed it yet... Firefox and Chromium did 😄

kinow commented 2 years ago

Ah! I didn't test with Chrome, even though I have it installed :rofl:

PauloMigAlmeida commented 2 years ago

I forgot that adding "fix #number" closes the issue automatically.. reopening now until you can test it

kinow commented 2 years ago

I forgot that adding "fix #number" closes the issue automatically.. reopening now until you can test it

'tworks now!!! :tada:

image

Thanks Paulo!