Last active
November 24, 2017 05:39
-
-
Save isomorphisms/17477fdabe5dc8cd0fb16d12577c6566 to your computer and use it in GitHub Desktop.
barcodes of constant width at random intervals in D3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script> | |
d3.select("svg").selectAll("rect").data(["1em","5em","7em","13em"]).enter().append("rect").attr("x", (d) => { return d; }) | |
</script> | |
<style> | |
html { | |
background-color: #333; | |
color: #ccc; | |
font-family: "Courier New"; | |
margin: 3em; | |
margin-top: 0; | |
} | |
</style> | |
<title>bar codes</title> | |
</head> | |
<body> | |
<h1>bar codes</h1> | |
<svg width="20em" height="10em"> | |
<rect x=0 y="0" height="5em" width="1em" style="fill:#eee"></rect> | |
</svg> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment