Database Reference
In-Depth Information
With these in place, we can now visit the page with our browser and view the graph, as shown
in the following screenshot:
How it works…
This recipe makes it clear that working with D3 directly is often much lower-level than
using NVD3. In this recipe, we're using D3 to create the actual SVG elements, with the
appropriate attributes and content, to display the graph. We can see this clearly in
add-line , for instance.
Let's take a look at that function line-by-line (almost):
(defn add-line [svg line data]
(.. svg (append "path")
(datum data)
In this snippet, D3 will add an SVG path element for each datum. This just creates an empty
element and associates it with a datum:
(attr "class" "line")
 
Search WWH ::




Custom Search