Skip to content

Commit 00de99b

Browse files
committed
Update to 2.7.0.
1 parent 4156fdf commit 00de99b

59 files changed

Lines changed: 268 additions & 247 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_includes/box.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ d3.csv("../data/morley.csv", function(csv) {
2727

2828
var vis = d3.select("#chart").selectAll("svg")
2929
.data(data)
30-
.enter().append("svg:svg")
30+
.enter().append("svg")
3131
.attr("class", "box")
3232
.attr("width", w)
3333
.attr("height", h)
34-
.append("svg:g")
34+
.append("g")
3535
.attr("transform", "translate(" + m[3] + "," + m[0] + ")")
3636
.call(chart);
3737

_includes/bubble.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var bubble = d3.layout.pack()
66
.sort(null)
77
.size([r, r]);
88

9-
var vis = d3.select("#chart").append("svg:svg")
9+
var vis = d3.select("#chart").append("svg")
1010
.attr("width", r)
1111
.attr("height", r)
1212
.attr("class", "bubble");
@@ -15,18 +15,18 @@ d3.json("../data/flare.json", function(json) {
1515
var node = vis.selectAll("g.node")
1616
.data(bubble.nodes(classes(json))
1717
.filter(function(d) { return !d.children; }))
18-
.enter().append("svg:g")
18+
.enter().append("g")
1919
.attr("class", "node")
2020
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
2121

22-
node.append("svg:title")
22+
node.append("title")
2323
.text(function(d) { return d.className + ": " + format(d.value); });
2424

25-
node.append("svg:circle")
25+
node.append("circle")
2626
.attr("r", function(d) { return d.r; })
2727
.style("fill", function(d) { return fill(d.packageName); });
2828

29-
node.append("svg:text")
29+
node.append("text")
3030
.attr("text-anchor", "middle")
3131
.attr("dy", ".3em")
3232
.text(function(d) { return d.className.substring(0, d.r / 3); });

_includes/bullet.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ d3.json("bullets.json", function(data) {
1010

1111
var vis = d3.select("#chart").selectAll("svg")
1212
.data(data)
13-
.enter().append("svg:svg")
13+
.enter().append("svg")
1414
.attr("class", "bullet")
1515
.attr("width", w)
1616
.attr("height", h)
17-
.append("svg:g")
17+
.append("g")
1818
.attr("transform", "translate(" + m[3] + "," + m[0] + ")")
1919
.call(chart);
2020

21-
var title = vis.append("svg:g")
21+
var title = vis.append("g")
2222
.attr("text-anchor", "end")
2323
.attr("transform", "translate(-6," + (h - m[0] - m[2]) / 2 + ")");
2424

25-
title.append("svg:text")
25+
title.append("text")
2626
.attr("class", "title")
2727
.text(function(d) { return d.title; });
2828

29-
title.append("svg:text")
29+
title.append("text")
3030
.attr("class", "subtitle")
3131
.attr("dy", "1em")
3232
.text(function(d) { return d.subtitle; });

_includes/cartogram.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ var data = [
66
.169, , .132, .167, .139, .184, .159, .14, .146, .157, , .139, .183, .16, .143
77
];
88

9-
var svg = d3.select("#chart").append("svg:svg")
9+
var svg = d3.select("#chart").append("svg")
1010
.attr("width", 960)
1111
.attr("height", 500);
1212

1313
d3.json("../data/us-states.json", function(json) {
1414
var path = d3.geo.path();
1515

1616
// A thick black stroke for the exterior.
17-
svg.append("svg:g")
17+
svg.append("g")
1818
.attr("class", "black")
1919
.selectAll("path")
2020
.data(json.features)
21-
.enter().append("svg:path")
21+
.enter().append("path")
2222
.attr("d", path);
2323

2424
// A white overlay to hide interior black strokes.
25-
svg.append("svg:g")
25+
svg.append("g")
2626
.attr("class", "white")
2727
.selectAll("path")
2828
.data(json.features)
29-
.enter().append("svg:path")
29+
.enter().append("path")
3030
.attr("d", path);
3131

3232
// The polygons, scaled!
33-
svg.append("svg:g")
33+
svg.append("g")
3434
.attr("class", "grey")
3535
.selectAll("path")
3636
.data(json.features)
37-
.enter().append("svg:path")
37+
.enter().append("path")
3838
.attr("d", path)
3939
.attr("transform", function(d) {
4040
var centroid = path.centroid(d),

_includes/chord.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,42 @@ var fill = d3.scale.ordinal()
1919
.range(["#000000", "#FFDD89", "#957244", "#F26223"]);
2020

2121
var svg = d3.select("#chart")
22-
.append("svg:svg")
22+
.append("svg")
2323
.attr("width", w)
2424
.attr("height", h)
25-
.append("svg:g")
25+
.append("g")
2626
.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")");
2727

28-
svg.append("svg:g")
28+
svg.append("g")
2929
.selectAll("path")
3030
.data(chord.groups)
31-
.enter().append("svg:path")
31+
.enter().append("path")
3232
.style("fill", function(d) { return fill(d.index); })
3333
.style("stroke", function(d) { return fill(d.index); })
3434
.attr("d", d3.svg.arc().innerRadius(r0).outerRadius(r1))
3535
.on("mouseover", fade(.1))
3636
.on("mouseout", fade(1));
3737

38-
var ticks = svg.append("svg:g")
38+
var ticks = svg.append("g")
3939
.selectAll("g")
4040
.data(chord.groups)
41-
.enter().append("svg:g")
41+
.enter().append("g")
4242
.selectAll("g")
4343
.data(groupTicks)
44-
.enter().append("svg:g")
44+
.enter().append("g")
4545
.attr("transform", function(d) {
4646
return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")"
4747
+ "translate(" + r1 + ",0)";
4848
});
4949

50-
ticks.append("svg:line")
50+
ticks.append("line")
5151
.attr("x1", 1)
5252
.attr("y1", 0)
5353
.attr("x2", 5)
5454
.attr("y2", 0)
5555
.style("stroke", "#000");
5656

57-
ticks.append("svg:text")
57+
ticks.append("text")
5858
.attr("x", 8)
5959
.attr("dy", ".35em")
6060
.attr("text-anchor", function(d) {
@@ -65,11 +65,11 @@ ticks.append("svg:text")
6565
})
6666
.text(function(d) { return d.label; });
6767

68-
svg.append("svg:g")
68+
svg.append("g")
6969
.attr("class", "chord")
7070
.selectAll("path")
7171
.data(chord.chords)
72-
.enter().append("svg:path")
72+
.enter().append("path")
7373
.style("fill", function(d) { return fill(d.target.index); })
7474
.attr("d", d3.svg.chord().radius(r0))
7575
.style("opacity", 1);

_includes/choropleth.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ var data; // loaded asynchronously
33
var path = d3.geo.path();
44

55
var svg = d3.select("#chart")
6-
.append("svg:svg");
6+
.append("svg");
77

8-
var counties = svg.append("svg:g")
8+
var counties = svg.append("g")
99
.attr("id", "counties")
1010
.attr("class", "Blues");
1111

12-
var states = svg.append("svg:g")
12+
var states = svg.append("g")
1313
.attr("id", "states");
1414

1515
d3.json("../data/us-counties.json", function(json) {
1616
counties.selectAll("path")
1717
.data(json.features)
18-
.enter().append("svg:path")
18+
.enter().append("path")
1919
.attr("class", data ? quantize : null)
2020
.attr("d", path);
2121
});
2222

2323
d3.json("../data/us-states.json", function(json) {
2424
states.selectAll("path")
2525
.data(json.features)
26-
.enter().append("svg:path")
26+
.enter().append("path")
2727
.attr("d", path);
2828
});
2929

_includes/cluster.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ var cluster = d3.layout.cluster()
77
var diagonal = d3.svg.diagonal()
88
.projection(function(d) { return [d.y, d.x]; });
99

10-
var vis = d3.select("#chart").append("svg:svg")
10+
var vis = d3.select("#chart").append("svg")
1111
.attr("width", w)
1212
.attr("height", h)
13-
.append("svg:g")
13+
.append("g")
1414
.attr("transform", "translate(40, 0)");
1515

1616
d3.json("../data/flare.json", function(json) {
1717
var nodes = cluster.nodes(json);
1818

1919
var link = vis.selectAll("path.link")
2020
.data(cluster.links(nodes))
21-
.enter().append("svg:path")
21+
.enter().append("path")
2222
.attr("class", "link")
2323
.attr("d", diagonal);
2424

2525
var node = vis.selectAll("g.node")
2626
.data(nodes)
27-
.enter().append("svg:g")
27+
.enter().append("g")
2828
.attr("class", "node")
2929
.attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; })
3030

31-
node.append("svg:circle")
31+
node.append("circle")
3232
.attr("r", 4.5);
3333

34-
node.append("svg:text")
34+
node.append("text")
3535
.attr("dx", function(d) { return d.children ? -8 : 8; })
3636
.attr("dy", 3)
3737
.attr("text-anchor", function(d) { return d.children ? "end" : "start"; })

_includes/dji.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ var color = d3.scale.quantize()
1414

1515
var svg = d3.select("#chart").selectAll("svg")
1616
.data(d3.range(1990, 2011))
17-
.enter().append("svg:svg")
17+
.enter().append("svg")
1818
.attr("width", w + m[1] + m[3])
1919
.attr("height", h + m[0] + m[2])
2020
.attr("class", "RdYlGn")
21-
.append("svg:g")
21+
.append("g")
2222
.attr("transform", "translate(" + (m[3] + (w - z * 53) / 2) + "," + (m[0] + (h - z * 7) / 2) + ")");
2323

24-
svg.append("svg:text")
24+
svg.append("text")
2525
.attr("transform", "translate(-6," + z * 3.5 + ")rotate(-90)")
2626
.attr("text-anchor", "middle")
2727
.text(String);
2828

2929
var rect = svg.selectAll("rect.day")
3030
.data(function(d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
31-
.enter().append("svg:rect")
31+
.enter().append("rect")
3232
.attr("class", "day")
3333
.attr("width", z)
3434
.attr("height", z)
@@ -37,7 +37,7 @@ var rect = svg.selectAll("rect.day")
3737

3838
svg.selectAll("path.month")
3939
.data(function(d) { return d3.time.months(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
40-
.enter().append("svg:path")
40+
.enter().append("path")
4141
.attr("class", "month")
4242
.attr("d", monthPath);
4343

@@ -49,7 +49,7 @@ d3.csv("dji.csv", function(csv) {
4949

5050
rect
5151
.attr("class", function(d) { return "day q" + color(data[format(d)]) + "-9"; })
52-
.append("svg:title")
52+
.append("title")
5353
.text(function(d) { return (d = format(d)) + (d in data ? ": " + percent(data[d]) : ""); });
5454
});
5555

_includes/force.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var w = 960,
22
h = 500,
33
fill = d3.scale.category20();
44

5-
var vis = d3.select("#chart").append("svg:svg")
5+
var vis = d3.select("#chart").append("svg")
66
.attr("width", w)
77
.attr("height", h);
88

@@ -17,7 +17,7 @@ d3.json("miserables.json", function(json) {
1717

1818
var link = vis.selectAll("line.link")
1919
.data(json.links)
20-
.enter().append("svg:line")
20+
.enter().append("line")
2121
.attr("class", "link")
2222
.style("stroke-width", function(d) { return Math.sqrt(d.value); })
2323
.attr("x1", function(d) { return d.source.x; })
@@ -27,15 +27,15 @@ d3.json("miserables.json", function(json) {
2727

2828
var node = vis.selectAll("circle.node")
2929
.data(json.nodes)
30-
.enter().append("svg:circle")
30+
.enter().append("circle")
3131
.attr("class", "node")
3232
.attr("cx", function(d) { return d.x; })
3333
.attr("cy", function(d) { return d.y; })
3434
.attr("r", 5)
3535
.style("fill", function(d) { return fill(d.group); })
3636
.call(force.drag);
3737

38-
node.append("svg:title")
38+
node.append("title")
3939
.text(function(d) { return d.name; });
4040

4141
force.on("tick", function() {

_includes/pack.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ var pack = d3.layout.pack()
66
.size([w - 4, h - 4])
77
.value(function(d) { return d.size; });
88

9-
var vis = d3.select("#chart").append("svg:svg")
9+
var vis = d3.select("#chart").append("svg")
1010
.attr("width", w)
1111
.attr("height", h)
1212
.attr("class", "pack")
13-
.append("svg:g")
13+
.append("g")
1414
.attr("transform", "translate(2, 2)");
1515

1616
d3.json("../data/flare.json", function(json) {
1717
var node = vis.data([json]).selectAll("g.node")
1818
.data(pack.nodes)
19-
.enter().append("svg:g")
19+
.enter().append("g")
2020
.attr("class", function(d) { return d.children ? "node" : "leaf node"; })
2121
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
2222

23-
node.append("svg:title")
23+
node.append("title")
2424
.text(function(d) { return d.name + (d.children ? "" : ": " + format(d.size)); });
2525

26-
node.append("svg:circle")
26+
node.append("circle")
2727
.attr("r", function(d) { return d.r; });
2828

29-
node.filter(function(d) { return !d.children; }).append("svg:text")
29+
node.filter(function(d) { return !d.children; }).append("text")
3030
.attr("text-anchor", "middle")
3131
.attr("dy", ".3em")
3232
.text(function(d) { return d.name.substring(0, d.r / 3); });

0 commit comments

Comments
 (0)