Permalink
Browse files

Initial svg/vml drawing, completely blank (but working on IE!)

  • Loading branch information...
1 parent 491de48 commit c1cddd2175d59a3584bd173210e266d9b431643a @strongriley strongriley committed Oct 10, 2011
Showing with 24 additions and 4 deletions.
  1. +2 −1 ex/calendar.markdown
  2. +14 −3 ex/dji.js
  3. +8 −0 raphael-2.0.min.js
View
@@ -5,11 +5,12 @@ title: Calendar View
# Calendar View
-<div class="gallery" id="chart"> </div>
+<div class="gallery RdYlGn" id="chart"> </div>
<link type="text/css" rel="stylesheet" href="calendar.css"/>
<link type="text/css" rel="stylesheet" href="colorbrewer.css"/>
<script type="text/javascript" src="../flow-v1.1.1.js"> </script>
<script type="text/javascript" src="../jquery-1.6.4.min.js"> </script>
+<script type="text/javascript" src="../raphael-2.0.min.js"> </script>
<script type="text/javascript" src="../d3.csv.js?2.2.0"> </script>
<script type="text/javascript" src="../d3.time.js?2.2.0"> </script>
<script type="text/javascript" src="calendar.js"> </script>
View
@@ -2,23 +2,33 @@ var w = 960,
pw = 14,
z = ~~((w - pw * 2) / 53),
ph = z >> 1,
- h = z * 7;
+ h = z * 7,
+ type = Raphael.svg ? "svg" : "xml";
var vis = d3.select("#chart")
- .selectAll("svg")
+ .selectAll("div")
.data(d3.range(1990, 2011))
+ .enter().append("div")
+ .each(generate);
+
+function generate(d, i) {
+ Raphael(this, w, h + ph *2);
+}
+/*
.enter().append("svg:svg")
.attr("width", w)
.attr("height", h + ph * 2)
.attr("class", "RdYlGn")
.append("svg:g")
.attr("transform", "translate(" + pw + "," + ph + ")");
+ */
+
vis.append("svg:text")
.attr("transform", "translate(-6," + h / 2 + ")rotate(-90)")
.attr("text-anchor", "middle")
.text(function(d) { return d; });
-
+/*
vis.selectAll("rect.day")
.data(calendar.dates)
.enter().append("svg:rect")
@@ -43,6 +53,7 @@ vis.selectAll("path.month")
+ "H" + (d.firstWeek + 1) * z
+ "Z";
});
+*/
d3.csv("dji.csv", function(csv) {
var data = d3.nest()
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit c1cddd2

Please sign in to comment.