Skip to content

Commit ad04aa1

Browse files
committed
merge with master
2 parents 71e7d7a + f43d555 commit ad04aa1

File tree

700 files changed

+5885
-4823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

700 files changed

+5885
-4823
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
1414
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
1515
/src/plugins/vis_type_xy/ @elastic/kibana-app
16+
/src/plugins/vis_type_table/ @elastic/kibana-app
1617
/src/plugins/kibana_legacy/ @elastic/kibana-app
1718
/src/plugins/vis_type_timelion/ @elastic/kibana-app
1819
/src/plugins/dashboard/ @elastic/kibana-app

.i18nrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"visDefaultEditor": "src/plugins/vis_default_editor",
4949
"visTypeMarkdown": "src/plugins/vis_type_markdown",
5050
"visTypeMetric": "src/plugins/vis_type_metric",
51-
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
51+
"visTypeTable": "src/plugins/vis_type_table",
5252
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
5353
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
5454
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",

docs/images/vega_lite_default.png

285 KB
Loading

docs/setup/production.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ server.port
133133
Settings that must be the same:
134134
--------
135135
xpack.security.encryptionKey //decrypting session cookies
136-
xpack.reporting.encryptionKey //decrypting reports stored in Elasticsearch
136+
xpack.reporting.encryptionKey //decrypting reports
137+
xpack.encryptedSavedObjects.encryptionKey // decrypting saved objects
137138
--------
138139

139140
Separate configuration files can be used from the command line by using the `-c` flag:

docs/visualize/vega.asciidoc

Lines changed: 100 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,80 @@
11
[[vega-graph]]
2-
== Vega Graphs
3-
experimental[]
2+
== Vega
43

5-
You can build https://vega.github.io/vega/examples/[Vega] and
6-
https://vega.github.io/vega-lite/examples/[Vega-Lite] data visualizations
7-
into Kibana, either standalone, or on top of a map. To see Vega in action,
8-
watch this
9-
https://www.youtube.com/watch?v=lQGCipY3th8[short introduction video].
4+
experimental[]
105

11-
Currently Vega version 4.3 and Vega-Lite version 2.6 are supported.
6+
Build custom visualizations from multiple data sources using Vega
7+
and Vega-Lite.
128

13-
NOTE: In Vega it is possible to load data dynamically, e.g. by setting signals as data urls. This is not supported in Kibana as all data is fetched at once prior to passing it to the Vega renderer.
9+
* *Vega* — A declarative format to create visualizations using JSON.
10+
Generate interactive displays using D3.
1411

12+
* *Vega-Lite* — An easier format to use than Vega that enables more rapid
13+
data analysis. Compiles into Vega.
1514

16-
[[vega-quick-demo]]
17-
=== Getting Started with Vega
15+
For more information about Vega and Vega-Lite, refer to
16+
<<vega-useful-links, Resources and examples>>.
1817

19-
* To experiment using sample data, first click the {kib} logo in the upper left hand corner
20-
and then click the link next to *Sample Data*.
21-
* Once you have data loaded, go to *Visualize*, click *+*, and select *Vega* to see an example graph.
22-
*Note*: The default graph is written in Vega-Lite, but you can build visualizations
23-
in either language. See <<vega-vs-vegalite, Vega vs. Vega-Lite>> for more information.
24-
* Try changing `mark` from `line` to `point`, `area`, `bar`, `circle`,
25-
or `square`. Check out the
26-
https://vega.github.io/vega-lite/docs/mark.html#mark-def[Vega-Lite docs] for more information.
27-
* Explore other available https://vega.github.io/vega/examples/[Vega] or
28-
https://vega.github.io/vega-lite/examples/[Vega-Lite] visualizations.
29-
*Note*: You might need to make URLs absolute, for example, replace
30-
`"url": "data/world-110m.json"` with
31-
`"url": "https://vega.github.io/editor/data/world-110m.json"`.
32-
See <<vega-using-vega-and-vegalite-examples, Vega and Vega-Lite examples>>.
33-
* For more information on getting started, check out this https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana[blog post].
18+
[float]
19+
[[create-vega-viz]]
20+
=== Create Vega visualizations
3421

22+
You create Vega visualizations by using the text editor, which is
23+
preconfigured with the options you need.
3524

36-
[[vega-vs-vegalite]]
37-
=== Vega vs Vega-Lite
25+
[role="screenshot"]
26+
image::images/vega_lite_default.png[]
3827

