compute layout based on svg width