400 coincident opaque svg:line elements, each .5-pixel wide. The coincident lines on the left should appear identical to the single line on the right.
Poor Anti-Aliasing in SVG, #2
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
line { | |
stroke: #000; | |
stroke-width: .5px; | |
} | |
</style> | |
<body> | |
<script src="//d3js.org/d3.v3.min.js"></script> | |
<script> | |
var svg = d3.select("body").append("svg") | |
.attr("width", 960) | |
.attr("height", 500); | |
svg.selectAll("line") | |
.data(d3.range(400)) | |
.enter().append("line") | |
.attr("x2", 480) | |
.attr("y2", 500); | |
svg.append("line") | |
.attr("transform", "translate(480)") | |
.attr("x2", 480) | |
.attr("y2", 500); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment