This file contains 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 characters
var list = { | |
nodes : [ | |
{ name : "C" }, | |
{ name : "C" }, | |
{ name : "C" }, | |
{ name : "C" }, | |
{ name : "C" }, | |
{ name : "C" }, | |
{ name : "Cl" }, | |
{ name : "Cl" }, |
This file contains 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 characters
d3.csv("score.csv",function(errer,csv){ | |
var max = Math.max.apply(null,csv.map(function(d){return d.s })); | |
var ScolorScale = d3.scale.linear().domain([0, max]).range(["#FFF5F2", "#FF4500"]); //カラースケールを作成 | |
var year = d3.nest().key(function(d){return d.y;}).entries(csv); //CSVから取得したデータをネスト | |
var time = d3.nest().key(function(d){return d.t;}).entries(csv); //CSVから取得したデータをネスト | |
This file contains 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 characters
[ | |
{ "date" : "2015/03/14", "vs" : "清水", "scoa" : "△0-0", "att" : 19537, "referee" : "扇谷 健司" }, | |
{ "date" : "2015/03/22", "vs" : "柏", "scoa" : "○3-2", "att" : 18193, "referee" : "井上 知大" }, | |
{ "date" : "2015/04/18", "vs" : "神戸", "scoa" : "△2-2", "att" : 16068, "referee" : "吉田 寿光" }, | |
{ "date" : "2015/04/29", "vs" : "F東京", "scoa" : "●0-1", "att" : 22318, "referee" : "木村 博之" }, | |
{ "date" : "2015/05/06", "vs" : "山形", "scoa" : "△1-1", "att" : 25009, "referee" : "村上 伸次" }, | |
{ "date" : "2015/05/16", "vs" : "仙台", "scoa" : "●0-3", "att" : 16764, "referee" : "佐藤 隆治" }, | |
{ "date" : "2015/05/30", "vs" : "甲府", "scoa" : "●0-2", "att" : 23197, "referee" : "吉田 寿光" }, | |
{ "date" : "2015/06/07", "vs" : "名古屋", "scoa" : "△1-1", "att" : 19030, "referee" : "東城 穣" } | |
] |
This file contains 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 characters
var width = window.innerWidth; | |
var height = window.innerHeight; | |
var svg = d3.select("#myGraph").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
var colorSelect = function(d){ | |
var color = '#fff'; | |
switch(d){ |
This file contains 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 characters
var svgWidth = 800; | |
var svgHeight = 800; | |
var diameter = 800; | |
var svg = d3.select("#myGraph").append("svg") | |
.attr("width", svgWidth).attr("height", svgHeight); | |
var bubble = d3.layout.pack() | |
.size([diameter, diameter]) | |
.padding(10); |