Interfacing Between Javascript and Python APIs

I have written a small scientific visualization library in Javascript that builds off Plotly’s interactive JS methods such as Plotly.relayout and Plotly.redraw which, as far as I know, are not available as part of the Python API. I’d like to be able to generate the plot data/traces using numpy and python and then somehow pass that data to the Javascript library for plotting. I’ve attempted to create an API using NodeJS that handles this by allowing the data to be sent in POST requests from Python, but I can’t access the HTML DOM from the API in order to get the plot div that needs to be passed to the redraw and relayout calls. Is there an easier way to get around all of this?