Created
January 25, 2013 22:14
-
-
Save sym3tri/4638411 to your computer and use it in GitHub Desktop.
A simple example of auto-resize using svg viewBox.
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
var svg = d3.select('#container').append('svg') | |
.attr({ | |
viewBox: '0 0 1000 1000', | |
}); | |
svg.append('rect') | |
.attr({ | |
width: '1000', | |
height: '1000' | |
}); | |
svg.append('rect') | |
.attr({ | |
width: '100', | |
height: '100', | |
fill: 'red' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment