[discover] use elastic-charts for histogram#36517
[discover] use elastic-charts for histogram#36517emmacunningham wants to merge 5 commits intoelastic:masterfrom
Conversation
💔 Build Failed |
💔 Build Failed |
8523aed to
ef8310b
Compare
💔 Build Failed |
ef8310b to
bd26bcc
Compare
💚 Build Succeeded |
035a696 to
1372ed3
Compare
💔 Build Failed |
1372ed3 to
de8f4a3
Compare
💔 Build Failed |
de8f4a3 to
6fc31ca
Compare
💔 Build Failed |
6fc31ca to
02a85a2
Compare
💚 Build Succeeded |
02a85a2 to
1de8741
Compare
💚 Build Succeeded |
1de8741 to
e6db1d0
Compare
💔 Build Failed |
e6db1d0 to
ea4546f
Compare
💚 Build Succeeded |
ea4546f to
a97a6f3
Compare
💔 Build Failed |
a97a6f3 to
13cf1d5
Compare
💔 Build Failed |
13cf1d5 to
055340f
Compare
💚 Build Succeeded |
💔 Build Failed |
💚 Build Succeeded |
4e3b2a5 to
bd47e6c
Compare
💚 Build Succeeded |
nickofthyme
left a comment
There was a problem hiding this comment.
Tested Locally, LGTM. Just a few comments and questions.
src/legacy/core_plugins/kibana/public/discover/components/histogram/histogram.tsx
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/public/discover/components/histogram/histogram.tsx
Outdated
Show resolved
Hide resolved
src/legacy/core_plugins/kibana/public/discover/components/histogram/histogram.tsx
Outdated
Show resolved
Hide resolved
bd47e6c to
b19e606
Compare
@kertal Ah, good catch! By default, the elastic-charts tooltip type is set to |
💚 Build Succeeded |
💚 Build Succeeded |
@emmacunningham |
There was a problem hiding this comment.
I've done few tests locally and there are some issues that we need to solve before merging:
- the tooltip is not shown on top of the other elements. I think it's a matter of the positioning of the chart container
-
I know we switched to the follow cursor, but reintroduce the problem that we solve with the crosshair: hovering on small elements. On the following gift there is also 2 other issues:
-
Seems that the performance of the mouse over are degraded here in respect of the standard one of the elastic-charts. I can see that the tooltip sometimes lags a bit.
on chart playground

on discover chart

From the performance panel seems that there is some forced reflow style calculation(from 150ms to 300ms) that blocks the rendering

