[ML] Explorer Chart Tweaks#22955
Conversation
… beginning of the selected time span.
|
Pinging @elastic/ml-ui |
| let addAnotherTick; | ||
|
|
||
| switch (operator) { | ||
| case 'previous': |
There was a problem hiding this comment.
the TICK_DIRECTION constant could be used here
| const newTickData = getTickData(getNeighourTick(ts)); | ||
|
|
||
| if ( | ||
| newTickData !== false |
There was a problem hiding this comment.
this style with just one condition looks a bit odd.
peteharverson
left a comment
There was a problem hiding this comment.
Some minor comments, otherwise LGTM
|
|
||
| // 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.
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.
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.
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.
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.