the code for the second commit was copied from vis.js examples find the example here click event was referred from docs and stackoverflow how to use vis js in react https://www.jamestharpe.com/react-visjs/