| ]; | ||
| await verifyChartData(expectedBarChartData); | ||
| }); | ||
| // TODO: update this test when elastic-charts can support integration tests |
There was a problem hiding this comment.
Can you create a Kibana meta issue so we can track these skipped tests and we can reenable that later?
src/legacy/core_plugins/kibana/public/discover/components/histogram/directive.js
Show resolved
Hide resolved
| const partialDataText = i18n.translate('kbn.discover.histogram.partialData.bucketTooltipText', { | ||
| defaultMessage: | ||
| 'Part of this bucket may contain partial data. The selected time range does not fully cover it.', | ||
| }); |
There was a problem hiding this comment.
I think you can move out this translation, to avoid having to retranslate the same text every time you show that message
| /** | ||
| * Deprecation: [interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval]. | ||
| * see https://github.com/elastic/kibana/issues/27410 | ||
| * TODO: Once the Discover query has been update, we should change the below to use the new field |
There was a problem hiding this comment.
can you create a meta issue for that?
There was a problem hiding this comment.
can we create our own version of the brushHandler? In the next future we can add a set of kibana utilities for elastic-charts to add that
This PR remove the unnecessary style recalculation caused by chancing the cursor style on the document body from the chart_state. This was noticeable on this PR elastic/kibana#36517 (review) where the style reflow calculation tooks up to 75ms. This PR decouple the chart container from the chart renderer, allowing to set correctly the cursor changing the class without re-rendering the chart component, as the actual implementation. The cursor style now depends also on the status of the highlighted geometries. If one geometry is highlighted but no onElementClick or onElementOver listener is available, the cursor will be default if the brush is disabled, or crosshair if the brush is Enabled. The pointer is shown only if we have one between onElementClick or onElementOver enabled and we are over a geometry
# [10.0.0](v9.2.1...v10.0.0) (2019-08-21) ### Bug Fixes * **tooltip:** ie11 flex sizing ([#334](#334)) ([abaa472](abaa472)), closes [#332](#332) * decuple brush cursor from chart rendering ([#331](#331)) ([789f85a](789f85a)), closes [elastic/kibana#36517](elastic/kibana#36517) * remove clippings from chart geometries ([#320](#320)) ([ed6d0e5](ed6d0e5)), closes [#20](#20) ### Features * auto legend resize ([#316](#316)) ([659d27e](659d27e)), closes [#268](#268) * customize number of axis ticks ([#319](#319)) ([2b838d7](2b838d7)) * **theme:** base theme prop ([#333](#333)) ([a9ff5e1](a9ff5e1)), closes [#292](#292) ### BREAKING CHANGES * **theme:** remove `baseThemeType` prop on `Settings` component and `BaseThemeTypes` type. * `theme.legend.spacingBuffer` added to `Theme` type. Controls the width buffer between the legend label and value.
|
closing this in favour of: #43788 |
This PR remove the unnecessary style recalculation caused by chancing the cursor style on the document body from the chart_state. This was noticeable on this PR elastic/kibana#36517 (review) where the style reflow calculation tooks up to 75ms. This PR decouple the chart container from the chart renderer, allowing to set correctly the cursor changing the class without re-rendering the chart component, as the actual implementation. The cursor style now depends also on the status of the highlighted geometries. If one geometry is highlighted but no onElementClick or onElementOver listener is available, the cursor will be default if the brush is disabled, or crosshair if the brush is Enabled. The pointer is shown only if we have one between onElementClick or onElementOver enabled and we are over a geometry
# [10.0.0](elastic/elastic-charts@v9.2.1...v10.0.0) (2019-08-21) ### Bug Fixes * **tooltip:** ie11 flex sizing ([opensearch-project#334](elastic/elastic-charts#334)) ([2683333](elastic/elastic-charts@2683333)), closes [opensearch-project#332](elastic/elastic-charts#332) * decuple brush cursor from chart rendering ([opensearch-project#331](elastic/elastic-charts#331)) ([b5b8dde](elastic/elastic-charts@b5b8dde)), closes [elastic/kibana#36517](elastic/kibana#36517) * remove clippings from chart geometries ([opensearch-project#320](elastic/elastic-charts#320)) ([497efa4](elastic/elastic-charts@497efa4)), closes [opensearch-project#20](elastic/elastic-charts#20) ### Features * auto legend resize ([opensearch-project#316](elastic/elastic-charts#316)) ([be4a53d](elastic/elastic-charts@be4a53d)), closes [opensearch-project#268](elastic/elastic-charts#268) * customize number of axis ticks ([opensearch-project#319](elastic/elastic-charts#319)) ([a7a4ecd](elastic/elastic-charts@a7a4ecd)) * **theme:** base theme prop ([opensearch-project#333](elastic/elastic-charts#333)) ([0b38770](elastic/elastic-charts@0b38770)), closes [opensearch-project#292](elastic/elastic-charts#292) ### BREAKING CHANGES * **theme:** remove `baseThemeType` prop on `Settings` component and `BaseThemeTypes` type. * `theme.legend.spacingBuffer` added to `Theme` type. Controls the width buffer between the legend label and value.






Summary
This PR swaps out the current implementation of the histogram chart in Discover to use elastic-charts instead.
The discover functional tests that rely on checking the SVG bar heights have been commented out as elastic-charts currently renders in canvas; TODOs have been left so that these tests can be updated once elastic-charts provides a way to handle integration tests.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers