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

Update dependency @elastic/charts to v24.5.1 #89822

Merged
merged 15 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
"@cypress/webpack-preprocessor": "^5.5.0",
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "24.4.0",
"@elastic/charts": "24.5.1",
"@elastic/eslint-config-kibana": "link:packages/elastic-eslint-config-kibana",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_xy/public/config/get_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { ScaleContinuousType } from '@elastic/charts/dist/scales';
import { ScaleContinuousType } from '@elastic/charts';

import { Datatable } from '../../../expressions/public';
import { BUCKET_TYPES } from '../../../data/public';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_xy/public/utils/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getXDomain = (params: Aspect['params']): DomainRange => {
const minInterval = (params as DateHistogramParams | HistogramParams)?.interval ?? undefined;

if ((params as DateHistogramParams).date) {
const bounds = getTimefilter().getBounds();
const bounds = getTimefilter().getActiveBounds();

if (bounds) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_xy/public/utils/render_all_series.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
SeriesName,
Accessor,
AccessorFn,
ColorVariant,
} from '@elastic/charts';
import { ColorVariant } from '@elastic/charts/dist/utils/commons';

import { DatatableRow } from '../../../expressions/public';

Expand Down
9 changes: 8 additions & 1 deletion test/functional/apps/visualize/_area_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should show correct chart', async function () {
const xAxisLabels = await PageObjects.visChart.getExpectedValue(
['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00', '2015-09-23 00:00'],
['2015-09-19 12:00', '2015-09-20 12:00', '2015-09-21 12:00', '2015-09-22 12:00']
[
'2015-09-20 00:00',
'2015-09-20 12:00',
'2015-09-21 00:00',
'2015-09-21 12:00',
'2015-09-22 00:00',
'2015-09-22 12:00',
]
);
const yAxisLabels = await PageObjects.visChart.getExpectedValue(
['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'],
Expand Down
20 changes: 8 additions & 12 deletions test/functional/apps/visualize/_point_series_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.toggleGridCategoryLines();
await PageObjects.visEditor.clickGo();
const gridLines = await PageObjects.visChart.getGridLines();
const expectedCount = await PageObjects.visChart.getExpectedValue(9, 5);
expect(gridLines.length).to.be(expectedCount);
// FLAKY relaxing as depends on chart size/browser size and produce differences between local and CI
// The objective here is to check whenever the grid lines are rendered, not the exact quantity
expect(gridLines.length).to.be.greaterThan(0);
gridLines.forEach((gridLine) => {
expect(gridLine.y).to.be(0);
});
Expand All @@ -181,8 +182,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.toggleGridCategoryLines();
await PageObjects.visEditor.clickGo();
const gridLines = await PageObjects.visChart.getGridLines();
const expectedCount = await PageObjects.visChart.getExpectedValue(9, 8);
expect(gridLines.length).to.be(expectedCount);
// FLAKY relaxing as depends on chart size/browser size and produce differences between local and CI
// The objective here is to check whenever the grid lines are rendered, not the exact quantity
expect(gridLines.length).to.be.greaterThan(0);
gridLines.forEach((gridLine) => {
expect(gridLine.x).to.be(0);
});
Expand Down Expand Up @@ -267,7 +269,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should show round labels in default timezone', async function () {
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00'],
['2015-09-19 12:00', '2015-09-20 12:00', '2015-09-21 12:00', '2015-09-22 12:00']
['2015-09-20 00:00', '2015-09-20 18:00', '2015-09-21 12:00', '2015-09-22 06:00']
);
await initChart();
const labels = await PageObjects.visChart.getXAxisLabels();
Expand All @@ -277,13 +279,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should show round labels in different timezone', async function () {
const expectedLabels = await PageObjects.visChart.getExpectedValue(
['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00'],
[
'2015-09-19 12:00',
'2015-09-20 06:00',
'2015-09-21 00:00',
'2015-09-21 18:00',
'2015-09-22 12:00',
]
['2015-09-19 18:00', '2015-09-20 12:00', '2015-09-21 06:00', '2015-09-22 00:00']
);

await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'America/Phoenix' });
Expand Down
68 changes: 48 additions & 20 deletions test/functional/apps/visualize/_vertical_bar_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
await PageObjects.visEditor.clickGo();

