Skip to content

Commit

Permalink
[PieVis] PartitionVis integration to Lens. (#123937)
Browse files Browse the repository at this point in the history
* Removed pie/donut/mosaic/treemap expressions from lens

* Replaced pie/donut/mosaic/treemap expressions with expressions from expression_partition_vis

* Fixed bug with __other__ labels.

* Cleaned up not used fields at Lens.

* Added support of empty results for multiple chart types.]

* Refactored visualization_noresults.

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Kuznietsov and kibanamachine authored Feb 14, 2022
1 parent 4c31b15 commit 54de36f
Show file tree
Hide file tree
Showing 60 changed files with 1,051 additions and 2,060 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"extraPublicDirs": [
"common"
],
"requiredPlugins": ["charts", "data", "expressions", "visualizations", "fieldFormats"],
"requiredPlugins": ["charts", "data", "expressions", "visualizations", "fieldFormats", "presentationUtil"],
"requiredBundles": ["kibanaReact"],
"optionalPlugins": []
}

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 @@ -6,26 +6,31 @@
* Side Public License, v 1.
*/

import { EuiThemeComputed } from '@elastic/eui';
import { css } from '@emotion/react';
import { EuiThemeComputed } from '@elastic/eui';

export const partitionVisWrapperStyle = css({
display: 'flex',
flex: '1 1 auto',
minHeight: 0,
minWidth: 0,
width: '100%',
height: '100%',
});

export const partitionVisContainerStyleFactory = (theme: EuiThemeComputed) => css`
${partitionVisWrapperStyle};
export const partitionVisContainerStyle = css`
min-height: 0;
min-width: 0;
margin-left: auto;
margin-right: auto;
width: 100%;
height: 100%;
`;

export const partitionVisContainerWithToggleStyleFactory = (theme: EuiThemeComputed) => css`
${partitionVisContainerStyle}
inset: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: ${theme.size.s};
margin-left: auto;
margin-right: auto;
overflow: hidden;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ describe('PartitionVisComponent', function () {
} as unknown as Datatable;
const newProps = { ...wrapperProps, visData: newVisData };
const component = mount(<PartitionVisComponent {...newProps} />);
expect(findTestSubject(component, 'pieVisualizationError').text()).toEqual('No results found');
expect(findTestSubject(component, 'partitionVisEmptyValues').text()).toEqual(
'No results found'
);
});

it('renders the no results component if there are negative values', () => {
Expand Down Expand Up @@ -250,8 +252,8 @@ describe('PartitionVisComponent', function () {
} as unknown as Datatable;
const newProps = { ...wrapperProps, visData: newVisData };
const component = mount(<PartitionVisComponent {...newProps} />);
expect(findTestSubject(component, 'pieVisualizationError').text()).toEqual(
"Pie/donut charts can't render with negative values."
expect(findTestSubject(component, 'partitionVisNegativeValues').text()).toEqual(
"Pie chart can't render with negative values."
);
});
});
Loading

0 comments on commit 54de36f

Please sign in to comment.