Skip to content

Commit

Permalink
update elastic-charts to 38.0.1 (#115623)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme authored Oct 21, 2021
1 parent da034a0 commit ada2593
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export function DiscoverHistogram({
tooltip={tooltipProps}
theme={chartTheme}
baseTheme={chartBaseTheme}
allowBrushingLastHistogramBucket={true}
allowBrushingLastHistogramBin={true}
/>
<Axis
id="discover-histogram-left-axis"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const TimeSeries = ({
debugState={window._echDebugStateFlag ?? false}
showLegend={legend}
showLegendExtra={true}
allowBrushingLastHistogramBucket={true}
allowBrushingLastHistogramBin={true}
legendPosition={legendPosition}
onBrushEnd={onBrushEndListener}
onElementClick={(args) => handleElementClick(args)}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_types/xy/public/components/xy_settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const XYSettings: FC<XYSettingsProps> = ({
baseTheme={baseTheme}
showLegend={showLegend}
legendPosition={legendPosition}
allowBrushingLastHistogramBucket={isTimeChart}
allowBrushingLastHistogramBin={isTimeChart}
roundHistogramBrushValues={enableHistogramMode && !isTimeChart}
legendColorPicker={legendColorPicker}
onElementClick={onElementClick}
Expand Down
9 changes: 4 additions & 5 deletions test/functional/apps/visualize/_area_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
17 changes: 8 additions & 9 deletions test/functional/apps/visualize/_point_series_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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' });
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 @@ -1169,7 +1169,7 @@ describe('xy_expression', () => {
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(
Expand All @@ -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', () => {
Expand Down Expand Up @@ -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(
Expand All @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/public/xy_visualization/expression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ada2593

Please sign in to comment.