Database Reference
In-Depth Information
2.
Now, we'll add the URLs for this page and its data to the routes we've been
working with:
(defroutes site-routes
(GET "/ibm-stock" [] (time-series))
(GET "/ibm-stock/data.csv" [] (redirect "/data/ibm.csv"))
(GET "/" [] (index-page))
(route/resources "/")
(route/not-found "Page not found"))
3.
We'll also want to add some style-related information to make the chart look good.
We can do this by adding the following lines to resources/css/style.css :
#time .axis path {
fill: none;
stroke: #000;
shape-rendering: crispedges;
}
#time .axis line {
fill: none;
stroke: #000;
shape-rendering: crispedges;
}
#time .x.axis path {
displays: none;
}
#time .line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
4. For the graph, the rest of this will take place in a new ile. We'll open src-cljs/
webviz/time.cljs . This will contain the following namespace declaration:
(ns webviz.time)
5.
Now, let's start creating parts of the graph. First, we'll have one that takes the
margins and returns the dimensions of the graph:
(defn get-dimensions [margin]
[(- 960 (:left margin) (:right margin))
(- 500 (:top margin) (:bottom margin))])
 
Search WWH ::




Custom Search