Shape Layout JSON Example

Started by digitalhigh

digitalhigh

Hello!

I have an app that draws the full layout of a nanoleaf set, and I noticed that the api documentation doesn't have an example of the JSON from a layout response for shapes.

Can someone provide some info on what this response would look like, since the shapes can have varying side lengths?

Thanks!

Aliakbar Eski

Sure,

I have a bunch of hexagons and a single mini triangle making it a mixed shapes layout.

This is the response from the /api/v1/<auth>/panelLayout/layout endpoint:

{
    "numPanels": 11,
    "sideLength": 0,
    "positionData": [
        {
            "panelId": 42190,
            "x": 737,
            "y": 34,
            "o": 0,
            "shapeType": 7
        },
        {
            "panelId": 42355,
            "x": 636,
            "y": 92,
            "o": 240,
            "shapeType": 7
        },
        {
            "panelId": 33247,
            "x": 536,
            "y": 34,
            "o": 540,
            "shapeType": 7
        },
        {
            "panelId": 48266,
            "x": 435,
            "y": 92,
            "o": 660,
            "shapeType": 7
        },
        {
            "panelId": 30016,
            "x": 335,
            "y": 150,
            "o": 660,
            "shapeType": 7
        },
        {
            "panelId": 6318,
            "x": 335,
            "y": 266,
            "o": 720,
            "shapeType": 7
        },
        {
            "panelId": 37053,
            "x": 234,
            "y": 324,
            "o": 720,
            "shapeType": 7
        },
        {
            "panelId": 37729,
            "x": 134,
            "y": 266,
            "o": 780,
            "shapeType": 7
        },
        {
            "panelId": 63700,
            "x": 67,
            "y": 227,
            "o": 960,
            "shapeType": 9
        },
        {
            "panelId": 51554,
            "x": 0,
            "y": 266,
            "o": 1080,
            "shapeType": 7
        },
        {
            "panelId": 0,
            "x": 796,
            "y": 0,
            "o": 240,
            "shapeType": 12
        }
    ]
}

Hope this helps

Regards
Aliakbar Eski