layout_by function

Use transform spec to layout data.