--- layout: typedoc title: 'Viewer | @msrvida/sanddance-react' ---

Component to view a SandDance data visualization.

Hierarchy

  • Viewer

Index

Constructors

constructor

  • Instantiate a new Viewer.

    Parameters

    • element: HTMLElement

      Parent HTMLElement to present within.

    • Optional options: Partial<ViewerOptions>

      Optional viewer options object.

    Returns Viewer

Properties

colorContexts

colorContexts: ColorContext[]

Color contexts. There is only one color context until data is filtered, after which colors may be re-mapped in another color context.

currentColorContext

currentColorContext: number

Index of current color context. Change this and then call renderSameLayout().

element

element: HTMLElement

insight

insight: Insight

Insight object from current rendering.

options

options: ViewerOptions

Viewer options object.

presenter

presenter: Presenter

Presenter which does the rendering.

specCapabilities

specCapabilities: SpecCapabilities

Behavior specified by the visualization type.

vegaSpec

vegaSpec: Spec

Vega specification.

vegaViewGl

vegaViewGl: ViewGl_Class

Vega View instance.

Static defaultViewerOptions

defaultViewerOptions: ViewerOptions

Default Viewer options.

Methods

activate

  • activate(datum: object): Promise<void>
  • Set one data row to the active state.

    Parameters

    • datum: object

    Returns Promise<void>

deActivate

  • deActivate(): Promise<void>
  • Deactivate item.

    Returns Promise<void>

deselect

  • deselect(): Promise<void>
  • Removes any selection.

    Returns Promise<void>

filter

  • filter(search: Search, rebase?: boolean): Promise<void>
  • Filter the data and animate.

    Parameters

    Returns Promise<void>

finalize

  • finalize(): void
  • Returns void

getColumnStats

  • Gets column stats from current data (filtered or all).

    Parameters

    • column: Column

      Column to get stats for.

    Returns ColumnStats

getInsight

  • Gets the current insight with signal values.

    Returns Insight

getSelection

  • Gets the current selection.

    Returns SelectionState

getSignalValues

  • Gets current signal values.

    Returns SignalValues

render

  • Render data into a visualization.

    Parameters

    • insight: Insight

      Object to create a visualization specification.

    • data: object[]

      Array of data objects.

    • Optional options: RenderOptions

    Returns Promise<RenderResult>

renderSameLayout

  • renderSameLayout(newViewerOptions?: Partial<ViewerOptions>): void
  • Render the same layout with new options.

    Parameters

    • Optional newViewerOptions: Partial<ViewerOptions>

      New options object.

    Returns void

reset

  • reset(): Promise<void>
  • Remove any filtration and animate.

    Returns Promise<void>

select

  • select(search: Search): Promise<void>