[js] adding a function to set ratio and size bounds at once