선 사각형 동그라미 만들기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="https://d3js.org/d3.v5.min.js"></script>
  </head>
  <body>
    <p>This is a paragraph</p>
 
 
    <script type="text/javascript">
    var canvas =  d3.select("body")
                      .append("svg")
                      .attr("width",500)
                      .attr("height",500);
 
 
    var circle = canvas.append("circle")
                         .attr("cx",250)
                         .attr("cy",250)
                         .attr("r"50)
                         .attr("fill","red");
    var rect = canvas.append("rect")
                        .attr("width"100)
                        .attr("height"50);
    var line = canvas.append("line")
                        .attr("x1",0)
                        .attr("y1",100)
                        .attr("x2",400)
                        .attr("y2",400)
                        .attr("stroke","green")
                        .attr("stroke-width",10);
    </script>
  </body>
</html>
 
cs







'코딩' 카테고리의 다른 글

What is the meaning of 'i' in function(d,i){return i})?  (0) 2018.11.24
d3 공부2 : 데이터 시각화하기  (0) 2018.11.24
d3 : enter() ,exit()  (0) 2018.11.24
d3 : scale 정의역 공역 치역  (0) 2018.11.20
atom vscode 단축키  (0) 2018.11.18

+ Recent posts