Last active
May 13, 2019 18:04
-
-
Save alfmoh/fb673f4b02227e37fcedd2aa26b1ea51 to your computer and use it in GitHub Desktop.
Revisions
-
alfmoh revised this gist
May 13, 2019 . No changes.There are no files selected for viewing
-
alfmoh revised this gist
May 13, 2019 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,16 +25,13 @@ const scale = d3.scaleLinear() .domain(dataset) .range([10,50]); const colorScale = d3.scaleQuantile() .domain(dataset) .range(["red","blue"]) const g = svg.selectAll("g") .data(dataset) .enter() .append("g") @@ -48,6 +45,11 @@ .duration(1000) .attr("r",(d,i)=>d*5) .style("fill","pink") const xAxis = d3.axisBottom(scale); svg.append("g") .call(xAxis) .attr("transform","translate(10,450)") g.transition() .delay(d=>d*200) -
alfmoh revised this gist
May 13, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const xAxis = d3.axisBottom(scale); svg.append("g") .call(xAxis) .attr("transform","translate(10,450)") const colorScale = d3.scaleQuantile() .domain(dataset) -
alfmoh revised this gist
May 12, 2019 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,11 @@ <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } .text { font: italic 15px sans-serif; } </style> </head> @@ -49,6 +54,12 @@ .duration(1000) .attr("transform",(d,i)=>`translate(${scale(d)},${i*50})`) g.append("text") .text(d=>d) .style("fill","white") .attr("class","text") .attr("transform",(d,i)=>`translate(${-i*2},0)`) // g.transition() // // .delay(d=>d*20) // .duration(1000) -
alfmoh revised this gist
May 12, 2019 . No changes.There are no files selected for viewing
-
alfmoh revised this gist
May 12, 2019 . 1 changed file with 42 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,25 +29,53 @@ .domain(dataset) .range(["red","blue"]) const g = svg.selectAll("a") .data(dataset) .enter() .append("g") .attr("transform",d=>`translate(${scale(d)},500)`) const circle = g.append("circle") .attr("r",5) .style("fill",d=>colorScale(d)) .transition() .delay(d=>d*200) .duration(1000) .attr("r",(d,i)=>d*5) .style("fill","pink") g.transition() .delay(d=>d*200) .duration(1000) .attr("transform",(d,i)=>`translate(${scale(d)},${i*50})`) // g.transition() // // .delay(d=>d*20) // .duration(1000) // svg.selectAll("circle") // .data(dataset) // .enter() // .append("circle") // .attr("r",1) // .attr("cy",500) // .attr("cx",(d,i)=>scale(d)) // .transition() // .delay(d=>d*200) // .duration(1000) // .attr("r",(d,i)=>d) // .attr("cx",(d,i)=>scale(d)) // .attr("cy",(d,i)=>i*50) // .style("fill",d=>colorScale(d)) // .transition() // // .delay(d=>d*20) // .duration(1000) // .attr("r",(d,i)=>d*5) // .style("fill","pink") </script> </body> -
alfmoh revised this gist
May 11, 2019 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,10 @@ const scale = d3.scaleLinear() .domain(dataset) .range([10,50]); const xAxis = d3.axisBottom(scale); svg.append("g") .call(xAxis) .attr("transform","translate(0,450)") const colorScale = d3.scaleQuantile() .domain(dataset) -
alfmoh revised this gist
May 10, 2019 . No changes.There are no files selected for viewing
-
alfmoh revised this gist
May 10, 2019 . No changes.There are no files selected for viewing
-
alfmoh revised this gist
May 10, 2019 . No changes.There are no files selected for viewing
-
alfmoh revised this gist
May 10, 2019 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,11 +33,17 @@ .attr("cy",500) .attr("cx",(d,i)=>scale(d)) .transition() .delay(d=>d*200) .duration(1000) .attr("r",(d,i)=>d) .attr("cx",(d,i)=>scale(d)) .attr("cy",(d,i)=>i*50) .style("fill",d=>colorScale(d)) .transition() // .delay(d=>d*20) .duration(1000) .attr("r",(d,i)=>d*5) .style("fill","pink") </script> </body> -
alfmoh revised this gist
May 10, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,7 @@ .append("circle") .attr("r",1) .attr("cy",500) .attr("cx",(d,i)=>scale(d)) .transition() .duration(1000) .attr("r",(d,i)=>d) -
alfmoh created this gist
May 10, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ license: mit This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Built with [blockbuilder.org](http://blockbuilder.org) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ <!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> console.clear(); // Feel free to change or delete any of the code you see in this editor! var svg = d3.select("body").append("svg") .attr("width", 960) .attr("height", 500) const dataset = [1,2,3,9,5,15]; const scale = d3.scaleLinear() .domain(dataset) .range([10,50]); const colorScale = d3.scaleQuantile() .domain(dataset) .range(["red","blue"]) svg.selectAll("circle") .data(dataset) .enter() .append("circle") .attr("r",1) .attr("cy",500) .transition() .duration(1000) .attr("r",(d,i)=>d) .attr("cx",(d,i)=>scale(d)) .attr("cy",(d,i)=>i*50) .style("fill",d=>colorScale(d)) </script> </body>