Skip to content

Commit

Permalink
build: update @elastic/charts to v18.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Mar 18, 2020
1 parent 2d44870 commit 6f542f3
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 65 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@babel/core": "^7.5.5",
"@babel/register": "^7.7.0",
"@elastic/apm-rum": "^4.6.0",
"@elastic/charts": "^17.1.1",
"@elastic/charts": "^18.1.0",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "7.7.0",
"@elastic/eui": "20.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"kbn:watch": "node scripts/build --watch"
},
"devDependencies": {
"@elastic/charts": "^17.1.1",
"@elastic/charts": "^18.1.0",
"abortcontroller-polyfill": "^1.4.0",
"@elastic/eui": "20.0.2",
"@kbn/babel-preset": "1.0.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ export function AreaSeriesDecorator({
}) {
const id = seriesId;
const groupId = seriesGroupId;
const customSeriesColors = [color];
const areaSeriesStyle = getAreaStyles({ points, lines, color });

const seriesSettings = {
id,
name,
groupId,
data,
customSeriesColors,
color,
hideInLegend,
xAccessor: X_ACCESSOR_INDEX,
yAccessors: Y_ACCESSOR_INDEXES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ export function BarSeriesDecorator({
}) {
const id = seriesId;
const groupId = seriesGroupId;
const customSeriesColors = [color];
const barSeriesStyle = getBarStyles(bars, color);

const seriesSettings = {
id,
name,
groupId,
data,
customSeriesColors,
color,
hideInLegend,
xAccessor: X_ACCESSOR_INDEX,
yAccessors: Y_ACCESSOR_INDEXES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const TimeSeries = ({
<Chart ref={chartRef} renderer="canvas" className={classes}>
<Settings
showLegend={legend}
showLegendExtra={true}
legendPosition={legendPosition}
onBrushEnd={onBrush}
animateData={false}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Axis } from '@elastic/charts';
import { AreaSeries, BarSeries, Position, LineSeries, Settings, ScaleType } from '@elastic/charts';
import {
AreaSeries,
Axis,
BarSeries,
Position,
LineSeries,
Settings,
ScaleType,
} from '@elastic/charts';
import { xyChart, XYChart } from './xy_expression';
import { LensMultiTable } from '../types';
import React from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function XYChart({ data, args, formatFactory, timeZone, chartTheme }: XYC
<Settings
showLegend={legend.isVisible ? chartHasMoreThanOneSeries : legend.isVisible}
legendPosition={legend.position}
showLegendDisplayValue={false}
showLegendExtra={false}
theme={chartTheme}
rotation={shouldRotate ? 90 : 0}
xDomain={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const AreaChartBaseComponent = ({
xAccessor="x"
yAccessors={['y']}
areaSeriesStyle={getSeriesLineStyle()}
customSeriesColors={series.color ? [series.color] : undefined}
color={series.color ? series.color : undefined}
/>
) : null;
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const BarChartBaseComponent = ({
splitSeriesAccessors={['g']}
data={series.value!}
stackAccessors={get('configs.series.stackAccessors', chartConfigs)}
customSeriesColors={series.color ? [series.color] : undefined}
color={series.color ? series.color : undefined}
/>
) : null;
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface ChartData {

export interface ChartSeriesConfigs {
customHeight?: number;
customSeriesColors?: string[];
color?: string[];
series?: {
xScaleType?: ScaleType | undefined;
yScaleType?: ScaleType | undefined;
Expand Down Expand Up @@ -110,7 +110,7 @@ export const chartDefaultSettings = {
rendering: chartDefaultRendering,
animatedData: false,
showLegend: false,
showLegendDisplayValue: false,
showLegendExtra: false,
debug: false,
legendPosition: Position.Bottom,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { BarChart } from '../charts/barchart';
import { HeaderSection } from '../header_section';
import { MatrixLoader } from './matrix_loader';
import { Panel } from '../panel';
import { getBarchartConfigs, getCustomChartData } from '../../components/matrix_histogram/utils';
import { getBarchartConfigs, getCustomChartData } from './utils';
import { useQuery } from '../../containers/matrix_histogram';
import {
MatrixHistogramProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export interface BarchartConfigs {
legendPosition: Position;
onBrushEnd: UpdateDateRange;
showLegend: boolean;
showLegendExtra: boolean;
theme: {
scales: {
barsPadding: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const getBarchartConfigs = ({
legendPosition: legendPosition ?? Position.Right,
onBrushEnd,
showLegend: showLegend ?? true,
showLegendExtra: true,
theme: {
scales: {
barsPadding: 0.08,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import {
Axis,
Chart,
getAxisId,
getSpecId,
HistogramBarSeries,
Position,
Settings,
Expand Down Expand Up @@ -46,9 +44,9 @@ export const SignalsHistogram = React.memo<HistogramSignalsProps>(
const theme = useTheme();

const chartSize: ChartSizeArray = useMemo(() => ['100%', chartHeight], [chartHeight]);
const xAxisId = useMemo(() => getAxisId('signalsHistogramAxisX'), []);
const yAxisId = useMemo(() => getAxisId('signalsHistogramAxisY'), []);
const id = useMemo(() => getSpecId('signalsHistogram'), []);
const xAxisId = 'signalsHistogramAxisX';
const yAxisId = 'signalsHistogramAxisY';
const id = 'signalsHistogram';
const yAccessors = useMemo(() => ['y'], []);
const splitSeriesAccessors = useMemo(() => ['g'], []);
const tickFormat = useMemo(() => histogramDateTimeFormatter([from, to]), [from, to]);
Expand All @@ -69,6 +67,7 @@ export const SignalsHistogram = React.memo<HistogramSignalsProps>(
legendPosition={legendPosition}
onBrushEnd={updateDateRange}
showLegend
showLegendExtra
theme={theme}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export const DurationChartComponent = ({ locationDurationLines, loading }: Durat
<Chart>
<Settings
xDomain={{ min, max }}
showLegend={true}
showLegend
showLegendExtra
legendPosition={Position.Bottom}
onBrushEnd={onBrushEnd}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const MonitorBarSeries = ({ dangerColor, histogramSeries }: MonitorBarSer
/>
<BarSeries
id={id}
customSeriesColors={[dangerColor]}
color={dangerColor}
data={(histogramSeries || []).map(({ timestamp, down }) => [timestamp, down])}
name={i18n.translate('xpack.uptime.monitorList.downLineSeries.downLabel', {
defaultMessage: 'Down checks',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({
/>

<BarSeries
customSeriesColors={[danger]}
color={danger}
data={histogram.map(({ x, downCount }) => [x, downCount || 0])}
id={downSpecId}
name={i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', {
Expand All @@ -136,7 +136,7 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({
yScaleType="linear"
/>
<BarSeries
customSeriesColors={[gray]}
color={gray}
data={histogram.map(({ x, upCount }) => [x, upCount || 0])}
id={upMonitorsId}
name={upMonitorsId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const MetricsExplorerAreaChart = ({ metric, id, series, type, stack }: Pr
data={series.rows}
stackAccessors={stack ? ['timestamp'] : void 0}
areaSeriesStyle={seriesAreaStyle}
customSeriesColors={[color]}
color={color}
/>
);
};
Expand Down Expand Up @@ -101,7 +101,7 @@ export const MetricsExplorerBarChart = ({ metric, id, series, stack }: Props) =>
data={series.rows}
stackAccessors={stack ? ['timestamp'] : void 0}
barSeriesStyle={seriesBarStyle}
customSeriesColors={[color]}
color={color}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const LogEntryRateBarChart: React.FunctionComponent<{
tooltip={tooltipProps}
theme={isDarkMode ? DARK_THEME : LIGHT_THEME}
showLegend
showLegendExtra
legendPosition="right"
xDomain={{ min: timeRange.startTime, max: timeRange.endTime }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export const ChartSectionVis = ({
tooltip={tooltipProps}
onBrushEnd={handleTimeChange}
theme={getChartTheme(isDarkMode)}
showLegend={true}
showLegend
showLegendExtra
legendPosition="right"
/>
</Chart>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const AreaChart = ({ id, color, series, name, type, stack }: Props) => {
yAccessors={['value']}
data={series.data}
areaSeriesStyle={style}
customSeriesColors={color ? [color] : void 0}
color={color ? color : void 0}
stackAccessors={stack ? ['timestamp'] : void 0}
/>
);
Expand All @@ -80,7 +80,7 @@ export const BarChart = ({ id, color, series, name, type, stack }: Props) => {
yAccessors={['value']}
data={series.data}
barSeriesStyle={style}
customSeriesColors={color ? [color] : void 0}
color={color ? color : void 0}
stackAccessors={stack ? ['timestamp'] : void 0}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const BooleanContent: FC<FieldDataCardProps> = ({ config }) => {
isValueContainedInElement: false,
showValueLabel: true,
}}
customSeriesColors={['rgba(230, 194, 32, 0.5)', 'rgba(224, 187, 20, 0.71)']}
color={['rgba(230, 194, 32, 0.5)', 'rgba(224, 187, 20, 0.71)']}
splitSeriesAccessors={['x']}
stackAccessors={['x']}
xAccessor="x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Line: FC<Props> = ({ chartData }) => {
yScaleToDataExtent={false}
curve={CurveType.CURVE_MONOTONE_X}
lineSeriesStyle={lineSeriesStyle}
customSeriesColors={[LINE_COLOR]}
color={LINE_COLOR}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ModelBounds: FC<Props> = ({ modelData }) => {
yScaleToDataExtent={false}
curve={CurveType.CURVE_MONOTONE_X}
areaSeriesStyle={areaSeriesStyle}
customSeriesColors={[MODEL_COLOR]}
color={MODEL_COLOR}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const Scatter: FC<Props> = ({ chartData }) => {
yScaleToDataExtent={false}
curve={CurveType.CURVE_MONOTONE_X}
lineSeriesStyle={scatterSeriesStyle}
customSeriesColors={[LINE_COLOR]}
color={LINE_COLOR}
/>
);
};
Loading

0 comments on commit 6f542f3

Please sign in to comment.