Skip to content

Commit

Permalink
Chart tooltips delay fix (#348) (#359)
Browse files Browse the repository at this point in the history
* [FEATURE] Detector must have at least one alert set #288

Signed-off-by: Jovan Cvetkovic <[email protected]>

* [FEATURE] Decrease chart tooltips show delay #346

Signed-off-by: Jovan Cvetkovic <[email protected]>

Signed-off-by: Jovan Cvetkovic <[email protected]>
(cherry picked from commit 29385bb)

Co-authored-by: Jovan Cvetkovic <[email protected]>
  • Loading branch information
1 parent cebf975 commit 68bfa49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/utils/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { expressionInterpreter as vegaExpressionInterpreter } from 'vega-interpr
import { RuleInfo } from '../../server/models/interfaces';
import { NotificationsStart } from 'opensearch-dashboards/public';
import { OpenSearchService } from '../services';
import { Handler } from 'vega-tooltip';

export const parseStringsToOptions = (strings: string[]) => {
return strings.map((str) => ({ id: str, label: str }));
Expand Down Expand Up @@ -164,11 +165,13 @@ export function renderVisualization(spec: TopLevelSpec, containerId: string) {
}

function renderVegaSpec(spec: {}) {
const handler = new Handler();
view = new View(parse(spec, null, { expr: vegaExpressionInterpreter }), {
renderer: 'canvas', // renderer (canvas or svg)
container: `#${containerId}`, // parent DOM container
hover: true, // enable hover processing
});
view.tooltip(handler.call);
return view.runAsync();
}
}
Expand Down

0 comments on commit 68bfa49

Please sign in to comment.