Skip to content

Commit

Permalink
migrating from new core 6.2 ver
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jan 6, 2018
1 parent b26707d commit cc761dd
Show file tree
Hide file tree
Showing 52 changed files with 2,538 additions and 1,142 deletions.
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ Kibana's default map can be used as a base of the Vega graph. To enable, the gra

```yaml
{
"_hostConfig": {
"type": "map",

// Initial map position
"latitude": 40.7, // default 0
"longitude": -74, // default 0
"zoom": 7, // default 2
"mapStyle": "default", // defaults to "default", but can also be false to disable base layer
"minZoom": 5, // default 0
"maxZoom": 13, // defaults to the maximum for the given style, or 25 when base is disabled
"zoomControl": false, // defaults to true, shows +/- buttons to zoom in/out

// When false, repaints on each move frame. Makes the graph slower when moving the map
"delayRepaint": true, // default true
"config": {
"kibana": {
"type": "map",

// Initial map position
"latitude": 40.7, // default 0
"longitude": -74, // default 0
"zoom": 7, // default 2
"mapStyle": "default", // defaults to "default", but can also be false to disable base layer
"minZoom": 5, // default 0
"maxZoom": 13, // defaults to the maximum for the given style, or 25 when base is disabled
"zoomControl": false, // defaults to true, shows +/- buttons to zoom in/out

// When false, repaints on each move frame. Makes the graph slower when moving the map
"delayRepaint": true, // default true
}
},
/* the rest of Vega JSON */
}
Expand All @@ -59,9 +61,10 @@ Here is an example of an ES query that gets data from `logstash-*` index.
// Index name
"index": "logstash-*",

// Use current dashboard search string and time range filter with the "@timestamp" field.
// Set value to true to ignore the time filter
"%context_query%": "@timestamp",
// Use current dashboard context (e.g. search string),
// and time range filter with the "@timestamp" field.
"%context%": true,
"%timefield%": "@timestamp",

// TIP: request can be copied from the debug view of another visualizer
// You can try this query in Kibana Dev tools (hardcode or remove the `%...%` values first)
Expand Down Expand Up @@ -118,7 +121,7 @@ As a result, "myEsDataSource" will be a list of objects. Note that `"key"` is a
]
```

Query may be specified with individual range and dashboard context as well. This query is equivalent to `"%context_query%": "@timestamp"`, except that the timerange is shifted back by 10 minutes:
Query may be specified with individual range and dashboard context as well. This query is equivalent to `"%context%": true, "%timefield%": "@timestamp"`, except that the timerange is shifted back by 10 minutes:

