mattkrick / EdmondsBlossom

Edmond's maximum weighted matching algorithm (Blossom algorithm) in O(n^3)
MIT License
33 stars 7 forks source link

ReferenceError: b is not defined #1

Open joudinet opened 4 years ago

joudinet commented 4 years ago

https://github.com/mattkrick/EdmondsBlossom/blob/fab7ca8505e1577b009696c038dc804cf0acbea2/app/blossom.js#L269

I think there is a missing var at the beginning of this line, to declare the variable b. Otherwise, using this code as a module of mine, I got a reference error on Chrome.

joudinet commented 4 years ago

Same reference error for the path variable few lines below: https://github.com/mattkrick/EdmondsBlossom/blob/fab7ca8505e1577b009696c038dc804cf0acbea2/app/blossom.js#L274

joudinet commented 4 years ago

And another one in: https://github.com/mattkrick/EdmondsBlossom/blob/fab7ca8505e1577b009696c038dc804cf0acbea2/app/blossom.js#L380

VenierGiacomo commented 1 year ago

Hey @joudinet, did you manage to fix it?

joudinet commented 1 year ago

Hi @VenierGiacomo . I did fix it but this was a longtime ago and I don't remember how exactly I did it. Either I modified directly the code on the node_modules directory to declare the missing variables (i.e., the ugly way), or I found a way to load the module so that it works. In my code, I see that I do the following : import Blossom from 'edmonds-blossom' in the script part of my Vue component and the package.json file contains the following dependency : "edmonds-blossom": "^1.0.0". Then I simply call Blossom(data);. Hope it helps you.

VenierGiacomo commented 1 year ago

Hey @joudinet thanks, a lot! In the end I just copy pasted the code from the blossom.js file into my project and added the variable declaration for the missing variables. So far it seem to be working.

Thank again