Generating links into Imply

You can generate links that open to specific views from external systems by POSTing to /pivot/mkurl or <serverRoot>/pivot/mkurl.

The post body must include two keys:

# domain (string)

The domain on which Imply is running, it will simply be prefixed to the URL

# essence (Essence)

The essence JSON that describes the state. The best way to understand what goes here is to see what calls the UI makes to `/pivot/mkurl/register which utilizes the same mechanism as described here to do URL shortening.

Examples

Here are a few examples that you can try out by yourself. All the examples run on the built in example wikipedia dataset that you can make by running the quickstart.

Each example can be 'run' using curl like so:

curl -X POST --header "Content-Type:application/json" --data '
{
  "domain": "http://localhost:9095/pivot",
  "essence": {
    "dataCube": "wikipedia",
    ...
  }
}
' localhost:9095/pivot/mkurl

Example 1

Here is an example that will show the totals visualization filtered dynamically on the last day with the count measure selected and the the page dimension pinned.

{
  "domain": "http://localhost:9095/pivot",
  "essence": {
    "dataCube": "wikipedia",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "dynamic": {
            "op": "timeRange",
            "operand": {
              "op": "ref",
              "name": "m"
            },
            "duration": "P1D",
            "step": -1
          }
        }
      ]
    },
    "splits": [],
    "selectedMeasures": ["count"],
    "pinnedDimensions": ["page"],
    "visualization": "totals"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/e92363268b1674a9fa/Wikipedia"
}

Example 2

Here is an example that will show the line-chart visualization filtered on the last 3 days of data (P3D), split on time (bucketed by hour - PT1H), with count, added, deleted, and delta measures selected.

{
  "domain": "http://localhost:9095/pivot",
  "essence": {
    "dataCube": "wikipedia",
    "visualization": "line-chart",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "dynamic": {
            "op": "timeRange",
            "operand": {
              "op": "ref",
              "name": "m"
            },
            "duration": "P1D",
            "step": -3
          }
        }
      ]
    },
    "splits": [
      {
        "dimension": "__time",
        "bucketAction": {
          "op": "timeBucket",
          "duration": "PT1H"
        }
      }
    ],
    "selectedMeasures": ["count", "added", "deleted", "delta"],
    "pinnedDimensions": []
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/82898e90a02aaaaee5/Wikipedia"
}

Note: the $m variable represents maxTime - the timestamp of the latest data point. In contrast $n represents 'now'

Example 3

Here is an example that will also select some dimension filters.

{
  "domain": "http://localhost:9095/pivot",
  "essence": {
    "dataCube": "wikipedia",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "values": {
            "setType": "TIME_RANGE",
            "elements": [
              {
                "start": "2016-06-27T04:00:00.000Z",
                "end": "2016-06-27T18:00:00.000Z"
              }
            ]
          }
        },
        {
          "dimension": "channel",
          "action": "overlap",
          "values": {
            "setType": "STRING",
            "elements": [
              "#en.wikipedia",
              "#sh.wikipedia"
            ]
          }
        }
      ]
    },
    "splits": [
      {
        "dimension": "page",
        "sortType": "measure",
        "direction": "descending"
      }
    ],
    "selectedMeasures": ["count"],
    "pinnedDimensions": ["user"],
    "visualization": "table"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/5d15ca02fc1a2839f6/Wikipedia"
}
Overview

Tutorial

Deploy

Manage Data

Query Data

Visualize

Configure

Special UI Features

Misc