toolkit/javascript/d3/README.md
changeset 47 c0b4a8b5a012
equal deleted inserted replaced
46:efd9c589177a 47:c0b4a8b5a012
       
     1 # D3
       
     2 
       
     3 **D3** is a small, free JavaScript library for manipulating HTML documents
       
     4 based on data. D3 can help you quickly visualize your data as HTML or SVG,
       
     5 handle interactivity, and incorporate smooth transitions and staged animations
       
     6 into your pages. You can use D3 as a visualization framework (like Protovis),
       
     7 or you can use it to build dynamic pages (like jQuery).
       
     8 
       
     9 ### Browser Support
       
    10 
       
    11 D3 should work on any browser, with minimal requirements such as JavaScript
       
    12 and the [W3C DOM](http://www.w3.org/DOM/) API. By default D3 requires the
       
    13 [Selectors API](http://www.w3.org/TR/selectors-api/) Level 1, but you can
       
    14 preload [Sizzle](http://sizzlejs.com/) for compatibility with older browsers.
       
    15 Some of the included D3 examples use additional browser features, such as
       
    16 [SVG](http://www.w3.org/TR/SVG/) and [CSS3
       
    17 Transitions](http://www.w3.org/TR/css3-transitions/). These features are not
       
    18 required to use D3, but are useful for visualization! D3 is not a
       
    19 compatibility layer. The examples should work on Firefox, Chrome (Chromium),
       
    20 Safari (WebKit), Opera and IE9.
       
    21 
       
    22 Note: Chrome has strict permissions for reading files out of the local file
       
    23 system. Some examples use AJAX which works differently via HTTP instead of local
       
    24 files. For the best experience, load the D3 examples from your own machine via
       
    25 HTTP. Any static file web server will work; for example you can run Python's
       
    26 built-in server:
       
    27 
       
    28     python -m SimpleHTTPServer 8888
       
    29 
       
    30 Once this is running, go to: <http://localhost:8888/examples/>
       
    31 
       
    32 ### Development Setup
       
    33 
       
    34 This repository should work out of the box if you just want to create new
       
    35 visualizations using D3. On the other hand, if you want to extend D3 with new
       
    36 features, fix bugs, or run tests, you'll need to install a few more things.
       
    37 
       
    38 D3's test framework uses [Vows](http://vowsjs.org), which depends on
       
    39 [Node.js](http://nodejs.org/) and [NPM](http://npmjs.org/). If you are
       
    40 developing on Mac OS X, an easy way to install Node and NPM is using
       
    41 [Homebrew](http://mxcl.github.com/homebrew/):
       
    42 
       
    43     brew install node
       
    44     brew install npm
       
    45 
       
    46 Next, from the root directory of this repository, install D3's dependencies:
       
    47 
       
    48     make install
       
    49 
       
    50 You can see the list of dependencies in package.json. NPM will install the
       
    51 packages in the node_modules directory.