Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

627 B
Raw Blame
import type { HoverObject as PluginHoverObject } from "custom-viz";

import type {
  ComputedVisualizationSettings,
  HoveredObject,
} from "metabase/viz-core";

export type { PluginHoverObject };

export function toHostHoverObject(
  hoverObject: PluginHoverObject,
  settings: ComputedVisualizationSettings,
): HoveredObject {
  return {
    index: hoverObject.index,
    seriesIndex: hoverObject.seriesIndex,
    value: hoverObject.value,
    column: hoverObject.column,
    data: hoverObject.data,
    dimensions: hoverObject.dimensions,
    element: hoverObject.element,
    event: hoverObject.event,
    settings,
  };
}