Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HTML for d3_identity error
<!DOCTYPE html>
<script type="text/javascript" src="src/d3/d3.js"></script>
<script type="text/javascript" src="src/d3/d3.geom.js"></script>
<script type="text/javascript" src="src/d3/d3.layout.js"></script>
<div id="viz1"></div>
<div id="viz2"></div>
<div id="viz3"></div>
<script type="text/javascript">
.attr("r", 10)
.attr("cx", 30)
.style("fill", "black")
var viz1 ="#viz1")
.attr("width", 100)
.attr("height", 100);
.style("stroke", "gray")
.style("fill", "white")
.attr("r", 40)
.attr("cx", 50)
.attr("cy", 50)
.on("mouseover", function(){"fill", "aliceblue");})
.on("mouseout", function(){"fill", "white");})
.on("mousedown", animate);
function animate() {
.attr("r", 10)
.attr("r", 40);
var w = 960,
h = 500;
var viz2 ="#viz2").append("svg")
.attr("width", w)
.attr("height", h);
.attr("cy", 90)
.attr("cx", String)
.attr("r", Math.sqrt);
var nodes = [new Node('Sun'), new Node('Moon'), new Node('Earth'), new Node('Mars')];
var links = [new Link(0,2), new Link(1,2), new Link(0,3)];
var fw = 960,
fh = 500;
var force = d3.layout.force()
.size([fw, fh]);
var viz3 ="#viz3").append("svg")
.attr("width", w)
.attr("height", h);
var node = viz3.selectAll("circle.code")
.attr("r", 45)
.style("stroke", "#000")
function Node(name) { = name;
function Link(source, target) {
this.source = source; = target;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.