Skip to content

Commit

Permalink
Merge branch 'master' into scottybollinger/groups
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 28, 2020
2 parents 8c2d5d4 + c285287 commit 3b0e58e
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 67 deletions.
6 changes: 3 additions & 3 deletions docs/canvas/canvas-edit-workpads.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ For example, to change the index pattern for a set of charts:
Specify the variable options.

[role="screenshot"]
image::images/specify_variable_syntax.png[Specify the variable syntax]
image::images/specify_variable_syntax.png[Image describing how to specify the variable syntax]

Copy the variable, then apply it to each element you want to update in the *Expression editor*.

[role="screenshot"]
image::images/copy_variable_syntax.png[Copy the variable syntax]
image::images/copy_variable_syntax.png[Image demonstrating expression editor]

[float]
[[apply-changes-to-the-entire-workpad]]
Expand Down Expand Up @@ -85,7 +85,7 @@ To use an element with the same functionality and appearance in multiple places,
Select the element, then click *Edit > Clone*.

[role="screenshot"]
image::images/clone_element.gif[Clone elements]
image::images/clone_element.gif[Image showing how to clone elements]

[float]
[[move-and-resize-elements]]
Expand Down
8 changes: 4 additions & 4 deletions docs/canvas/canvas-expression-lifecycle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The filtered <<demodata_fn, demo data>> becomes the _context_ of the next functi

Let’s look at another expression, which uses the same <<demodata_fn, demodata>> function, but instead produces a pie chart.

image::images/canvas-functions-can-take-arguments-pie-chart.png[Pie Chart, height=400]
image::images/canvas-functions-can-take-arguments-pie-chart.png[Pie chart showing output of demodata function]
[source,text]
----
filters
Expand All @@ -47,7 +47,7 @@ If the expression stopped there, it would produce a `pointseries` data type as t
The end result is a simple pie chart that uses the default color palette, but the <<pie_fn, pie>> function can take additional arguments that control how it gets rendered. For example, you can provide a `hole` argument to turn your pie chart into a donut chart by changing the expression to:


image::images/canvas-functions-can-take-arguments-donut-chart.png[Donut Chart, height=400]
image::images/canvas-functions-can-take-arguments-donut-chart.png[Alternative output as donut chart]
[source,text]
----
filters
Expand Down Expand Up @@ -83,7 +83,7 @@ You can substitute one function for another to change the output. For example, y

Let’s change that last pie chart into a bubble chart by replacing the <<pie_fn, pie>> function with the <<plot_fn, plot>> function. This is possible because both functions can accept a `pointseries` data type as their _context_. Switching the functions will work, but it won’t produce a useful visualization on its own since you don’t have the x-axis and y-axis defined. You will also need to modify the <<pointseries_fn, pointseries>> function to change its output. In this case, you can change the `size` argument to `y`, so the maximum price values are plotted on the y-axis, and add an `x` argument using the `@timestamp` field in the data to plot those values over time. This leaves you with the following expression and produces a bubble chart showing the max price of each state over time:

image::images/canvas-change-your-expression-chart.png[Bubble Chart, height=400]
image::images/canvas-change-your-expression-chart.png[Bubble Chart, with price along x axis, and time along y axis]
[source,text]
----
filters
Expand All @@ -95,7 +95,7 @@ filters

Similar to the <<pie_fn, pie>> function, the <<plot_fn, plot>> function takes arguments that control the design elements of the visualization. As one example, passing a `legend` argument with a value of `false` to the function will hide the legend on the chart.

image::images/canvas-change-your-expression-chart-no-legend.png[Bubble Chart Without Legend, height=400]
image::images/canvas-change-your-expression-chart-no-legend.png[Bubble Chart Without Legend]
[source,text,subs=+quotes]
----
filters
Expand Down
4 changes: 2 additions & 2 deletions docs/canvas/canvas-present-workpad.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ image::images/canvas-autoplay-interval.png[Element autoplay interval]
. To start your presentation, click *View > Enter fullscreen mode*.
+
[role="screenshot"]
image::images/canvas-fullscreen.png[Fullscreen mode]
image::images/canvas-fullscreen.png[Image showing how to enter fullscreen mode from view dropdown]

. When you are ready to exit fullscreen mode, press the Esc (Escape) key.

Expand All @@ -33,7 +33,7 @@ To get a closer look at a portion of your workpad, use the zoom options.
. Select the zoom option.
+
[role="screenshot"]
image::images/canvas-zoom-controls.png[Zoom controls]
image::images/canvas-zoom-controls.png[Zoom controls, also in view dropdown]

