Zooming in CircosJS
See original GitHub issueHello @nicgirault,
Is there a way to implement normal D3 zooming abilities within Circos layouts?
I’m using the Chords track similar to this example: https://github.com/nicgirault/circosJS/blob/master/doc/chords.png. I want to implement normal pan and zoom by scrolling with the mouse (https://bl.ocks.org/sgruhier/50990c01fe5b6993e82b8994951e23d0), and this is what I’m trying to do:
var width = 1000;
var height = 850;
var svg = d3.select("body")
.append("div")
.attr('id', 'chart')
.attr("width", width)
.attr("height", height);
svg.select(".all")
.call(d3.zoom().on("zoom", function() {
svg.select(".all").attr("transform", d3.event.transform)
}))
.append("g");
var myCircos = new Circos({
container: '#chart',
width: width,
height: height
});
// ...
// Adding the configuration data for the layout and chords, and rendering
The zooming is not working as expected. As you can see, I have to do svg.select(".all") to actually select the svg element within the div tag.
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Axis Scaling - Creating Zoomed Regions // CIRCOS Circular ...
In the first two examples in this tutorial section you saw how to adjust local scale by splitting a chromosome into multiple ideograms...
Read more >interacCircos: The Generation of Interactive Circos Plot
Circos.js ' and 'NG-Circos' and we integrate the modules of 'circosJS', 'BioCircos.js' and ... zoom. Whether or not the plot is zoomable? TEXTModuleDragEvent....
Read more >interacCircos document - Zhe Cui's website
If you are a NG-Circos/BioCircos.js/circosJS user and familiar with the modules ... library(interacCircos) Circos(zoom = FALSE,genome=list("Example1"=100 ...
Read more >NG-Circos.js - UCI
... class="pun">,</span><span class="pln"> zoom </span><span class="pun">:</span><span class="pln"> </span><span class="kwd">false</span><span class="pun"> ...
Read more >Visualize Data In A Circular Layout - Circos.js | CSS Script
Circos.js is a JavaScript graph library to visualizes data in a circular layout that is great for exploring relationships between objects or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@jnunez17 The issue was that I wrongly assumed that
d3-zoomwas included in thepackage,json. Once I installed it, everything worked wonderfully 👍@matthewchan15 Sorry, I did not understand you before. You should be specifying the zoom call in your application, after creating the
svgparent container (the same container that you use to create the Circos instance). Make sure you attach the zoom call to that parent container. Then, thatsvgis going to include an innersvg(coming from circos.js). The zoom should be working because the structure will besvg > svg, instead ofsvg > div > svg.