Skip to content

Conversation

@walterra
Copy link
Contributor

@walterra walterra commented Oct 14, 2019

Summary

Migrates the chart tooltip of Anomaly Explorer and Single Metric Viewer to use React.

  • The tooltip styling, code and features have been updated to be more in line with Elastic Charts tooltips. This prepares us should we want to use Elastic Charts' tooltip as is at some point.
  • jQuery is no longer used in mlChartTooltipService.
  • The tooltip content is no longer raw HTML, a mostly Elastic Charts compatible data structure is now passed around by mlChartTooltipService.

image

image

image

image

image

image

image

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@walterra walterra added Feature:New Platform :ml Feature:Anomaly Detection ML anomaly detection v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Oct 14, 2019
@walterra walterra requested review from a team as code owners October 14, 2019 15:58
@walterra walterra self-assigned this Oct 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Contributor

💔 Build Failed

}

&--hidden {
opacity: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can try visibility property


interface TooltipData {
name: string;
value: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string | ReactElement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed to reuse the types provided by Elastic Charts in a270966 (However, Elastic Charts treat this as any internally).

clearTimeout(this.fadeTimeout);
}
// side bar width
const euiNavDrawer = document.getElementsByClassName('euiNavDrawer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use ref here instead of imperatively access the DOM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That element is in a completely different area in Kibana we don't control. I'll leave this as-is replacement for the previous jQuery-based version in here for now.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

}, {
br: '<br />',
scheduledEventsValue: marker.scheduledEvents.map(mlEscape).join('<br/>')
tooltipData.push({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout for scheduled events need some tweaking I think:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a fix in 002ccfb to better handle multiple events within a tooltip. There's not much I can do in the case above, but the updated max-width: 512px might help.

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested latest edits and all LGTM

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@walterra walterra merged commit 0d0b38a into elastic:master Oct 15, 2019
@walterra walterra deleted the ml-chart-tooltip-react branch October 15, 2019 18:04
walterra added a commit to walterra/kibana that referenced this pull request Oct 15, 2019
- The tooltip styling, code and features have been updated to be more in line with Elastic Charts tooltips. This prepares us should we want to use Elastic Charts' tooltip as is at some point.
- jQuery is no longer used in mlChartTooltipService.
- The tooltip content is no longer raw HTML, a mostly Elastic Charts compatible data structure is now passed around by mlChartTooltipService.
walterra added a commit that referenced this pull request Oct 15, 2019
- The tooltip styling, code and features have been updated to be more in line with Elastic Charts tooltips. This prepares us should we want to use Elastic Charts' tooltip as is at some point.
- jQuery is no longer used in mlChartTooltipService.
- The tooltip content is no longer raw HTML, a mostly Elastic Charts compatible data structure is now passed around by mlChartTooltipService.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Anomaly Detection ML anomaly detection Feature:New Platform :ml release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants