Skip to content

Instantly share code, notes, and snippets.

@sym3tri
Created January 25, 2013 22:14
Show Gist options
  • Save sym3tri/4638411 to your computer and use it in GitHub Desktop.
Save sym3tri/4638411 to your computer and use it in GitHub Desktop.
A simple example of auto-resize using svg viewBox.
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