[float]
[[configure-auto-refresh-interval]]
Expand Down
8 changes: 4 additions & 4 deletions docs/canvas/canvas-share-workpad.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Create a JSON file of your workpad that you can export outside of {kib}.
Click *Share > Download as JSON*.

[role="screenshot"]
image::images/canvas-export-workpad.png[Export single workpad]
image::images/canvas-export-workpad.png[Export single workpad through JSON, from Share dropdown]

Want to export multiple workpads? Go to the *Canvas* home page, select the workpads you want to export, then click *Export*.

Expand All @@ -26,7 +26,7 @@ If you have a subscription that supports the {report-features}, you can create a
Click *Share > PDF reports > Generate PDF*.

[role="screenshot"]
image::images/canvas-generate-pdf.gif[Generate PDF]
image::images/canvas-generate-pdf.gif[Image showing how to generate a PDF]

For more information, refer to <<reporting-getting-started, Reporting from Kibana>>.

Expand All @@ -39,7 +39,7 @@ If you have a subscription that supports the {report-features}, you can create a
Click *Share > PDF reports > Copy POST URL*.

[role="screenshot"]
image::images/canvas-create-URL.gif[Create POST URL]
image::images/canvas-create-URL.gif[Image showing how to create POST URL]

For more information, refer to <<automating-report-generation, Automating report generation>>.

Expand All @@ -58,7 +58,7 @@ beta[] Canvas allows you to create _shareables_, which are workpads that you dow
To make sure that your data remains secure, the data in the JSON file is not connected to {kib}. Canvas does not display elements that manipulate the data on the workpad.
+
[role="screenshot"]
image::canvas/images/canvas-embed_workpad.gif[Share the workpad on a website]
image::canvas/images/canvas-embed_workpad.gif[Image showing how to share the workpad on a website]
+
NOTE: Shareable workpads encode the current state of the workpad in a JSON file. When you make changes to the workpad, the changes do not appear in the shareable workpad on your website.

Expand Down
8 changes: 4 additions & 4 deletions docs/canvas/canvas-tutorial.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The default Elastic logo image appears on the page.
. To replace the Elastic logo with your own image, select the image, then use the editor.

[role="screenshot"]
image::images/canvas-image-element.png[]
image::images/canvas-image-element.png[Image showing how to add the image element]

[float]
=== Customize your data with metrics
Expand Down Expand Up @@ -70,7 +70,7 @@ You're now looking at the raw data syntax that Canvas uses to display the elemen
.. Click *Run*.

[role="screenshot"]
image::images/canvas-metric-element.png[]
image::images/canvas-metric-element.png[Image showing changes to the Canvas workpad]

[float]
=== Show off your data with charts
Expand All @@ -96,7 +96,7 @@ To show what your data can do, add charts, graphs, progress monitors, and more t
.. From the *Y-axis* drop-down lists, select *Value*, then select *taxless_total_price*.

[role="screenshot"]
image::images/canvas-chart-element.png[]
image::images/canvas-chart-element.png[Image showing Canvas workpad with sample data graph]

[float]
=== Show how your data changes over time
Expand All @@ -110,7 +110,7 @@ To focus your data on a specific time range, add the time filter.
. To use the date time field from the sample data, enter `order_date` in the *Column* field, then click *Set*.

[role="screenshot"]
image::images/canvas-timefilter-element.png[]
image::images/canvas-timefilter-element.png[Image showing Canvas workpad with filtered sample data graph]

To see how the data changes, set the time filter to *Last 7 days*. As you change the time filter options, the elements automatically update.

Expand Down
2 changes: 1 addition & 1 deletion docs/discover/context.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The anchor document is highlighted in blue.


[role="screenshot"]
image::images/Discover-ContextView.png[Context View]
image::images/Discover-ContextView.png[Image showing context view feature, with anchor documents highlighted in blue]

[float]
[[filter-context]]
Expand Down
2 changes: 1 addition & 1 deletion docs/discover/document-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ immediately before and after your event.
share the link for direct access to a particular document.

[role="screenshot"]
image::images/Expanded-Document.png[]
image::images/Expanded-Document.png[Image showing expanded view, with JSON and table viewing options]


[float]
Expand Down
2 changes: 1 addition & 1 deletion docs/discover/field-filter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ the field, the top 5 values for the field, and the percentage of documents
that contain each value.
+
[role="screenshot"]
image::images/filter-field.png[height=317]
image::images/filter-field.png[Picture showing top 5 values for each field, and correspnding percentage of documents that contain each value]

