commune

d3: g

코딩

d3: g

Jonah's Whale 2018. 11. 17. 17:01


https://stackoverflow.com/questions/17057809/d3-js-what-is-g-in-appendg-d3-js-code





I am new to D3.js, started learning today only

I looked the the donut example and found this code

var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height)
  .append("g")
    .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");

I searched for documentation, but did not understood what .append("g") is appending

Is it even D3 specific?

Looking for guidance here

It appends a 'g' element to the SVG. g element is used to group SVG shapes together, so no it's not d3 specific.