Skip to content

Instantly share code, notes, and snippets.

@aaizemberg
Created September 24, 2021 20:04
Show Gist options
  • Select an option

  • Save aaizemberg/69dc1721b74f7ed15c2c0169e9eb733d to your computer and use it in GitHub Desktop.

Select an option

Save aaizemberg/69dc1721b74f7ed15c2c0169e9eb733d to your computer and use it in GitHub Desktop.

Revisions

  1. aaizemberg created this gist Sep 24, 2021.
    26 changes: 26 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Plot</title>
    <script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
    <script src="https://cdn.jsdelivr.net/npm/@observablehq/[email protected]"></script>
    </head>
    <body>
    <div id="vis"></div>

    <script>
    d3.tsv("https://aaizemberg.github.io/vis/01/data/poblacion.tsv", d3.autoType).then(function(data) {

    document.getElementById("vis").appendChild(Plot.plot({
    marks: [
    Plot.barX(data, {y: "provincia", x: "poblacion"})
    ],
    marginLeft: 250
    }));

    });
    </script>
    </body>
    </html>