. Use the image:images/PositiveFilter.jpg[Positive Filter] icon to
show only documents that contain that value,
Expand Down
2 changes: 1 addition & 1 deletion docs/discover/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configure a refresh interval to periodically resubmit your searches to
retrieve the latest results.

[role="screenshot"]
image::images/autorefresh-interval.png[]
image::images/autorefresh-interval.png[Image showing what refresh interval option looks like. The configurable time interval is located in the dropdown]

You can also manually refresh the search results by
clicking the *Refresh* button.
Expand Down
4 changes: 2 additions & 2 deletions docs/discover/set-time-filter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ range in the histogram.
Use the time filter to change the time range. By default, the time filter is set
to the last 15 minutes.

. Click image:images/time-filter-calendar.png[].
. Click image:images/time-filter-calendar.png[Calendar icon].

. Choose one of the following:

Expand Down Expand Up @@ -53,4 +53,4 @@ when you hover over a valid start point.
* Click the dropdown, then select an interval.

[role="screenshot"]
image::images/Histogram-Time.png[Time range selector in Histogram]
image::images/Histogram-Time.png[Time range selector in Histogram dropdown]
2 changes: 1 addition & 1 deletion docs/discover/viewing-field-stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ they are available in the side bar if you uncheck "Hide missing fields".

To view field data statistics, click the name of a field in the fields list.

image:images/filter-field.png[Field Statistics,height=317]
image:images/filter-field.png[Fields list that displays the top five search results]
4 changes: 2 additions & 2 deletions docs/getting-started/tutorial-discovering.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The search returns all account numbers between zero and 99 with balances in
excess of 47,500. Results appear for account numbers 8, 32, 78, 85, and 97.
+
[role="screenshot"]
image::images/tutorial-discover-2.png[]
image::images/tutorial-discover-2.png[Image showing the search results for account numbers between zero and 99, with balances in excess of 47,500]
+
. Hover over the list of *Available fields*, then
click *Add* next to each field you want include in the table.
Expand All @@ -30,6 +30,6 @@ For example, when you add the `account_number` field, the display changes to a l
account numbers.
+
[role="screenshot"]
image::images/tutorial-discover-3.png[]
image::images/tutorial-discover-3.png[Image showing a dropdown with five account numbers, which match the previous query for account balance]

Now that you know what your documents contain, it's time to gain insight into your data with visualizations.
16 changes: 8 additions & 8 deletions docs/getting-started/tutorial-visualizing.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To visualize the Shakespeare data and compare the number of speaking parts in th
. Click *Create new*, then click *Lens* on the *New Visualization* window.
+
[role="screenshot"]
image::images/tutorial-visualize-wizard-step-1.png[Bar chart]
image::images/tutorial-visualize-wizard-step-1.png[Image showing different options for your new visualization]

. Make sure the index pattern is *shakes*.

Expand All @@ -39,7 +39,7 @@ image::images/tutorial-visualize-wizard-step-1.png[Bar chart]
.. In the *Label* field, enter `Speaking Parts`.
+
[role="screenshot"]
image::images/tutorial-visualize-bar-1.5.png[Bar chart]
image::images/tutorial-visualize-bar-1.5.png[Bar chart showing the speaking parts data]

. *Save* the chart with the name `Bar Example`.
+
Expand Down Expand Up @@ -85,7 +85,7 @@ Since the default search matches all documents, the pie contains a single slice.
The pie chart displays the proportion of the 1,000 accounts that fall into each of the ranges.
+
[role="screenshot"]
image::images/tutorial-visualize-pie-2.png[Pie chart]
image::images/tutorial-visualize-pie-2.png[Pie chart displaying accounts that fall into each of the ranges, scaled to 1000 accounts]

. Add another bucket aggregation that displays the ages of the account holders.

Expand All @@ -99,7 +99,7 @@ The break down of the ages of the account holders are displayed
in a ring around the balance ranges.
+
[role="screenshot"]
image::images/tutorial-visualize-pie-3.png[Final pie chart]
image::images/tutorial-visualize-pie-3.png[Final pie chart showing all of the changes]

. Click *Save*, then enter `Pie Example` in the *Title* field.

Expand All @@ -119,7 +119,7 @@ To visualize geographic information in the log file data, use <<maps,Maps>>.
.. Set the *End date* to `May 20, 2015 @ 12:00:00.000`.
+
[role="screenshot"]
image::images/gs_maps_time_filter.png[Time filter for Maps tutorial]
image::images/gs_maps_time_filter.png[Image showing the time filter for Maps tutorial]

