Want to get a space here? Contact us!
by

Thank the author with a small donation using PayPal.

0
Popularity: 15918th place
43 Views
1 Badge
Specified
Created
Modified on Jun 27, 2013
This snippet is Public
None ... yet!
LanguageJavaScript
LanguageJSON
LanguageMarkdown
SourceGithub

Async Talk Examples

Async Talk Examples: 
_.md
config.json
inlet.js
post this code
<iframe id="embedFrame" style="width:600px; height:300px;" src="http://www.snip2code.com/Embed/5750/Async-Talk-Examples"></iframe>
Click on the embed code to copy it into your clipboard Width:Height:
Leave empty to retrieve all the content First Line:Last Line:
[ <a href="http://tributary.io/inlet/5875896">Launch: Async Talk Examples</a> ] 5875896 by ocsrazor<br>

{"description":"Async Talk Examples","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}

var display = d3.select("#display");

var svg = d3.select("#display").append("svg");

//display.selectAll("p").remove();

display.selectAll("p")
    .data([4, 8, 15, 16, 23, 42])
  .enter().append("p")
  .text(function(d) { return "I’m number " + d + "!"; });

/*
d3.selectAll("p").style("color", "white");
*/

/*d3.selectAll("p").style("color", function() {
  return "hsl(" + Math.random() * 360 + ",100%,50%)";
})*/

/*d3.selectAll("p")
    .data([4, 8, 15, 16, 23, 42])
    .style("font-size", function(d) { return d + "px"; });
*/

/*var container = display.append("div")
    .attr("id", "chart1")
	.style({width: "500px", 
            height: "500px", 
            top: "50px",
            left: "10px",
            position: "absolute",
            "background-color": "white"
           })

var svg = container.append('svg');

svg.append('rect').attr({
  x: 5,
  y: 50,
  height: 155,
  width: 100,
  stroke: "black",
  fill: "white"
});

svg.append('circle').attr({
  cx: 140,
  cy: 50,
  r:10,
  fill:"blue"});

var data1 = [1,2,3,4,5];

svg.selectAll('circle').data(data1)
.enter().append('circle').attr({
  cx: 140,
  cy: function(d,i){return d*50},
  r:10,
  fill:"blue"});

svg.append("svg:svg")
 .data([[1, 1.2, 1.7, 1.5, 1.7]])
 .attr("x",200)
 .attr("width", 150)
 .attr("height", 150)
 .selectAll("path")
 .data(d3.layout.pie())
 .enter().append("svg:path")
 .attr("transform", "translate(75,75)")
 .attr("d", d3.svg.arc().outerRadius(70))
 .style("fill",function() {
    return "hsl(" + Math.random() * 360 + ",100%,50%)";
    })
 
display.selectAll("p")
    .data([4, 8, 15, 16, 23, 42])
  .enter().append("p")
    .text(function(d) { return "I’m number " + d + "!"; });

 
*/


If you want to be updated about similar snippets, Sign in and follow our Channels
Originally posted on https://gist.github.com/5875896