Skip to content

Commit

Permalink
Chart tooltips delay fix (opensearch-project#348) (opensearch-project…
Browse files Browse the repository at this point in the history
…#358)

* [FEATURE] Detector must have at least one alert set opensearch-project#288

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

* [FEATURE] Decrease chart tooltips show delay opensearch-project#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]>
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
2 people authored and AWSHurneyt committed Feb 22, 2023
1 parent 018569c commit ab08351
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 ab08351

Please sign in to comment.