39-
The Vega visualization in {kib} supports both Vega and Vega-Lite. You can use the
40-
`schema` value to define which language you would like to use and its minimum
41-
required version.
28+
[float]
29+
[[vega-schema]]
30+
==== Change the Vega version
4231

43-
For example:
32+
The default visualization uses Vega-Lite version 2. To use Vega version 4, edit
33+
the `schema`.
4434

45-
* Vega-Lite v2: `$schema: https://vega.github.io/schema/vega-lite/v2.json`
46-
* Vega v4: `$schema: https://vega.github.io/schema/vega/v4.json`
35+
Go to `$schema`, enter `https://vega.github.io/schema/vega/v4.json`, then click
36+
*Update*.
4737

48-
The `schema` URL is only used for identification, and does not need to be accessible by {kib}.
38+
[float]
39+
[[vega-type]]
40+
==== Change the visualization type
4941

50-
Vega-Lite is a simplified version of Vega; it automates some constructions and has
51-
much shorter specifications than Vega. Vega-Lite is automatically converted into
52-
Vega before rendering, but it has some limitations, and there are some visualizations
53-
that can be expressed in Vega that cannot be expressed in Vega-Lite. You can learn more
54-
in the https://vega.github.io/vega-lite/[Vega-Lite documentation].
42+
The default visualization is a line chart. To change the visualization type,
43+
change the `mark` value. The supported visualization types are listed in the
44+
text editor.
5545

56-
You can use https://vega.github.io/editor/[this editor] to convert Vega-Lite into
57-
Vega.
46+
Go to `mark`, change the value to a different visualization type, then click
47+
*Update*.
5848

59-
When you create a Vega visualization in {kib}, you can edit the `schema`
60-
value in the dev tools to the left of the graph to define which of the two expression
61-
languages you would like to use.
49+
[float]
50+
[[vega-sizing-and-positioning]]
51+
==== Change the layout
6252

53+
By default, Vega visualizations use the `autosize = { type: 'fit', contains: 'padding' }` layout.
54+
`fit` uses all available space, ignores `width` and `height` values,
55+
and respects the padding values. To override this behavior, change the
56+
`autosize` value.
6357

6458
[[vega-querying-elasticsearch]]
65-
=== Querying Elasticsearch
59+
=== Query {es}
6660

67-
By default, Vega's https://vega.github.io/vega/docs/data/[data] element
68-
can use embedded and external data with a `"url"` parameter. Kibana adds support for the direct Elasticsearch queries by overloading
61+
experimental[] Vega https://vega.github.io/vega/docs/data/[data] elements
62+
use embedded and external data with a `"url"` parameter. {kib} adds support for
63+
direct {es} queries by overloading
6964
the `"url"` value.
7065

71-
Here is an example of an Elasticsearch query that counts the number of documents in all indexes. The query uses *@timestamp* field to filter the time range, and break it into histogram buckets.
66+
NOTE: With Vega, you dynamically load your data by setting signals as data URLs.
67+
Since {kib} is unable to support dynamically loaded data, all data is fetched
68+
before it's passed to the Vega renderer.
69+
70+
For example, count the number of documents in all indices:
7271

