Full Example - Target different layouts with different screens and layouts

Modified on Thu, 10 Sep 2020 at 12:42 PM

This is a full copy&paste ready example for part 3) in the Apps - Getting Started article.


{
  "version": "0.1",
  "screens": [
    {
      "layout": "largeLayout",
      "conditions": {
        "minScreenWidth": 2000
      }
    },
    {
      "layout": "defaultLayout"
    }
  ],
  "layouts": [
    {
      "id": "defaultLayout",
      "type": "fixedGrid",
      "config": {
        "dim": {
          "x": 24,
          "y": 24
        },
        "containers": [
          {
            "id": "container1",
            "pos": {
              "x": 1,
              "y": 1
            },
            "size": {
              "w": 24,
              "h": 4
            }
          },
          {
            "id": "container2",
            "pos": {
              "x": 1,
              "y": 5
            },
            "size": {
              "w": 24,
              "h": 10
            }
          },
          {
            "id": "container3",
            "pos": {
              "x": 1,
              "y": 15
            },
            "size": {
              "w": 24,
              "h": 10
            }
          }
        ]
      },
      "placements": [
        {
          "containerId": "container1",
          "elementId": "helloWorld"
        },
        {
          "containerId": "container2",
          "elementId": "myHighchartsElement"
        },
        {
          "containerId": "container3",
          "elementId": "myHighchartsElement"
        }
      ]
    },
    {
      "id": "largeLayout",
      "type": "fixedGrid",
      "config": {
        "dim": {
          "x": 24,
          "y": 24
        },
        "containers": [
          {
            "id": "container1",
            "pos": {
              "x": 1,
              "y": 1
            },
            "size": {
              "w": 24,
              "h": 4
            }
          },
          {
            "id": "container2",
            "pos": {
              "x": 1,
              "y": 5
            },
            "size": {
              "w": 12,
              "h": 20
            }
          },
          {
            "id": "container3",
            "pos": {
              "x": 13,
              "y": 5
            },
            "size": {
              "w": 12,
              "h": 20
            }
          }
        ]
      },
      "placements": [
        {
          "containerId": "container1",
          "elementId": "helloWorld"
        },
        {
          "containerId": "container2",
          "elementId": "myHighchartsElement"
        },
        {
          "containerId": "container3",
          "elementId": "myHighchartsElement"
        }
      ]
    }
  ],
  "elements": [
    {
      "id": "helloWorld",
      "type": "html",
      "config": {
        "html": "<h1>Hello World!</h1>"
      }
    },
    {
      "id": "myHighchartsElement",
      "type": "highcharts",
      "source": "raw_testSource",
      "config": {
        "title": {
          "text": "My Chart"
        },
        "subtitle": {
          "text": "My Untitled Chart"
        },
        "exporting": {},
        "yAxis": {
          "title": {}
        },
        "series": [
          {
            "name": "Tokyo",
            "turboThreshold": 0
          },
          {
            "name": "New York",
            "turboThreshold": 0
          },
          {
            "name": "Berlin",
            "turboThreshold": 0
          },
          {
            "name": "London",
            "turboThreshold": 0
          }
        ],
        "plotOptions": {
          "series": {
            "animation": false
          }
        },
      }
    }
  ],
  "datasources": [
    {
      "id": "raw_testSource",
      "origin": "raw",
      "config": {
        "schema": "table",
        "data": [
          {
            "Categories": "Jan",
            "Berlin": 1.5,
            "Tokyo": 2.2,
            "New York": 2.3,
            "London": 1.1
          },
          {
            "Categories": "Feb",
            "Berlin": 2.1,
            "Tokyo": 2.8,
            "New York": 2.9,
            "London": 3.1
          },
          {
            "Categories": "Mar",
            "Berlin": 1.2,
            "Tokyo": 20.8,
            "New York": 2.1,
            "London": 2.4
          },
          {
            "Categories": "Apr",
            "Berlin": 0.2,
            "Tokyo": 4.2,
            "New York": 3.7,
            "London": 2.5
          }
        ]
      }
    }
  ]
}



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article