Imo
Imo

Reputation: 1475

How to make labels appear only when the chart is zoomed in

I have a circle packing diagram as an svg created in inkscape. Now I want to implement a zooming in and out function with JavaScript and that the labels of the smaller circles only appear when I zoom in, and fade out as I zoom out. Is there a working example of this somewhere?

Here is an example of zooming behaviour I am looking for http://www.nytimes.com/interactive/2008/05/03/business/20080403_SPENDING_GRAPHIC.html?_r=0

Upvotes: 3

Views: 139

Answers (1)

VividD
VividD

Reputation: 10536

Yes, please take a look at this example: bl.ocks.org/mbostock/7607535

It contains all bits and peaces for implementintg the behavior you look for:

enter image description here

enter image description here

Upvotes: 1

Related Questions