-
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] Redesign index-based Data Visualizer #85726
Conversation
- Clear charts data upon unamounting explorer page - Avoid rendering three times per ChartContainer - Avoid expensive chartData/scaleCategoriesSet lookup
…emove vertical spacker
Some suggestions:
|
@@ -1,2 +1,3 @@ | |||
@import 'file_based/index'; | |||
@import 'index_based/index'; | |||
@import "stats_datagrid/index"; |
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 other imports have single quotes.
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.
Updated here 0dcdf2e
@@ -7,6 +7,7 @@ | |||
import { Direction, EuiBasicTableProps, Pagination, PropertySort } from '@elastic/eui'; | |||
import { useCallback, useMemo } from 'react'; | |||
import { ListingPageUrlState } from '../../../../../../../common/types/common'; | |||
import { DataVisualizerIndexBasedAppState } from '../../../../../../../common/types/ml_url_generator'; |
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.
Since useTableSettings()
is now used in other places than just from within the analytics management page, should we move the file to a more general place?
latestFormatted: formatDate(latest, TIME_FORMAT), | ||
}} | ||
return ( | ||
<EuiFlexGroup direction={'row'}> |
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.
Can you explain why we need a flex layout with a single item here?
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.
Updated here 0dcdf2e
.mlTopValuesLabelContainer { | ||
padding-right: $euiSizeM; | ||
|
||
&.small { | ||
width: 50px !important; | ||
} | ||
|
||
&.large { | ||
width: 200px !important; | ||
} | ||
} |
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.
We should use a different structure, with this we end up with non-prefixed very generic css classes in the DOM like small/large
. Consider using the BEM-style described on the bottom of this page (Sass best practices) https://elastic.github.io/eui/#/guidelines/sass.
You should end up creating classes that look like mlTopValuesLabelContainer--small
. In the react code you will need to use both the base class and this modifier.
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.
Updated here 0dcdf2e
className={classNames( | ||
'eui-textTruncate', | ||
'mlTopValuesLabelContainer', | ||
compressed === true ? 'small' : 'large' |
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.
With the SASS changes suggested in the other comment this should become e.g. mlTopValuesLabelContainer--${compressed === true ? 'small' : 'large'}
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.
Updated here 0dcdf2e
@mdefazio @walterra I have updated the colors of the chart here, with additional paddings in between here 59e11f9 |
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
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 were a few small things (also mentioned on Slack) that can be cleaned up. Fine if this is done in a follow-up PR.
@@ -57,6 +57,7 @@ | |||
} | |||
|
|||
.mlFieldDataCard__codeContent { | |||
@include euiCodeFont; | |||
font-family: $euiCodeFontFamily; |
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.
You shouldn't need this extra declaration.
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.
Updated here c16d60d
&.mlTopValuesLabelContainer--small { | ||
width: 50px !important; | ||
} | ||
|
||
&.mlTopValuesLabelContainer--large { | ||
width: 200px !important; | ||
} |
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.
Ideally we would avoid both the pixel values and the use of !important
. I understand if this needs to be done in a follow-up PR but we try to avoid these sort of things.
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.
Updated here c16d60d
} | ||
.mlFieldDataCard__codeContent { | ||
@include euiCodeFont; | ||
font-family: $euiCodeFontFamily; |
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.
Again, don't need this with the mixin.
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.
Updated here c16d60d
.euiTableRowCell{ | ||
background-color: transparent !important; | ||
border-top: 0px; | ||
border-bottom: 1px solid $euiColorLightShade; |
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.
We can use $euiBorderThin
instead of writing this out (both instances of this).
text-transform: uppercase; | ||
text-align: left; | ||
color: $euiColorDarkShade; | ||
font-weight: bold; |
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.
If we use EuiTitle
we can do much of this as props. More of an FYI in the future.
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
Summary
This PR brings a redesign to the index based data visualizer, where instead of cards for fields, we use table in order to save space and provide more information in a compact way.
Show empty fields
enabled:Distributions
preview off:Distributions
preview on:To follow up
Checklist
Delete any items that are not applicable to this PR.