const expectedEntries = ['200', '404', '503'];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
['200', '404', '503'],
['503', '404', '200'] // sorting aligned with rendered geometries
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand All @@ -451,7 +454,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.selectCustomSortMetric(3, 'Min', 'bytes');
await PageObjects.visEditor.clickGo();

const expectedEntries = ['404', '200', '503'];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
['404', '200', '503'],
['503', '200', '404'] // sorting aligned with rendered geometries
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand Down Expand Up @@ -484,23 +490,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
await PageObjects.visEditor.clickGo();

const expectedEntries = [
'200 - win 8',
'200 - win xp',
'200 - ios',
'200 - osx',
'200 - win 7',
'404 - ios',
'503 - ios',
'503 - osx',
'503 - win 7',
'503 - win 8',
'503 - win xp',
'404 - osx',
'404 - win 7',
'404 - win 8',
'404 - win xp',
];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
[
'200 - win 8',
'200 - win xp',
'200 - ios',
'200 - osx',
'200 - win 7',
'404 - ios',
'503 - ios',
'503 - osx',
'503 - win 7',
'503 - win 8',
'503 - win xp',
'404 - osx',
'404 - win 7',
'404 - win 8',
'404 - win xp',
],
[
'404 - win xp',
'404 - win 8',
'404 - win 7',
'404 - osx',
'503 - win xp',
'503 - win 8',
'503 - win 7',
'503 - osx',
'503 - ios',
'404 - ios',
'200 - win 7',
'200 - osx',
'200 - ios',
'200 - win xp',
'200 - win 8',
]
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand All @@ -511,7 +536,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.toggleDisabledAgg(3);
await PageObjects.visEditor.clickGo();

const expectedEntries = ['win 8', 'win xp', 'ios', 'osx', 'win 7'];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
['win 8', 'win xp', 'ios', 'osx', 'win 7'],
['win 7', 'osx', 'ios', 'win xp', 'win 8']
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand Down
64 changes: 45 additions & 19 deletions test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();

const expectedEntries = ['200', '404', '503'];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
['200', '404', '503'],
['503', '404', '200'] // sorting aligned with rendered geometries
);

const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand All @@ -239,23 +243,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();

const expectedEntries = [
'200 - win 8',
'200 - win xp',
'200 - ios',
'200 - osx',
'200 - win 7',
'404 - ios',
'503 - ios',
'503 - osx',
'503 - win 7',
'503 - win 8',
'503 - win xp',
'404 - osx',
'404 - win 7',
'404 - win 8',
'404 - win xp',
];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
[
'200 - win 8',
'200 - win xp',
'200 - ios',
'200 - osx',
'200 - win 7',
'404 - ios',
'503 - ios',
'503 - osx',
'503 - win 7',
'503 - win 8',
'503 - win xp',
'404 - osx',
'404 - win 7',
'404 - win 8',
'404 - win xp',
],
[
'404 - win xp',
'404 - win 8',
'404 - win 7',
'404 - osx',
'503 - win xp',
'503 - win 8',
'503 - win 7',
'503 - osx',
'503 - ios',
'404 - ios',
'200 - win 7',
'200 - osx',
'200 - ios',
'200 - win xp',
'200 - win 8',
]
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand All @@ -265,7 +288,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickGo();
await PageObjects.header.waitUntilLoadingHasFinished();

const expectedEntries = ['win 8', 'win xp', 'ios', 'osx', 'win 7'];
const expectedEntries = await PageObjects.visChart.getExpectedValue(
['win 8', 'win xp', 'ios', 'osx', 'win 7'],
['win 7', 'osx', 'ios', 'win xp', 'win 8']
);
const legendEntries = await PageObjects.visChart.getLegendEntries();
expect(legendEntries).to.eql(expectedEntries);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import {
DARK_THEME,
LIGHT_THEME,
Fit,
Position,
} from '@elastic/charts';
import {
EUI_CHARTS_THEME_DARK,
EUI_CHARTS_THEME_LIGHT,
} from '@elastic/eui/dist/eui_charts_theme';
import { Position } from '@elastic/charts/dist/utils/commons';
import styled from 'styled-components';
import { PercentileAnnotations } from '../PageLoadDistribution/PercentileAnnotations';
import { I18LABELS } from '../translations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
SeriesNameFn,
Settings,
timeFormatter,
Position,
} from '@elastic/charts';
import { Position } from '@elastic/charts/dist/utils/commons';
import {
EUI_CHARTS_THEME_DARK,
EUI_CHARTS_THEME_LIGHT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
*/

import React from 'react';
import { Partition, SeriesIdentifier, Settings } from '@elastic/charts';
import {
Partition,
SeriesIdentifier,
Settings,
NodeColorAccessor,
ShapeTreeNode,
} from '@elastic/charts/dist/chart_types/partition_chart/layout/types/viewmodel_types';
import { HierarchyOfArrays } from '@elastic/charts/dist/chart_types/partition_chart/layout/utils/group_by_rollup';
HierarchyOfArrays,
} from '@elastic/charts';
import { shallow } from 'enzyme';
import { LensMultiTable } from '../types';
import { PieComponent } from './render_function';
Expand Down Expand Up @@ -214,7 +216,10 @@ describe('PieVisualization component', () => {
const defaultArgs = getDefaultArgs();
const component = shallow(<PieComponent args={{ ...args }} {...defaultArgs} />);
component.find(Settings).first().prop('onElementClick')!([
[[{ groupByRollup: 6, value: 6 }], {} as SeriesIdentifier],
[
[{ groupByRollup: 6, value: 6, depth: 1, path: [], sortIndex: 1 }],
{} as SeriesIdentifier,
],
]);

expect(defaultArgs.onClickValue.mock.calls[0][0]).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ describe('render helpers', () => {
{ a: 'Foo', b: 6 },
],
};
expect(getFilterContext([{ groupByRollup: 'Test', value: 100 }], ['a'], table)).toEqual({
expect(
getFilterContext(
[{ groupByRollup: 'Test', value: 100, depth: 1, path: [], sortIndex: 1 }],
['a'],
table
)
).toEqual({
data: [
{
row: 1,
Expand All @@ -90,7 +96,13 @@ describe('render helpers', () => {
{ a: 'Foo', b: 'Three', c: 6 },
],
};
expect(getFilterContext([{ groupByRollup: 'Test', value: 100 }], ['a', 'b'], table)).toEqual({
expect(
getFilterContext(
[{ groupByRollup: 'Test', value: 100, depth: 1, path: [], sortIndex: 1 }],
['a', 'b'],
table
)
).toEqual({
data: [
{
row: 1,
Expand Down Expand Up @@ -119,8 +131,8 @@ describe('render helpers', () => {
expect(
getFilterContext(
[
{ groupByRollup: 'Test', value: 100 },
{ groupByRollup: 'Two', value: 5 },
{ groupByRollup: 'Test', value: 100, depth: 1, path: [], sortIndex: 1 },
{ groupByRollup: 'Two', value: 5, depth: 1, path: [], sortIndex: 1 },
],
['a', 'b'],
table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import {
ElementClickListener,
TooltipValue,
HeatmapSpec,
TooltipSettings,
HeatmapBrushEvent,
} from '@elastic/charts';
import moment from 'moment';
import { HeatmapBrushEvent } from '@elastic/charts/dist/chart_types/heatmap/layout/types/config_types';

import { i18n } from '@kbn/i18n';
import { TooltipSettings } from '@elastic/charts/dist/specs/settings';
import { SwimLanePagination } from './swimlane_pagination';
import { AppStateSelectedCells, OverallSwimlaneData, ViewBySwimLaneData } from './explorer_utils';
import { ANOMALY_THRESHOLD, SEVERITY_COLORS } from '../../../common';
Expand Down
Loading