Skip to content

Instantly share code, notes, and snippets.

@mathisonian
Last active January 27, 2016 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathisonian/4f673f4e62b7b98fcfd1 to your computer and use it in GitHub Desktop.
Save mathisonian/4f673f4e62b7b98fcfd1 to your computer and use it in GitHub Desktop.
var aspectRatio= '16:9';
var viewBox = '0 0 ' + aspectRatio.split(':').join(' ');
var svg = d3.select('#example-4')
.append('svg')
.attr('width', '100%')
.attr('viewBox', viewBox);
// draw the background
// orange
svg.append('rect')
.style('fill', 'orange')
.attr('width', '100%')
.attr('height', '100%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment