-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:elastic/kibana into data-cleanup/…
…filter-messages
- Loading branch information
Showing
55 changed files
with
2,032 additions
and
920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export const UI_SETTINGS = { | ||
LEGACY_CHARTS_LIBRARY: 'timelion:legacyChartsLibrary', | ||
ES_TIMEFIELD: 'timelion:es.timefield', | ||
DEFAULT_INDEX: 'timelion:es.default_index', | ||
TARGET_BUCKETS: 'timelion:target_buckets', | ||
MAX_BUCKETS: 'timelion:max_buckets', | ||
MIN_INTERVAL: 'timelion:min_interval', | ||
GRAPHITE_URL: 'timelion:graphite.url', | ||
QUANDL_KEY: 'timelion:quandl.key', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
export interface VisSeries { | ||
yaxis?: number; | ||
label: string; | ||
lines?: { | ||
show?: boolean; | ||
lineWidth?: number; | ||
fill?: number; | ||
steps?: number; | ||
}; | ||
points?: { | ||
show?: boolean; | ||
symbol?: 'cross' | 'x' | 'circle' | 'square' | 'diamond' | 'plus' | 'triangle'; | ||
fillColor?: string; | ||
fill?: number; | ||
radius?: number; | ||
lineWidth?: number; | ||
}; | ||
bars: { | ||
lineWidth?: number; | ||
fill?: number; | ||
}; | ||
color?: string; | ||
data: Array<Array<number | null>>; | ||
stack: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/plugins/vis_type_timelion/public/components/series/area.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { AreaSeries, ScaleType, CurveType, AreaSeriesStyle, PointShape } from '@elastic/charts'; | ||
import type { VisSeries } from '../../../common/vis_data'; | ||
|
||
interface AreaSeriesComponentProps { | ||
index: number; | ||
visData: VisSeries; | ||
groupId: string; | ||
} | ||
|
||
const isShowLines = (lines: VisSeries['lines'], points: VisSeries['points']) => | ||
lines?.show ? true : points?.show ? false : true; | ||
|
||
const getAreaSeriesStyle = ({ color, lines, points }: AreaSeriesComponentProps['visData']) => | ||
({ | ||
line: { | ||
opacity: isShowLines(lines, points) ? 1 : 0, | ||
stroke: color, | ||
strokeWidth: lines?.lineWidth !== undefined ? Number(lines.lineWidth) : 3, | ||
visible: isShowLines(lines, points), | ||
}, | ||
area: { | ||
fill: color, | ||
opacity: lines?.fill ?? 0, | ||
visible: lines?.show ?? points?.show ?? true, | ||
}, | ||
point: { | ||
fill: points?.fillColor ?? color, | ||
opacity: points?.lineWidth !== undefined ? (points.fill || 1) * 10 : 10, | ||
radius: points?.radius ?? 3, | ||
stroke: color, | ||
strokeWidth: points?.lineWidth ?? 2, | ||
visible: points?.show ?? false, | ||
shape: points?.symbol === 'cross' ? PointShape.X : points?.symbol, | ||
}, | ||
curve: lines?.steps ? CurveType.CURVE_STEP : CurveType.LINEAR, | ||
} as AreaSeriesStyle); | ||
|
||
export const AreaSeriesComponent = ({ index, groupId, visData }: AreaSeriesComponentProps) => ( | ||
<AreaSeries | ||
id={index + visData.label} | ||
groupId={groupId} | ||
name={visData.label} | ||
xScaleType={ScaleType.Time} | ||
yScaleType={ScaleType.Linear} | ||
xAccessor={0} | ||
yAccessors={[1]} | ||
data={visData.data} | ||
sortIndex={index} | ||
color={visData.color} | ||
stackAccessors={visData.stack ? [0] : undefined} | ||
areaSeriesStyle={getAreaSeriesStyle(visData)} | ||
/> | ||
); |
Oops, something went wrong.