Design Responsive Layout

As a story designer, you can use responsive pages and define responsive rules to design SAP Analytics Cloud stories that can adapt to different screen sizes.

Prerequisites

To design a story that can adapt to different screen sizes, use responsive pages.

If you're creating a responsive story from scratch, on the Stories start page, under Create choose Responsive.

Context

With responsive pages, you can:
  • Configure responsive rules for different devices, including custom ones.

    The rules cascade down from larger to smaller devices, and you can activate rules for specific devices to override.

    For phones, there's a default responsive rule, where widgets are placed sequentially and each occupies the full width of the screen. You can further customize the rule.

  • Set widgets' position, size and visibility, so that they can be automatically adjusted to different screen sizes.

  • Freely position widgets.

  • Auto-flow widgets by horizontal or vertical priority.

  • Overlap widgets, for example, a button over a chart.

  • Have a live preview in edit time of how your story looks like on different devices.

On responsive pages, widgets can be grouped by lanes, and you can configure the responsive rule for each lane. Widgets in the same lane stay together when the responsive page is resized. To add a lane, from (More Actions), select Add Lane, and then select Add Lane to Left, Add Lane to Right, Add Lane Above or Add Lane Below.

Learning Tutorial

Click through the interactive tutorial illustrating how to define responsive rules in step-by-step instructions (3:00 min); the tutorial is captioned exclusively in English:

Procedure

  1. From the device preview bar, select a device for which you'd like to configure the responsive rule.

    By default the device preview bar is shown at the bottom. If not, from View in the toolbar, select Device Preview Bar.

    The following devices are available:

    Device

    Width × Height

    Auto

    No limit

    The responsive rule for Auto applies to all devices, except for ones with rules defined.

    Desktop

    1920 × 1080 px

    Laptop

    1366 × 768 px

    4k UHD

    3840 × 2160 px

    iOS Phone (Small)

    375 × 812 px

    iOS Phone (Large)

    480 × 844 px

    iOS Tablet (Small)

    1024 × 768 px

    iOS Tablet (Large)

    1366 × 1024 px

    Android Phone (Generic)

    480 × 853 px

    Android Tablet (Medium)

    1024 × 768 px

    Android Tablet (Large)

    1280 × 800 px

    If your device isn't in the list, you can select (Add) to add it to the list. In the Add Device dialog, select the device and then enter the width and height in pixel..

  2. Select a lane on the responsive page.
  3. Go to the Builder panel of the lane. To open it, from View in the toolbar, select Right Side Panel.

    In the Builder panel, you can configure responsive rule for the selected lane and device.

  4. To start responsive rule configuration, switch on Activate.

    The responsive rule automatically cascades to smaller devices. To configure another rule for its smaller device, you need to activate in the same way.

  5. Set the widget position in either of the following ways:
    • Free: You can freely move and position the widgets in the lane. Widgets stay in a specific position, irrespective of others and device type.

      You can also determine the space allowances on widgets' top or left:
      1. In Widget Top Spacing or Widget Left Spacing, select Add Widget.

      2. From the dropdown list, select Each Widget or a specific widget.

        The setting for a specific widget overwrites the one for each widget.

      3. Specify the grid spaces:
        • For the space on top, enter an integer between 0 and 200.

        • For the space on left, enter an integer between 0 and 35.

    • Auto-Flow: Widgets are positioned sequentially, based on Row or Column.

      You can also select widgets to remove from auto-flow and set the space on its top and left so that they can be freely positioned to a specific place.

      A combination of free positioning and auto-flow is helpful when most widgets need to displayed one by one on smaller devices like mobile phone, while some always stay in a specific position regardless of screen size, such as your branding image.

  6. Set the widget size:
    1. In Widget Width or Widget Height, select Add Widget.
    2. From the dropdown list, select Each Widget or a specific widget.

      The setting for a specific widget overwrites the one for each widget.

    3. Specify the widget width or height in grid.
      • For the widget width, enter an integer between 1 and 36. The percentage is also shown for you to calculate how much of the screen width the widgets take up.

      • For the widget height, enter an integer between 1 and 200.

  7. Set the widget visibility.

    Under Hide the widgets, select the widgets to be hidden on the device. For example, you can hide a table if it has too many data to be mobile friendly.

  8. Define rules for all the other lanes on your page.

Results

You can configure responsive rules for more devices to make your story adapt to different devices. The device preview bar lets you select any device to have a live preview in edit time of how your story looks like and adjust your rule configuration accordingly.

In view time, the widgets are resized, repositioned or hidden when the screen reaches or is no greater than certain width, according to the responsive rule you've configured.

Unsupported APIs for Responsive Lanes

The following APIs, such as layout APIs, aren't supported for responsive lanes:
  • setLeft, getLeft

  • setRight, getRight

  • setTop, getTop

  • setBottom, getBottom

  • Page.moveWidget