Generating links into Pivot

You can generate Pivot links from external systems by posting to /mkurl or <serverRoot>/mkurl.

The post body must include 3 keys:

# domain (string)

The domain on which pivot is running

# essence (Essence)

The essence JSON that describes the state

Examples

Here are a few examples that you can try out by yourself. All the examples run on the built in example dataset that comes with pivot.

To follow along please start pivot in --examples mode like so:

pivot --examples

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

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

Example 1

Here is an example that will show the totals visualization filtered on 2015-09-10Z - 2015-09-20Z with count and added metrics selected, the page dimension pinned.

{
  "domain": "http://localhost:9090",
  "essence": {
    "dataCube": "wiki",
    "visualization": "line-chart",
    "timezone": "Etc/UTC",
    "filter": "$time.overlap(\"2015-09-10Z\", \"2015-09-20Z\")",
    "splits": [{
      "dimension": "time",
      "bucketAction": {
        "op": "timeBucket",
        "duration": "PT1H"
      }
    }],
    "singleMeasure": "count",
    "selectedMeasures": ["count", "added", "deleted", "delta"],
    "pinnedDimensions": [],
    "measureMode": "multi"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9090#wiki/line-chart/2/EQUQLgxg9AqgKgYWAGgN7APYAdgC5gQAWAhgJYB2KwApgB5YBO1Azs6RpbutnsEwGZVyxALbVeYUmOABfZMGIRJHPOkXLOwClTqMWbFV0w58AG1JhqDYqaoA3GwFdxR5mGIMwvAEwAGAIwArAC0vgCcwf6+cL6+uLHxvgB0sb4AWjrkACY+ASHhwX4xcQmxKbEZcsBgAJ5YLsBwAJIAsiAA+gBKAIIAcgDiILIycgDa6LpMrOyc3CZ81ILywtL4ktJVAEaOEADW1GDdSjOqCseG1VLUAEI7+17yWY7WGrwACnD+ABKy8swYniOryM6hO+H+nh09CmBlmxl4AiEoga63EVSypCY500xGYEGo2QoAHNhgBdZBgBjOeQQDCOcgPUYEOkMqjELJZag5R7UUwHLlUTmmdzAcmjcnkRymUxAA="
}

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:9090",
  "essence": {
    "dataCube": "wiki",
    "visualization": "line-chart",
    "timezone": "Etc/UTC",
    "filter": "$time.overlap($m.timeRange(P3D, -1))",
    "splits": [
      {
        "dimension": "time",
        "bucketAction": {
          "op": "timeBucket",
          "duration": "PT1H"
        }
      }
    ],
    "singleMeasure": "count",
    "selectedMeasures": ["count", "added", "deleted", "delta"],
    "pinnedDimensions": [],
    "measureMode": "multi"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9090#wiki/line-chart/2/EQUQLgxg9AqgKgYWAGgN7APYAdgC5gQAWAhgJYB2KwApgB5YBO1Azs6RpbutnsE..."
}

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 auto determine the visualization using the same rules as when a dimension is selected in the UI. It will also be filtered on two specific channels, split on page (bucketed by hour - PT1H).

{
  "domain": "http://localhost:9090",  
  "essence": {
    "dataCube": "wiki",
    "timezone": "Etc/UTC",
    "filter": "$time.overlap($m.timeRange(P1D, -1)).and($channel.in([\"en\", \"fr\"]))",
    "splits": ["page"],
    "singleMeasure": "count",
    "selectedMeasures": ["count", "added", "deleted", "delta"],
    "pinnedDimensions": [],
    "measureMode": "multi"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9090#wiki/table/2/EQUQLgxg9AqgKgYWAGgN7APYAdgC5gQAWAhgJYB2KwApgB5YBO1Azs..."
}
Pivot

Advanced

Api