Customize the layout of a workbook in code representation (Beta)

View as Markdown

This documentation describes one or more private beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.

This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see Beta features.

If you are interested in joining a limited test group and enabling this feature in your Sigma organization, contact Support or reach out to your Account Executive.

You can customize the layout of a workbook page in the code representation using the layout field. The layout field is an XML string that controls the size and position of each element on a page using a 24-column grid system. To control how elements are arranged on a page when you create or update a workbook using the API, specify the layout in the representation.

When you retrieve the representation of an existing workbook using the Get the code representation of a workbook endpoint, the layout field populates automatically based on the arrangement of elements on each page in the published version.

Example representation with layout

The following example shows a YAML representation of a workbook with a table and a bar chart. Both elements span the full width of the page and are stacked vertically, one above the other.

1workbookId: bc9e239e-6e00-4f0f-a5b1-2e16df3245a2
2name: bar-chart
3url: https://aws-api.sigmacomputing.com/org-name/workbook/bar-chart-K6nD3mi0cQAx9f8rriM64z
4documentVersion: 2
5latestDocumentVersion: 2
6ownerId: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
7folderId: b6c4f574-9ab6-4525-b25a-b45ed39b5e05
8createdBy: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
9updatedBy: TnQGIaVmMru7kyHwWPCQfUWjypPtZ
10createdAt: '2026-04-20T20:09:52.987Z'
11updatedAt: '2026-04-21T14:22:44.075Z'
12schemaVersion: 1
13pages:
14 - id: QKIgFmOpQt
15 name: Page 1
16 elements:
17 - id: ammWveJOET
18 kind: table
19 source:
20 connectionId: 6944db1a-f9f0-496f-91ba-4781e7f0490d
21 kind: warehouse-table
22 path:
23 - FUN
24 - BIKES
25 - TRIP
26 columns:
27 - id: VGGdL5h1XL
28 formula: '[TRIP/Id]'
29 - id: XfekGVjpYe
30 formula: '[TRIP/Duration]'
31 - id: vSNXcQlbgo
32 formula: '[TRIP/Start Date]'
33 - id: n0viQISda6
34 formula: '[TRIP/Start Station Name]'
35 - id: otGGHmPqJZ
36 formula: '[TRIP/Start Station Id]'
37 - id: jrQpKNxZxF
38 formula: '[TRIP/End Date]'
39 - id: xT5p03z0yD
40 formula: '[TRIP/End Station Name]'
41 - id: kctIxpAAqM
42 formula: '[TRIP/End Station Id]'
43 - id: VwSnzv10lZ
44 formula: '[TRIP/Bike Id]'
45 - id: pxvj425aDk
46 formula: '[TRIP/Subscription Type]'
47 - id: HZOjVcwDG1
48 formula: '[TRIP/Zip Code]'
49 order:
50 - VGGdL5h1XL
51 - XfekGVjpYe
52 - vSNXcQlbgo
53 - n0viQISda6
54 - otGGHmPqJZ
55 - jrQpKNxZxF
56 - xT5p03z0yD
57 - kctIxpAAqM
58 - VwSnzv10lZ
59 - pxvj425aDk
60 - HZOjVcwDG1
61 - id: LBMxXnUDCS
62 kind: bar-chart
63 source:
64 elementId: ammWveJOET
65 kind: table
66 columns:
67 - id: xwi1BMJ3PL
68 formula: '[TRIP/Start Station Name]'
69 - id: vKP79P5tMl
70 formula: Count([Id])
71 - id: HlVOO3VkmU
72 formula: '[TRIP/Subscription Type]'
73 - id: 7vIMaF82Ea
74 formula: '[TRIP/Id]'
75 - id: OaVsOl70Mu
76 formula: '[TRIP/Duration]'
77 - id: 2EupEbY2C1
78 formula: '[TRIP/Start Date]'
79 - id: cOt55IxOwt
80 formula: '[TRIP/Start Station Id]'
81 - id: pOeY8EgDKh
82 formula: '[TRIP/End Date]'
83 - id: YvYBibU28Y
84 formula: '[TRIP/End Station Name]'
85 - id: W8iYZkmMus
86 formula: '[TRIP/End Station Id]'
87 - id: 9xgXlflRhB
88 formula: '[TRIP/Bike Id]'
89 - id: eBbsizX2wU
90 formula: '[TRIP/Zip Code]'
91 yAxis:
92 - id: vKP79P5tMl
93 xAxis:
94 id: xwi1BMJ3PL
95 sort:
96 by: vKP79P5tMl
97 direction: descending
98layout: |
99 <?xml version="1.0" encoding="utf-8"?>
100 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="QKIgFmOpQt">
101 <LayoutElement elementId="ammWveJOET" gridColumn="1 / 25" gridRow="1 / 21"/>
102 <LayoutElement elementId="LBMxXnUDCS" gridColumn="1 / 25" gridRow="21 / 41"/>
103 </Page>

Representing layout

In this example representation, the layout for Page 1 is defined in the layout field.

1layout: |
2 <?xml version="1.0" encoding="utf-8"?>
3 <Page type="grid" gridTemplateColumns="repeat(24, 1fr)" gridTemplateRows="auto" id="QKIgFmOpQt">
4 <LayoutElement elementId="ammWveJOET" gridColumn="1 / 25" gridRow="1 / 21"/>
5 <LayoutElement elementId="LBMxXnUDCS" gridColumn="1 / 25" gridRow="21 / 41"/>
6 </Page>

The layout field contains one <Page> element per workbook page. The id attribute of <Page> must match the id of the corresponding page in the pages array. Inside <Page>, each <LayoutElement> entry corresponds to one element on the page — the elementId attribute must match the id of the corresponding element in the elements array.

The gridColumn attribute controls the horizontal position and width of an element. The grid is 1-indexed across 24 columns, where 1 is the left edge and 25 is the right edge. For example, "1 / 25" spans the full width, "1 / 13" spans the left half, and "13 / 25" spans the right half.

The gridRow attribute controls the vertical position and height of an element. In this example, "1 / 21" places the table at the top of the page and "21 / 41" places the bar chart directly below it.