Help us understand the problem. What is going on with this article?

D3.jsで完全グラフの描画

More than 1 year has passed since last update.

https://codepen.io/matsutakk/pen/zegdqN?editors=0010#

See the Pen Complete Graph by Takuya Matsuda (@matsutakk) on CodePen.

d3.select()で描画をする準備をして、

  let sampleSVG = d3.select("#viz")
                    .append("svg")
                    .attr("width", width)
                    .attr("height",height);    

.append("circle")で円を描画。
.style()で円の色等を決めて、
.attr()で位置を決定。

  sampleSVG.append("circle")
          .style("stroke", "white")
          .style("fill", "black")
          .attr("r", radius)
          .attr("cx", width/2)
          .attr("cy", height/2)

.append("line")で線を描画。
.style()で線の色等を決めて、
.attr()で引く位置を決定。

sampleSVG.append("line")
            .style("stroke", "white")
            .style("fill", "white")
            .attr("x1", array_x[i])
            .attr("y1", array_y[i])
            .attr("x2", array_x[j])
            .attr("y2", array_y[j])
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした