I'm writing a Ruby module for creating directed acyclic graph data structures, which will include all the functionality to add/remove nodes, edges, prevent cycles, and maintain a topological order. Eventually it will be the core of a spreadsheet-like utility to evaluate expressions that may depend on one another.
It would be really helpful, especially for testing, if my data structure could be visualized in one of the many capable js libraries for drawing graphs - I've chosen Cytoscape.js. It's pretty straightforward to set up and it has a nice javascript API to interact with and modify the graph. I would like to know if there's some way for Ruby to communicate with the browser window, and specifically with the Cytoscape instance running there. In effect, I guess I want to use the browser as a GUI for my Ruby program. Ideally, I could load my module in IRB, call my_graph.add_edge('node_a', 'node_b'), and once my Graph class checks for cycles and re-sorts as neccessary, it would call cy.add({edge JSON...}) on the Cytoscape instance and it all updates.
I'm running ruby 2.66 on Windows 10, my browser is Firefox.
Sorry if this is a naive question, I know ruby fairly well but don't know much about web development. GUIs are just not a big topic in the Ruby world and they all seem to be for making little desktop apps. I would also like to avoid the complexity of Ruby of Rails. Thanks for reading!