-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Converts index based data visualizer to React #42685
[ML] Converts index based data visualizer to React #42685
Conversation
Pinging @elastic/ml-ui |
💔 Build Failed |
💔 Build Failed |
x-pack/legacy/plugins/ml/public/components/create_job_link_card/create_job_link_card.tsx
Outdated
Show resolved
Hide resolved
import { ML_BREADCRUMB } from '../breadcrumbs'; | ||
|
||
export function getDataVisualizerBreadcrumbs() { | ||
// Whilst top level nav menu with tabs remains, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of whilst
👍 😆
x-pack/legacy/plugins/ml/public/data_visualizer/common/field_vis_config.ts
Outdated
Show resolved
Hide resolved
...lugins/ml/public/data_visualizer/components/field_data_card/content_types/number_content.tsx
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_visualizer/components/field_data_card/field_data_card.tsx
Outdated
Show resolved
Hide resolved
...isualizer/components/field_data_card/metric_distribution_chart/metric_distribution_chart.tsx
Outdated
Show resolved
Hide resolved
yAccessors={['y']} | ||
data={chartData.length > 0 ? chartData : [{ x: 0, y: 0 }]} | ||
curve={CurveType.CURVE_STEP_AFTER} | ||
// TODO - switch to use inline areaSeriesStyle to set series fill once charts version is 8.0.0+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming these TODOs are going to be done in a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using the inline styling of the series color in here and the document count chart will be done in a follow-up. It is awaiting the version of Elastic charts to be bumped to 8.0.0+
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes LGTM ⚡️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just added a suggestionsabout changing a function to get an array of JSX elements to a React component itself.
...plugins/ml/public/data_visualizer/components/field_data_card/examples_list/examples_list.tsx
Outdated
Show resolved
Hide resolved
...ugins/ml/public/data_visualizer/components/field_data_card/content_types/boolean_content.tsx
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
export const BooleanContent: FC<Props> = ({ config }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content of most of the card content components is the same for each card, this could be moved to a common wrapping component to cut down on the duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is enough variation in the content types that I would prefer to leave this for now, and consider it in a follow-up, for example when looking at switching the file data visualizer to use the same card component as this.
...plugins/ml/public/data_visualizer/components/field_data_card/examples_list/examples_list.tsx
Outdated
Show resolved
Hide resolved
...lugins/ml/public/data_visualizer/components/field_data_card/content_types/number_content.tsx
Show resolved
Hide resolved
...isualizer/components/field_data_card/metric_distribution_chart/metric_distribution_chart.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/ml/public/data_visualizer/data_loader/data_loader.ts
Outdated
Show resolved
Hide resolved
31da825
to
64a2074
Compare
64a2074
to
992c67e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💚 Build Succeeded |
* [ML] Converts index based data visualizer to React * [ML] Remove unused imports in React data visualizer * [ML] Address review feedback * [ML] Address comments from code review * [ML] Remove redundant ts-ignore
Summary
Migrates the index based data visualizer from AngularJS to React.
Functionally there is little change to the previous page. The most significant difference is the addition of a KQL based search bar, so that the page can be opened from a KQL based saved search as well as an index pattern.
If coming in from a lucene based saved search, the search string is displayed in a read-only search field:
The page now uses Elastic charts for charting document count and metric distributions.
See #18374
Note that unit tests will be added in a follow-up.
Checklist
For maintainers