.. Click *Update*

Expand All @@ -140,7 +140,7 @@ image::images/gs_maps_time_filter.png[Time filter for Maps tutorial]
.. From the *Border color* dropdown, select *#FFF*, then click *Save & close*.
+
[role="screenshot"]
image::images/tutorial-visualize-map-2.png[Map]
image::images/tutorial-visualize-map-2.png[Example of a map visualization]

. Click *Save*, then enter `Map Example` in the *Title* field.

Expand Down Expand Up @@ -170,12 +170,12 @@ The Markdown widget uses **markdown** syntax.
The Markdown renders in the preview pane.
+
[role="screenshot"]
image::images/tutorial-visualize-md-2.png[]
image::images/tutorial-visualize-md-2.png[Image showing example markdown editing field]

. Click *Save*, then enter `Markdown Example` in the *Title* field.

[role="screenshot"]
image::images/tutorial-dashboard.png[]
image::images/tutorial-dashboard.png[Final visualization with bar chart, pie chart, map, and markdown text field]

[float]
=== Next steps
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/visualizations/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface VisToExpressionAstParams {
abortSignal?: AbortSignal;
}

export type VisToExpressionAst = (
vis: Vis,
export type VisToExpressionAst<TVisParams = VisParams> = (
vis: Vis<TVisParams>,
params: VisToExpressionAstParams
) => ExpressionAstExpression;
16 changes: 9 additions & 7 deletions src/plugins/visualizations/public/vis_types/base_vis_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import _ from 'lodash';
import { VisToExpressionAst, VisualizationControllerConstructor } from '../types';
import { VisParams, VisToExpressionAst, VisualizationControllerConstructor } from '../types';
import { TriggerContextMapping } from '../../../ui_actions/public';
import { Adapters } from '../../../inspector/public';

Expand All @@ -43,8 +43,8 @@ interface CommonBaseVisTypeOptions {
inspectorAdapters?: Adapters | (() => Adapters);
}

interface ExpressionBaseVisTypeOptions extends CommonBaseVisTypeOptions {
toExpressionAst: VisToExpressionAst;
interface ExpressionBaseVisTypeOptions<TVisParams> extends CommonBaseVisTypeOptions {
toExpressionAst: VisToExpressionAst<TVisParams>;
visualization?: undefined;
}

Expand All @@ -53,9 +53,11 @@ interface VisualizationBaseVisTypeOptions extends CommonBaseVisTypeOptions {
visualization: VisualizationControllerConstructor | undefined;
}

export type BaseVisTypeOptions = ExpressionBaseVisTypeOptions | VisualizationBaseVisTypeOptions;
export type BaseVisTypeOptions<TVisParams = VisParams> =
| ExpressionBaseVisTypeOptions<TVisParams>
| VisualizationBaseVisTypeOptions;

export class BaseVisType {
export class BaseVisType<TVisParams = VisParams> {
name: string;
title: string;
description: string;
Expand All @@ -77,9 +79,9 @@ export class BaseVisType {
setup?: unknown;
useCustomNoDataScreen: boolean;
inspectorAdapters?: Adapters | (() => Adapters);
toExpressionAst?: VisToExpressionAst;
toExpressionAst?: VisToExpressionAst<TVisParams>;

constructor(opts: BaseVisTypeOptions) {
constructor(opts: BaseVisTypeOptions<TVisParams>) {
if (!opts.icon && !opts.image) {
throw new Error('vis_type must define its icon or image');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class TypesService {
* registers a visualization type
* @param config - visualization type definition
*/
createBaseVisualization: (config: BaseVisTypeOptions): void => {
createBaseVisualization: <TVisParams>(config: BaseVisTypeOptions<TVisParams>): void => {
const vis = new BaseVisType(config);
registerVisualization(() => vis);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ export default function ({ getPageObjects, getService }) {
operation: 'date_histogram',
field: '@timestamp',
});
await PageObjects.lens.closeDimensionEditor();

await PageObjects.lens.configureDimension({
dimension: 'lnsXY_yDimensionPanel > lns-empty-dimension',
operation: 'avg',
field: 'bytes',
});
await PageObjects.lens.closeDimensionEditor();

await PageObjects.lens.configureDimension({
dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension',
operation: 'terms',
field: 'ip',
});
await PageObjects.lens.closeDimensionEditor();
await PageObjects.lens.save(title, saveAsNew, redirectToOrigin);
}

Expand Down
Loading

0 comments on commit 3b0e58e

Please sign in to comment.