JSFiddle - React, Tailwind, and code Playground

by Iván Pereira

HTML

<script src="https://d3js.org/d3.v3.min.js"></script>

CSS

div#container {
    height: 200px;
    width: 150px;
    border:2px solid #000;
    overflow: scroll;
}

JavaScript

var container = d3.select("body").append("div").attr("id", "container");
        
var rectangle = container.append("svg")
    .attr("viewBox", "0,0,150,420")
    .append("rect")
    .attr("width", 150)
    .attr("height", 420)
    .attr("fill", "steelblue")
    .attr("x", 0)
    .attr("y", 0);