visjs / vis-network

:dizzy: Display dynamic, automatically organised, customizable network views.
https://visjs.github.io/vis-network/
Apache License 2.0
3.09k stars 374 forks source link

How to override function in vis-network? #1535

Open neo6053 opened 3 years ago

neo6053 commented 3 years ago

There's always needs to modify/enhance some of the function in visjs since it's not a low level customizable libraries like d3. Example, I want to add label on the both end of the edge. I saw someone did it, but he did not eventually merge the code into the main branch. Somemore, he worked on the older version of the library. https://github.com/almende/vis/issues/2104.

I want to modify the code so I can add my own function to the library. I want to maintain the ability to download and upgrade the library anytime in future, meanwhile I want to put in my own fix/enhancement into it. Thus, perhaps override it in my code.

Example, I want to change something in the drawLabel function. I wonder how can I override some of the function (eg: drawLabel(ctx, viaNode) {})

neo6053 commented 3 years ago

Anyone?