Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Progress Elements #23176

Merged
merged 10 commits into from
Sep 28, 2018
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const horizontalProgressBar = () => ({
name: 'horizontalProgressBar',
displayName: 'Horizontal Progress Bar',
help: 'Displays progress as a portion of a horizontal bar',
width: 400,
height: 30,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="horizontalBar" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const horizontalProgressPill = () => ({
name: 'horizontalProgressPill',
displayName: 'Horizontal Progress Pill',
help: 'Displays progress as a portion of a horizontal pill',
width: 400,
height: 30,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="horizontalPill" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
14 changes: 14 additions & 0 deletions x-pack/plugins/canvas/canvas_plugin_src/elements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,25 @@ import { donut } from './donut';
import { dropdownFilter } from './dropdown_filter';
import { image } from './image';
import { horizontalBarChart } from './horiz_bar_chart';
import { horizontalProgressBar } from './horizontal_progress_bar';
import { horizontalProgressPill } from './horizontal_progress_pill';
import { lineChart } from './line_chart';
import { markdown } from './markdown';
import { metric } from './metric';
import { pie } from './pie';
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 { shape } from './shape';
import { table } from './table';
import { tiltedPie } from './tilted_pie';
import { timeFilter } from './time_filter';
import { verticalBarChart } from './vert_bar_chart';
import { verticalProgressBar } from './vertical_progress_bar';
import { verticalProgressPill } from './vertical_progress_pill';

export const elementSpecs = [
areaChart,
Expand All @@ -32,16 +39,23 @@ export const elementSpecs = [
dropdownFilter,
image,
horizontalBarChart,
horizontalProgressBar,
horizontalProgressPill,
lineChart,
markdown,
metric,
pie,
plot,
progressGauge,
progressSemicircle,
progressWheel,
repeatImage,
revealImage,
shape,
table,
tiltedPie,
timeFilter,
verticalBarChart,
verticalProgressBar,
verticalProgressPill,
];
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const progressGauge = () => ({
name: 'progressGauge',
displayName: 'Progress Gauge',
help: 'Displays progress as a portion of a gauge',
width: 200,
height: 200,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="gauge" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const progressSemicircle = () => ({
name: 'progressSemicircle',
displayName: 'Progress Semicircle',
help: 'Displays progress as a portion of a semicircle',
width: 200,
height: 100,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="semicircle" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const progressWheel = () => ({
name: 'progressWheel',
displayName: 'Progress Wheel',
help: 'Displays progress as a portion of a wheel',
width: 200,
height: 200,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="wheel" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const revealImage = () => ({
image: header,
expression: `filters
| demodata
| math "sum(min(cost) / max(cost))"
| math "mean(percent_uptime)"
| revealImage origin=bottom image=null
| render`,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const verticalProgressBar = () => ({
name: 'verticalProgressBar',
displayName: 'Vertical Progress Bar',
help: 'Displays progress as a portion of a vertical bar',
width: 80,
height: 400,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="verticalBar" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

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

export const verticalProgressPill = () => ({
name: 'verticalProgressPill',
displayName: 'Vertical Progress Pill',
help: 'Displays progress as a portion of a vertical pill',
width: 80,
height: 400,
image: header,
expression: `filters
| demodata
| math "mean(percent_uptime)"
| progress shape="verticalPill" label={formatnumber 0%} font={font size=24 family="${
openSans.value
}" color="#000000" align=center}
| render`,
});
Loading