Simple example using W javascript library for responsive development with d3.js
Test by changing browser dimensions or rotating mobile. The rectangle remains the 1:4 ratio of the viewport.
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.6.1/lodash.min.js