example/js/svg.js
function proportionalSize(box, width, height) {
  if (height == null)
    height = box.height / box.width * width
  else if (width == null)
    width = box.width / box.height * height

  return {
    width:  width
  , height: height
  }
}
function proportionalSize(box, width, height) {
  if (height == null)
    height = box.height / box.width * width
  else if (width == null)
    width = box.width / box.height * height

  return {
    width:  width
  , height: height
  }
}
function proportionalSize ( box , width , height ) { if ( height == null ) height = box . height / box . width * width else if ( width == null ) width = box . width / box . height * height return { width : width , height : height } }
Calculate proportional width and height values when necessary
Calculate proportional width and height values when necessary