teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

コードの修正

2017/08/01 13:13

投稿

hipopo
hipopo

スコア8

title CHANGED
File without changes
body CHANGED
@@ -36,11 +36,15 @@
36
36
  }
37
37
 
38
38
  circle {
39
- fill: #ccc;
39
+ // fill: #ccc;
40
40
  stroke: #333;
41
41
  stroke-width: 1.5px;
42
42
  }
43
43
 
44
+ //以下のように新しいクラスとスタイルを定義しました
45
+ circle .a {fill: red;}
46
+ circle .b {fill: blue;}
47
+
44
48
  text {
45
49
  font: 10px sans-serif;
46
50
  pointer-events: none;
@@ -129,6 +133,7 @@
129
133
  .attr("class", function(d) { return "link " + d.type; })
130
134
  .attr("marker-end", function(d) { return "url(#" + d.type + ")"; });
131
135
 
136
+ //circle要素すべてにaかbどちらかのクラス名をつけようとしました。
132
137
  var circle = svg.append("g").selectAll("circle")
133
138
  .data(force.nodes())
134
139
  .enter().append("circle")

2

コードの修正

2017/08/01 13:13

投稿

hipopo
hipopo

スコア8

title CHANGED
File without changes
body CHANGED
@@ -132,7 +132,7 @@
132
132
  var circle = svg.append("g").selectAll("circle")
133
133
  .data(force.nodes())
134
134
  .enter().append("circle")
135
- .attr("class", function(d) { return d.which; }))
135
+ .attr("class", function(d) { return d.which; })
136
136
  .attr("r", 6)
137
137
  .call(force.drag);
138
138
 

1

脱字

2017/08/01 13:00

投稿

hipopo
hipopo

スコア8

title CHANGED
File without changes
body CHANGED
@@ -49,7 +49,7 @@
49
49
 
50
50
  </style>
51
51
  <body>
52
- <script src="//d3js.org/d3.v3.min.js"></script>
52
+ <script src="http://d3js.org/d3.v3.min.js"></script>
53
53
  <script>
54
54
 
55
55
  // http://blog.thomsonreuters.com/index.php/mobile-patent-suits-graphic-of-the-day/