From ada2593c0975f1f293d6a6977da05238c07fe4f6 Mon Sep 17 00:00:00 2001 From: Nick Partridge Date: Thu, 21 Oct 2021 08:25:18 -0500 Subject: [PATCH] update elastic-charts to 38.0.1 (#115623) --- package.json | 2 +- .../apps/main/components/chart/histogram.tsx | 2 +- .../visualizations/views/timeseries/index.js | 2 +- .../xy/public/components/xy_settings.tsx | 2 +- test/functional/apps/visualize/_area_chart.ts | 9 ++++----- .../apps/visualize/_point_series_options.ts | 17 ++++++++--------- .../__snapshots__/expression.test.tsx.snap | 14 +++++++------- .../public/xy_visualization/expression.test.tsx | 8 ++++---- .../lens/public/xy_visualization/expression.tsx | 2 +- yarn.lock | 8 ++++---- 10 files changed, 32 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 1e72af27e4de9..3df7b65315a85 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@elastic/apm-generator": "link:bazel-bin/packages/elastic-apm-generator", "@elastic/apm-rum": "^5.9.1", "@elastic/apm-rum-react": "^1.3.1", - "@elastic/charts": "37.0.0", + "@elastic/charts": "38.0.1", "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.21", "@elastic/ems-client": "7.16.0", diff --git a/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx index 350c46591c8b4..a04374e1500b4 100644 --- a/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx @@ -190,7 +190,7 @@ export function DiscoverHistogram({ tooltip={tooltipProps} theme={chartTheme} baseTheme={chartBaseTheme} - allowBrushingLastHistogramBucket={true} + allowBrushingLastHistogramBin={true} /> handleElementClick(args)} diff --git a/src/plugins/vis_types/xy/public/components/xy_settings.tsx b/src/plugins/vis_types/xy/public/components/xy_settings.tsx index 74aff7535c2d8..304b0756c30b6 100644 --- a/src/plugins/vis_types/xy/public/components/xy_settings.tsx +++ b/src/plugins/vis_types/xy/public/components/xy_settings.tsx @@ -165,7 +165,7 @@ export const XYSettings: FC = ({ baseTheme={baseTheme} showLegend={showLegend} legendPosition={legendPosition} - allowBrushingLastHistogramBucket={isTimeChart} + allowBrushingLastHistogramBin={isTimeChart} roundHistogramBrushValues={enableHistogramMode && !isTimeChart} legendColorPicker={legendColorPicker} onElementClick={onElementClick} diff --git a/test/functional/apps/visualize/_area_chart.ts b/test/functional/apps/visualize/_area_chart.ts index 2a5be39403002..76bb1d2f58d05 100644 --- a/test/functional/apps/visualize/_area_chart.ts +++ b/test/functional/apps/visualize/_area_chart.ts @@ -95,11 +95,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show correct chart', async function () { const xAxisLabels = [ - '2015-09-19 12:00', - '2015-09-20 12:00', - '2015-09-21 12:00', - '2015-09-22 12:00', - '2015-09-23 12:00', + '2015-09-20 00:00', + '2015-09-21 00:00', + '2015-09-22 00:00', + '2015-09-23 00:00', ]; const yAxisLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; const expectedAreaChartData = [ diff --git a/test/functional/apps/visualize/_point_series_options.ts b/test/functional/apps/visualize/_point_series_options.ts index dbe26ba099590..a2d2831c87933 100644 --- a/test/functional/apps/visualize/_point_series_options.ts +++ b/test/functional/apps/visualize/_point_series_options.ts @@ -230,10 +230,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('timezones', async function () { it('should show round labels in default timezone', async function () { const expectedLabels = [ - '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-21 00:00', + '2015-09-22 00:00', + '2015-09-23 00:00', ]; await initChart(); const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); @@ -242,11 +242,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show round labels in different timezone', async function () { const expectedLabels = [ - '2015-09-19 12:00', - '2015-09-20 12:00', - '2015-09-21 12:00', - '2015-09-22 12:00', - '2015-09-23 12:00', + '2015-09-20 00:00', + '2015-09-21 00:00', + '2015-09-22 00:00', + '2015-09-23 00:00', ]; await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'America/Phoenix' }); diff --git a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap index 0fad522624975..b058c42d8b4d1 100644 --- a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap +++ b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap @@ -5,7 +5,7 @@ exports[`xy_expression XYChart component it renders area 1`] = ` renderer="canvas" > { expect(wrapper.find(Settings).first().prop('onBrushEnd')).toBeUndefined(); }); - test('allowBrushingLastHistogramBucket is true for date histogram data', () => { + test('allowBrushingLastHistogramBin is true for date histogram data', () => { const { args } = sampleArgs(); const wrapper = mountWithIntl( @@ -1182,7 +1182,7 @@ describe('xy_expression', () => { }} /> ); - expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBucket')).toEqual(true); + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(true); }); test('onElementClick returns correct context data', () => { @@ -1445,7 +1445,7 @@ describe('xy_expression', () => { }); }); - test('allowBrushingLastHistogramBucket should be fakse for ordinal data', () => { + test('allowBrushingLastHistogramBin should be fakse for ordinal data', () => { const { args, data } = sampleArgs(); const wrapper = mountWithIntl( @@ -1472,7 +1472,7 @@ describe('xy_expression', () => { /> ); - expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBucket')).toEqual(false); + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(false); }); test('onElementClick is not triggering event on non-interactive mode', () => { diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.tsx index 36f1b92b8a1f4..915ea9d6cda94 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/expression.tsx @@ -594,7 +594,7 @@ export function XYChart({ boundary: document.getElementById('app-fixed-viewport') ?? undefined, headerFormatter: (d) => safeXAccessorLabelRenderer(d.value), }} - allowBrushingLastHistogramBucket={Boolean(isTimeViz)} + allowBrushingLastHistogramBin={Boolean(isTimeViz)} rotation={shouldRotate ? 90 : 0} xDomain={xDomain} onBrushEnd={interactive ? (brushHandler as BrushEndListener) : undefined} diff --git a/yarn.lock b/yarn.lock index aa4361ef482d5..86c4c9801f56e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2337,10 +2337,10 @@ dependencies: object-hash "^1.3.0" -"@elastic/charts@37.0.0": - version "37.0.0" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-37.0.0.tgz#a94526461c404b449953cca4fe34f8bf3620413e" - integrity sha512-Pfm58/voERWVPJlxy13DphwgRoBGYhnSyz65kdsPg6lYGxN5ngWvuTuJ3477fyApYV01Pz4Ckt9yj1BSQue80Q== +"@elastic/charts@38.0.1": + version "38.0.1" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-38.0.1.tgz#9c1db7e0f1de869e0b2b505e192bbb9d62d60dc8" + integrity sha512-i9mIA3Ji9jSjuFDtuh9gV1xpCl3sbBEDgJiOgLVt04pr/qZH2W+tr3AV5yHvjsR7Te0Pmh/Cm5wLBvFKaI1nIA== dependencies: "@popperjs/core" "^2.4.0" chroma-js "^2.1.0"