Interactive Data Visualization for the Web by Scott Murray

Interactive Data Visualization for the Web by Scott Murray

Author:Scott Murray
Language: eng
Format: epub, mobi, pdf
Tags: COMPUTERS / Data Modeling & Design
ISBN: 9781449339722
Publisher: O’Reilly Media
Published: 2013-03-10T16:00:00+00:00


Figure 7-3. Scatterplot with y scale inverted

Yes, now a smaller input to yScale will produce a larger output value, thereby pushing those circles and text elements down, closer to the base of the image. I know, it’s almost too easy!

Yet some elements are getting cut off. Let’s introduce a padding variable:

var padding = 20;

Then we’ll incorporate the padding amount when setting the range of both scales. This will help push our elements in, away from the edges of the SVG, to prevent them from being clipped.

The range for xScale was range([0, w]), but now it’s:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.