React Embedded AnalyticsModes & Layout

AG Studio has two main modes - view and edit. Edit mode allows for the construction of reports with the drag-and-drop builder, whilst view mode allows the reports to be viewed as read-only.

Changing Mode Copy Link

The mode can be changed via the mode property.

AgStudioMode
default: 'view'
Which mode Studio is in.

Layout Properties Copy Link

The default layout setup can be overridden via the layout property. The example above adjusts the default number of columns and the row height in the layout. This affects the widget moving and resizing behaviour.

const layout = {
    columns: 4,
    rowHeight: 50,
};

<AgStudio layout={layout} />
layoutCopy Link
Partial<AgPageLayoutState>
Default layout styling.

Page Dimensions Copy Link

Page Dimensions define the space your report should fit into and how it behaves when the browser window or device size changes. They are configured per-page as part of Initial State via the pages[].layout property.

const initialState = useMemo(() => { 
	return {
        pages: [
            {
                id: 'page-1',
                layout: {
                    minWidth: 800,
                    maxWidth: 1200,
                    height: 600,
                },
            },
        ],
    };
}, []);

<AgStudio initialState={initialState} />
Initial state for Studio. Only read once on initialization. Can be used in conjunction with api.getState() to save and restore Studio state.

Width Copy Link

Width settings help keep the layout readable and well-proportioned across different screen sizes.

Min Width defaults to 720px. It defines the smallest width the page can shrink to before horizontal scrolling is needed. In the example below, a large minimum width is set, so a horizontal scrollbar appears when the viewport is narrower than the minimum width.

Max Width is optional and can be left as Auto. When left as Auto, the dashboard can continue expanding beyond the minimum width as the viewport grows.

If Max Width is set, the dashboard stops growing once it reaches that width and remains centred on the screen. In the example below, a fixed maximum width is applied, so the dashboard stops expanding and centres within the available space.

This means:

  • A required Min Width sets the minimum readable size.
  • An optional Max Width controls how wide the dashboard is allowed to grow.

Height Copy Link

Auto Height allows the page to grow as Widgets are added. This works well for dashboards that may expand over time, or reports where content scrolls vertically.

Fixed Height locks the page to a specific height, like a slide or poster. This works well when vertical boundaries need to be fixed for a consistent, contained view, especially for dashboards designed to fit on a single screen.

Panels Copy Link

Studio has four different panels that can be displayed depending on the mode:

  • AI Panel ('ai') - Used for the AI Feature.
  • Filters Panel ('filters') - Contains page filters, widget filters, cross filters, and filters from filter widgets.
  • Edit Panel ('edit') - Changes function based on the UI selection to display editing controls.
  • Data Panel ('data') - Displays the fields available in the data.

Configuring Panels Copy Link

Which panels are displayed, and on which side, can be configured for both view mode and edit mode.

The example above demonstrates displaying the Filters Panel on the left-hand side in edit mode (and collapsed by default via Initial State). In view mode, the Filters Panel is hidden completely.

const panels = {
    edit: {
        left: ['filters'],
        right: ['edit', 'data']
    },
    view: {
        left: [],
    },
};

<AgStudio panels={panels} />
panelsCopy Link
AgPanelConfig
Configure which panels are displayed and on which side.

Note that panels controlling editing functionality are only available in edit mode.

Customising Panel Content Copy Link

The content of the edit panel can be customised by using the overrides property.

overridesCopy Link
AgStudioOverrides
Overrides for the layout and widget configs.

The example above demonstrates restricting the list of available widgets via widgetTypes; hiding the widget type update options for grid widgets via widgets; and hiding the widgets section of the page setup tab via pageSetup.