```yaml
{
Expand Down Expand Up @@ -194,14 +197,16 @@ When using [Vega](https://vega.github.io/vega/examples/) and [VegaLite](https://
These options are specific to this plugin. They control how plugin interprets your Vega spec. [Map support](#vega-with-a-map) has additional configuration options.
```yaml
{
"_hostConfig": {
// Placement of the Vega-defined signal bindings.
// Can be `left`, `right`, `top`, or `bottom` (default).
"controlsLocation": "top",
// Can be `vertical` or `horizontal` (default).
"controlsDirection": "vertical",
// If true, hides most of Vega and VegaLite warnings
"hideWarnings": true,
"config": {
"kibana": {
// Placement of the Vega-defined signal bindings.
// Can be `left`, `right`, `top`, or `bottom` (default).
"controlsLocation": "top",
// Can be `vertical` or `horizontal` (default).
"controlsDirection": "vertical",
// If true, hides most of Vega and VegaLite warnings
"hideWarnings": true,
}
},
/* the rest of Vega JSON */
}
Expand Down
24 changes: 13 additions & 11 deletions examples/custom-map/vega-code.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"_hostConfig": {
"type": "map",
"latitude": 10,
"longitude": 21,
"zoom": 4,
"mapStyle": false,
"minZoom": 2,
"maxZoom": 9,
"zoomControl": false,
"delayRepaint": false,
"controlsDirection": "horizontal"
"config": {
"kibana": {
"type": "map",
"latitude": 10,
"longitude": 21,
"zoom": 4,
"mapStyle": false,
"minZoom": 2,
"maxZoom": 9,
"zoomControl": false,
"delayRepaint": false,
"controlsDirection": "horizontal"
}
},
"data": [
{
Expand Down
18 changes: 10 additions & 8 deletions examples/external_and_embedded_data/map_unemployment_data.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"_hostConfig": {
"type": "map",
"delayRepaint": false,
"latitude": 41,
"longitude": -74,
"zoom": 4,
"controlsLocation": "top",
"controlsDirection": "horizontal"
"config": {
"kibana": {
"type": "map",
"delayRepaint": false,
"latitude": 41,
"longitude": -74,
"zoom": 4,
"controlsLocation": "top",
"controlsDirection": "horizontal"
}
},
"signals": [
{
Expand Down
Empty file added examples/fromVega/contour.hjson
Empty file.
Empty file added examples/fromVega/violin.hjson
Empty file.
38 changes: 11 additions & 27 deletions examples/logstash/logstash-geosrc-map-with-destinations.hjson
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
$schema: https://vega.github.io/schema/vega/v3.0.json
_hostConfig: {
type: map
latitude: 10
longitude: -5
zoom: 2
delayRepaint: false
config: {
kibana: {type: "map", latitude: 10, longitude: -5, zoom: 2, delayRepaint: false}
}
data: [
{
Expand All @@ -26,8 +22,8 @@
}
{
name: allCountries
url: https://layers.geo.elastic.co/blob/5659313586569216?elastic_tile_service_tos=agree
format: {type: "json", property: "features"}
url: {%type%: "emsfile", name: "World Countries"}
format: {property: "features"}
transform: [
{type: "formula", expr: "datum.properties.iso2", as: "countryCode"}
{
Expand All @@ -54,7 +50,8 @@
name: logCount
url: {
index: logstash-*
%context_query%: @timestamp
%context%: true
%timefield%: @timestamp
body: {
size: 0
aggs: {
Expand All @@ -69,7 +66,7 @@
}
}
}
format: {type: "json", property: "aggregations.countries.buckets"}
format: {property: "aggregations.countries.buckets"}
transform: [
{
type: lookup
Expand Down Expand Up @@ -112,9 +109,7 @@
from: {data: "countries"}
encode: {
enter: {
tooltip: {
signal: datum.countryCode + ': ' + format(datum.doc_count, '0,')
}
tooltip: {signal: "datum.countryCode + ': ' + format(datum.doc_count, '0,')"}
fillOpacity: {value: 0.7}
}
update: {
Expand Down Expand Up @@ -146,22 +141,15 @@
name: selectedDatum
source: logCount
transform: [
{
type: filter
expr: hover && datum.key == hover.countryCode && datum.source
}
{type: "filter", expr: "hover && datum.key == hover.countryCode && datum.source"}
]
}
]
marks: [
{
type: group
from: {
facet: {
name: facetedDatum
data: selectedDatum
field: dest.buckets
}
facet: {name: "facetedDatum", data: "selectedDatum", field: "dest.buckets"}
}
data: [
{
Expand Down Expand Up @@ -217,11 +205,7 @@
values: ["rank"]
fields: ["key"]
}
{
type: formula
as: Category
expr: datum.rank < 5 ? datum.key : 'Other'
}
{type: "formula", as: "Category", expr: "datum.rank < 5 ? datum.key : 'Other'"}
{
type: aggregate
groupby: ["Category"]
Expand Down
110 changes: 0 additions & 110 deletions examples/logstash/logstash-geosrc-map.json

This file was deleted.

3 changes: 2 additions & 1 deletion examples/logstash/logstash-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"name": "table",
"url": {
"index": "logstash-*",
"%context_query%": "@timestamp",
"%context%": true,
"%timefield%": "@timestamp",
"body": {
"size": 0,
"aggs": {
Expand Down

0 comments on commit cc761dd

Please sign in to comment.