I have been experimenting with d3 libraries lately and came across http://bl.ocks.org/jroetman/9b4c0599a4996edef0ab. I successfully used it to draw a graph based on data from a tsv file and enable zoom in and out functionality, which worked well for me. However, I encountered an issue when trying to display two different graphs within the same HTML page. While I was able to draw them on separate axes and implement zoom in and out features for each graph individually, the red square that outlines the area selected for zooming only appears on the first graph.
For instance, if I have graph A and graph B, after selecting an area to zoom in on graph B, the red band shows up on graph A instead, even though the zoom functionality takes effect on graph B. I'm wondering what variable controls this behavior and how I can adjust it so that each graph has its own distinct selection band. Any insights on how to achieve this separation?