7372
[source,yaml]
7473
----
75-
// An object instead of a string for the url value
74+
// An object instead of a string for the URL value
7675
// is treated as a context-aware Elasticsearch query.
7776
url: {
78-
// Specify the time filter (upper right corner) with this field
77+
// Specify the time filter.
7978
%timefield%: @timestamp
8079
// Apply dashboard context filters when set
8180
%context%: true
@@ -88,8 +87,8 @@ url: {
8887
time_buckets: {
8988
date_histogram: {
9089
// Use date histogram aggregation on @timestamp field
91-
field: @timestamp
92-
// interval value will depend on the daterange picker
90+
field: @timestamp <1>
91+
// interval value will depend on the time filter
9392
// Use an integer to set approximate bucket count
9493
interval: { %autointerval%: true }
9594
// Make sure we get an entire range, even if it has no data
@@ -109,7 +108,10 @@ url: {
109108
}
110109
----
111110

112-
The full result has this kind of structure:
111+
<1> `@timestamp` &mdash; Filters the time range and breaks it into histogram
112+
buckets.
113+
114+
The full result includes the following structure:
113115

114116
[source,yaml]
115117
----
@@ -118,23 +120,24 @@ The full result has this kind of structure:
118120
"time_buckets": {
119121
"buckets": [{
120122
"key_as_string": "2015-11-30T22:00:00.000Z",
121-
"key": 1448920800000,
123+
"key": 1448920800000,<1>
122124
"doc_count": 28
123125
}, {
124126
"key_as_string": "2015-11-30T23:00:00.000Z",
125-
"key": 1448924400000,
127+
"key": 1448924400000, <1>
126128
"doc_count": 330
127129
}, ...
128130
----
129131

130-
Note that `"key"` is a unix timestamp, and can be used without conversions by the
132+
<1> `"key"` &mdash; The unix timestamp you can use without conversions by the
131133
Vega date expressions.
132134

133-
For most graphs we only need the list of the bucket values, so we use `format: {property: "aggregations.time_buckets.buckets"}` expression to focus on just the data we need.
135+
For most visualizations, you only need the list of bucket values. To focus on
136+
only the data you need, use `format: {property: "aggregations.time_buckets.buckets"}`.
134137

135-
Query may be specified with individual range and dashboard context as
136-
well. This query is equivalent to `"%context%": true, "%timefield%": "@timestamp"`,
137-
except that the timerange is shifted back by 10 minutes:
138+
Specify a query with individual range and dashboard context. The query is
139+
equivalent to `"%context%": true, "%timefield%": "@timestamp"`,
140+
except that the time range is shifted back by 10 minutes:
138141

139142
[source,yaml]
140143
----
@@ -185,9 +188,9 @@ on the currently picked range: `"interval": {"%autointerval%": 10}` will
185188
try to get about 10-15 data points (buckets).
186189

187190
[[vega-esmfiles]]
188-
=== Elastic Map Files
191+
=== Access Elastic Map Service files
189192

190-
It is possible to access Elastic Map Service's files via the same mechanism
193+
experimental[] Access the Elastic Map Service files via the same mechanism:
191194

192195
[source,yaml]
193196
----
@@ -203,11 +206,8 @@ url: {
203206
format: {property: "features"}
204207
----
205208

206-
[[vega-with-a-map]]
207-
=== Vega with a Map
208-
209-
Kibana's default map can be used as a base of the Vega graph. To enable,
210-
the graph must specify `type=map` in the host configuration:
209+
To enable Elastic Maps, the graph must specify `type=map` in the host
210+
configuration:
211211

212212
[source,yaml]
213213
----
@@ -247,42 +247,47 @@ the graph must specify `type=map` in the host configuration:
247247
}
248248
----
249249

250-
This visualization will automatically inject a projection called
251-
`"projection"`. Use it to calculate positioning of all geo-aware marks.
252-
Additionally, you may use `latitude`, `longitude`, and `zoom` signals.
250+
The visualization automatically injects a `"projection"`, which you can use to
251+
calculate the position of all geo-aware marks.
252+
Additionally, you can use `latitude`, `longitude`, and `zoom` signals.
253253
These signals can be used in the graph, or can be updated to modify the
254-
positioning of the map.
254+
position of the map.
255+
256+
Vega visualization ignore the `autosize`, `width`, `height`, and `padding`
257+
values, using `fit` model with zero padding.
255258

256259
[[vega-debugging]]
257-
=== Debugging
260+
=== Debugging Vega
258261

259262
[[vega-browser-debugging-console]]
260-
==== Browser Debugging console
263+
==== Browser debugging console
261264

262-
Use browser debugging tools (e.g. F12 or Ctrl+Shift+J in Chrome) to
265+
experimental[] Use browser debugging tools (for example, F12 or Ctrl+Shift+J in Chrome) to
263266
inspect the `VEGA_DEBUG` variable:
264-
* `view` - access to the Vega View object. See https://vega.github.io/vega/docs/api/debugging/[Vega Debugging Guide]
265-
on how to inspect data and signals at runtime. For Vega-Lite, `VEGA_DEBUG.view.data('source_0')` gets the main data set.
266-
For Vega, it uses the data name as defined in your Vega spec.
267-
* `vega_spec` - Vega JSON graph specification after some modifications by Kibana. In case
267+
+
268+
* `view` &mdash; Access to the Vega View object. See https://vega.github.io/vega/docs/api/debugging/[Vega Debugging Guide]
269+
on how to inspect data and signals at runtime. For Vega-Lite, `VEGA_DEBUG.view.data('source_0')` gets the main data set.
270+
For Vega, it uses the data name as defined in your Vega spec.
271+
272+
* `vega_spec` &mdash; Vega JSON graph specification after some modifications by {kib}. In case
268273
of Vega-Lite, this is the output of the Vega-Lite compiler.
269-
* `vegalite_spec` - If this is a Vega-Lite graph, JSON specification of the graph before
274+
275+
* `vegalite_spec` &mdash; If this is a Vega-Lite graph, JSON specification of the graph before
270276
Vega-Lite compilation.
271277

272278
[[vega-data]]
273279
==== Data
274280

275-
If you are using Elasticsearch query, make sure your resulting data is
276-
what you expected. The easiest way to view it is by using "networking"
277-
tab in the browser debugging tools (e.g. F12). Modify the graph slightly
281+
experimental[] If you are using an {es} query, make sure your resulting data is
282+
what you expected. The easiest way to view it is by using the "networking"
283+
tab in the browser debugging tools (for example, F12). Modify the graph slightly
278284
so that it makes a search request, and view the response from the
279285
server. Another approach is to use
280-
https://www.elastic.co/guide/en/kibana/current/console-kibana.html[Kibana
281-
Dev Tools] tab - place the index name into the first line:
282-
`GET <INDEX_NAME>/_search`, and add your query as the following lines
283-
(just the value of the `"query"` field)
286+
https://www.elastic.co/guide/en/kibana/current/console-kibana.html[Dev Tools]. Place the index name into the first line:
287+
`GET <INDEX_NAME>/_search`, then add your query as the following lines
288+
(just the value of the `"query"` field).
284289

285-
If you need to share your graph with someone, you may want to copy the
290+
If you need to share your graph with someone, copy the
286291
raw data response to https://gist.github.com/[gist.github.com], possibly
287292
with a `.json` extension, use the `[raw]` button, and use that url
288293
directly in your graph.
@@ -292,9 +297,11 @@ to your kibana.yml file.
292297

293298
[[vega-notes]]
294299
[[vega-useful-links]]
295-
=== Useful Links
300+
=== Resources and examples
301+
302+
experimental[] To learn more about Vega and Vega-List, refer to the resources and examples.
296303

297-
==== Vega Editor
304+
==== Vega editor
298305
The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Vega-Lite, but does not support any
299306
{kib}-specific features like {es} requests and interactive base maps.
300307

@@ -308,28 +315,15 @@ The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Veg
308315
* https://vega.github.io/vega/docs/[Docs]
309316
* https://vega.github.io/vega/examples/[Examples]
310317

311-
==== Elastic blog posts
312-
* https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana[Getting Started with Vega Visualizations in Kibana]
313-
* https://www.elastic.co/blog/custom-vega-visualizations-in-kibana[Custom Vega Visualizations in Kibana]
314-
* https://www.elastic.co/blog/sankey-visualization-with-vega-in-kibana[Sankey Visualization with Vega in Kibana]
315-
316-
317-
[[vega-using-vega-and-vegalite-examples]]
318-
==== Using Vega and Vega-Lite examples
319-
320-
When using https://vega.github.io/vega/examples/[Vega] and
321-
https://vega.github.io/vega-lite/examples/[VegaLite] examples, you may
318+
TIP: When you use the examples, you may
322319
need to modify the "data" section to use absolute URL. For example,
323320
replace `"url": "data/world-110m.json"` with
324-
`"url": "https://vega.github.io/editor/data/world-110m.json"`. Also,
325-
regular Vega examples use `"autosize": "pad"` layout model, whereas
326-
Kibana uses `fit`. Remove all `autosize`, `width`, and `height`
327-
values. See link:#sizing-and-positioning[sizing and positioning].
321+
`"url": "https://vega.github.io/editor/data/world-110m.json"`.
328322

329323
[[vega-additional-configuration-options]]
330324
==== Additional configuration options
331325

332-
These options are specific to the Kibana. link:#vega-with-a-map[Map support] has
326+
These options are specific to the {kib}. link:#vega-with-a-map[Map support] has
333327
additional configuration options.
334328

335329
[source,yaml]
@@ -351,21 +345,3 @@ additional configuration options.
351345
/* the rest of Vega code */
352346
}
353347
----
354-
355-
[[vega-sizing-and-positioning]]
356-
==== Sizing and positioning
357-
358-
[[vega-and-vegalite]]
359-
===== Vega and Vega-Lite
360-
361-
By default, Kibana Vega graphs will use
362-
`autosize = { type: 'fit', contains: 'padding' }` layout model for Vega
363-
and Vega-Lite graphs. The `fit` model uses all available space, ignores
364-
`width` and `height` values, but respects the padding values. You may
365-
override this behaviour by specifying a different `autosize` value.
366-
367-
[[vega-on-a-map]]
368-
===== Vega on a map
369-
370-
All Vega graphs will ignore `autosize`, `width`, `height`, and `padding`
371-
values, using `fit` model with zero padding.

0 commit comments

Comments
 (0)