Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/ccr
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Dec 20, 2018
2 parents c00b875 + 41bbbe3 commit 388e41d
Show file tree
Hide file tree
Showing 37 changed files with 139 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
* you may not use this file except in compliance with the Elastic License.
*/

export const areaChart = () => {
return {
name: 'areaChart',
displayName: 'Area chart',
help: 'A line chart with a filled body',
image: require('./header.png'),
expression: `filters
import { ElementFactory } from '../types';
import header from './header.png';

export const areaChart: ElementFactory = () => ({
name: 'areaChart',
displayName: 'Area chart',
help: 'A line chart with a filled body',
image: header,
expression: `filters
| demodata
| pointseries x="time" y="mean(price)"
| plot defaultStyle={seriesStyle lines=1 fill=1}
| render`,
};
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const bubbleChart = () => ({
export const bubbleChart: ElementFactory = () => ({
name: 'bubbleChart',
displayName: 'Bubble chart',
help: 'A customizable bubble chart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const debug = () => ({
export const debug: ElementFactory = () => ({
name: 'debug',
displayName: 'Debug',
help: 'Just dumps the configuration of the element',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const donut = () => ({
export const donut: ElementFactory = () => ({
name: 'donut',
displayName: 'Donut chart',
help: 'A customizable donut chart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const dropdownFilter = () => ({
export const dropdownFilter: ElementFactory = () => ({
name: 'dropdown_filter',
displayName: 'Dropdown filter',
help: 'A dropdown from which you can select values for an "exactly" filter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const horizontalBarChart = () => ({
export const horizontalBarChart: ElementFactory = () => ({
name: 'horizontalBarChart',
displayName: 'Horizontal bar chart',
help: 'A customizable horizontal bar chart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const horizontalProgressBar = () => ({
export const horizontalProgressBar: ElementFactory = () => ({
name: 'horizontalProgressBar',
displayName: 'Horizontal progress bar',
help: 'Displays progress as a portion of a horizontal bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const horizontalProgressPill = () => ({
export const horizontalProgressPill: ElementFactory = () => ({
name: 'horizontalProgressPill',
displayName: 'Horizontal progress pill',
help: 'Displays progress as a portion of a horizontal pill',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const image = () => ({
export const image: ElementFactory = () => ({
name: 'image',
displayName: 'Image',
help: 'A static image',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { bubbleChart } from './bubble_chart';
import { debug } from './debug';
import { donut } from './donut';
import { dropdownFilter } from './dropdown_filter';
import { image } from './image';
import { horizontalBarChart } from './horiz_bar_chart';
import { horizontalBarChart } from './horizontal_bar_chart';
import { horizontalProgressBar } from './horizontal_progress_bar';
import { horizontalProgressPill } from './horizontal_progress_pill';
import { image } from './image';
import { lineChart } from './line_chart';
import { markdown } from './markdown';
import { metric } from './metric';
Expand All @@ -21,8 +21,8 @@ import { plot } from './plot';
import { progressGauge } from './progress_gauge';
import { progressSemicircle } from './progress_semicircle';
import { progressWheel } from './progress_wheel';
import { repeatImage } from './repeatImage';
import { revealImage } from './revealImage';
import { repeatImage } from './repeat_image';
import { revealImage } from './reveal_image';
import { shape } from './shape';
import { table } from './table';
import { tiltedPie } from './tilted_pie';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const lineChart = () => ({
export const lineChart: ElementFactory = () => ({
name: 'lineChart',
displayName: 'Line chart',
help: 'A customizable line chart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import header from './header.png';

export const markdown = () => ({
import { ElementFactory } from '../types';
export const markdown: ElementFactory = () => ({
name: 'markdown',
displayName: 'Markdown',
help: 'Markup from Markdown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { openSans } from '../../../common/lib/fonts';
import header from './header.png';

export const metric = () => ({
import { ElementFactory } from '../types';
export const metric: ElementFactory = () => ({
name: 'metric',
displayName: 'Metric',
help: 'A number with a label',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import header from './header.png';

export const pie = () => ({
import { ElementFactory } from '../types';
export const pie: ElementFactory = () => ({
name: 'pie',
displayName: 'Pie chart',
width: 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const plot = () => ({
export const plot: ElementFactory = () => ({
name: 'plot',
displayName: 'Coordinate plot',
help: 'Mixed line, bar or dot charts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const progressGauge = () => ({
export const progressGauge: ElementFactory = () => ({
name: 'progressGauge',
displayName: 'Progress gauge',
help: 'Displays progress as a portion of a gauge',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const progressSemicircle = () => ({
export const progressSemicircle: ElementFactory = () => ({
name: 'progressSemicircle',
displayName: 'Progress semicircle',
help: 'Displays progress as a portion of a semicircle',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const progressWheel = () => ({
export const progressWheel: ElementFactory = () => ({
name: 'progressWheel',
displayName: 'Progress wheel',
help: 'Displays progress as a portion of a wheel',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const repeatImage = () => ({
export const repeatImage: ElementFactory = () => ({
name: 'repeatImage',
displayName: 'Image repeat',
help: 'Repeats an image N times',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const revealImage = () => ({
export const revealImage: ElementFactory = () => ({
name: 'revealImage',
displayName: 'Image reveal',
help: 'Reveals a percentage of an image',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const shape = () => ({
export const shape: ElementFactory = () => ({
name: 'shape',
displayName: 'Shape',
help: 'A customizable shape',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const table = () => ({
export const table: ElementFactory = () => ({
name: 'table',
displayName: 'Data table',
help: 'A scrollable grid for displaying data in a tabular format',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const tiltedPie = () => ({
export const tiltedPie: ElementFactory = () => ({
name: 'tiltedPie',
displayName: 'Tilted pie chart',
width: 500,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const timeFilter = () => ({
export const timeFilter: ElementFactory = () => ({
name: 'time_filter',
displayName: 'Time filter',
help: 'Set a time window',
Expand Down
18 changes: 18 additions & 0 deletions x-pack/plugins/canvas/canvas_plugin_src/elements/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export interface ElementSpec {
name: string;
image: string;
expression: string;
displayName?: string;
help?: string;
filter?: string;
width?: number;
height?: number;
}

export type ElementFactory = () => ElementSpec;
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ElementFactory } from '../types';
import header from './header.png';

export const verticalBarChart = () => ({
export const verticalBarChart: ElementFactory = () => ({
name: 'verticalBarChart',
displayName: 'Vertical bar chart',
help: 'A customizable vertical bar chart',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const verticalProgressBar = () => ({
export const verticalProgressBar: ElementFactory = () => ({
name: 'verticalProgressBar',
displayName: 'Vertical progress bar',
help: 'Displays progress as a portion of a vertical bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import { openSans } from '../../../common/lib/fonts';
import { ElementFactory } from '../types';
import header from './header.png';

export const verticalProgressPill = () => ({
export const verticalProgressPill: ElementFactory = () => ({
name: 'verticalProgressPill',
displayName: 'Vertical progress pill',
help: 'Displays progress as a portion of a vertical pill',
Expand Down
File renamed without changes.
29 changes: 0 additions & 29 deletions x-pack/plugins/canvas/public/lib/element.js

This file was deleted.

Loading

0 comments on commit 388e41d

Please sign in to comment.