Skip to content
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] Fixes Anomaly Explorer swimlane label and chart tooltips #61327

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import 'components/explorer_chart_label/index';
@import 'explorer_chart';
@import 'explorer_chart_tooltip';
@import 'explorer_charts_container';
@import 'explorer_charts_container';
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import './_explorer_chart_label.scss';
import PropTypes from 'prop-types';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import './_explorer_chart_tooltip.scss';
import PropTypes from 'prop-types';
import React from 'react';

Expand Down
14 changes: 11 additions & 3 deletions x-pack/plugins/ml/public/application/explorer/explorer_swimlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,17 @@ export class ExplorerSwimlane extends React.Component {
.each(function() {
if (swimlaneData.fieldName !== undefined) {
d3.select(this)
.on('mouseover', label => {
.on('mouseover', value => {
mlChartTooltipService.show(
[{ skipHeader: true }, { name: swimlaneData.fieldName, value: label }],
[
{ skipHeader: true },
{
label: swimlaneData.fieldName,
value,
seriesIdentifier: { key: value },
valueAccessor: 'fieldName',
},
],
this,
{
x: laneLabelWidth,
Expand All @@ -400,7 +408,7 @@ export class ExplorerSwimlane extends React.Component {
.on('mouseout', () => {
mlChartTooltipService.hide();
})
.attr('aria-label', label => `${mlEscape(swimlaneData.fieldName)}: ${mlEscape(label)}`);
.attr('aria-label', value => `${mlEscape(swimlaneData.fieldName)}: ${mlEscape(value)}`);
}
});

Expand Down