Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>d3js bind data.key -> el.id</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
</head>
<body>
  <svg style="">
    <g id="id_1" transform="translate(20, 30)">
      <text>-- 1 --</text>
    </g>
    <g id="id_2"transform="translate(20, 60)">
      <text>-- 2 --</text>
    </g>
    <g id="id_3"transform="translate(20, 90)">
      <text>-- 3 --</text>
    </g>
    <g id="id_4"transform="translate(20, 120)">
      <text>-- 4 --</text>
    </g>
  </svg>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
sunefredpro
0viewers