-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Explorer Chart Tweaks #22955
[ML] Explorer Chart Tweaks #22955
Conversation
… beginning of the selected time span.
Pinging @elastic/ml-ui |
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
let addAnotherTick; | ||
|
||
switch (operator) { | ||
case 'previous': |
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 TICK_DIRECTION
constant could be used here
const newTickData = getTickData(getNeighourTick(ts)); | ||
|
||
if ( | ||
newTickData !== false |
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.
this style with just one condition looks a bit odd.
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.
Some minor comments, otherwise LGTM
.tickFormat(d => moment(d).format(xAxisTickFormat)); | ||
|
||
// With tooManyBuckets the chart would end up with no x-axis labels | ||
// because the ticks are based on the span of the emphasis section, | ||
// but that one spans the whole chart width with tooManyBuckets. |
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.
I don't really understand what this is saying. Maybe something like 'and the highlighted area would span the entire chart'?
// ones where we remove the label in the next steps. | ||
axis.selectAll('g.tick').select('line').classed('ml-tick-emphasis', true); | ||
|
||
function getNeighourTickFactory(operator) { |
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.
Typo in the function name. Should be getNeighbourTickFactory
or I suppose getNeighborTickFactory
if we are sticking with American English ;)
} | ||
|
||
function getTickDataFactory(operator) { | ||
const getNeighourTick = getNeighourTickFactory(operator); |
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.
Same typos here. Should be 'Neighbor' / 'Neighbour'.
// that is required/wanted to show up. The code then traverses to both sides along the axis | ||
// and decides which labels to keep or remove. All vertical tick lines will be kept visible, | ||
// but those which still have their text label will be emphasized using the ml-tick-emphasis class. | ||
export function removeLabelOverlap(axis, startTs, tickInterval, width) { |
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.
I think 'startTimestamp' would be a clearer name for this argument, assuming 'Ts' is a timestamp?
💚 Build Succeeded |
- The aim of this is to more clearly visualize how the timerange of the cell selected in the swimlane relates to the time span shown in the charts. - The most important change is that the vertical date axis ticks no longer are randomly positioned by d3. Instead they are aligned with the cell interval of the swimlane. This way, the date information shown in the swimlane tooltip will always align with the date tick shown left of the emphasized area in the chart. - The highlighted area now features a gray rounded border to resemble the styling of the selected cell in the swimlane. - The chart also fixes where to long chart headers would wrap the "View" link to a new line. - The x/y axis labels blackness has been reduced to reduce emphasis on the labels.
💚 Build Succeeded |
- The aim of this is to more clearly visualize how the timerange of the cell selected in the swimlane relates to the time span shown in the charts. - The most important change is that the vertical date axis ticks no longer are randomly positioned by d3. Instead they are aligned with the cell interval of the swimlane. This way, the date information shown in the swimlane tooltip will always align with the date tick shown left of the emphasized area in the chart. - The highlighted area now features a gray rounded border to resemble the styling of the selected cell in the swimlane. - The chart also fixes where to long chart headers would wrap the "View" link to a new line. - The x/y axis labels blackness has been reduced to reduce emphasis on the labels.
Fixes #18067.
This tweaks the design of the Anomaly Explorer Charts as discussed in the issue mentioned above.
The aim of this is to more clearly visualize how the timerange of the cell selected in the swimlane relates to the time span shown in the charts.
Here's a comparison showing the previous layout (left) vs the updated on (right):
The time span shown in the charts is chosen dynamically and can differ, here's another comparison:
The new version shows more vertical ticks now, again, they correspond to the interval in the swimlane. Only certain ticks are highlighted with date labels to avoid label overlap, but it's made sure the label at the start of the highlighted area is shown to correspond with the tooltip information of the swimlane. The density of the vertical ticks provides some context about how the shown time span relates to the amount of represented cells in the swimlane. The right chart also shows a fix where to long chart headers would wrap the "View" link to a new line. The x/y axis labels blackness has been reduced to reduce emphasis on the labels.