Class default<T>

The core type of the module is a single scatterplot that manages all data and renderering.

Type Parameters

Hierarchy

  • default

Constructors

  • Type Parameters

    Parameters

    • selector: string

      A DOM selector for the div in which the scatterplot will live.

    • width: number

      The width of the scatterplot (in pixels)

    • height: number

      The height of the scatterplot (in pixels)

    • options: ScatterplotOptions = {}

    Returns default<T>

Properties

_renderer?: ReglRenderer<T>
_root?: Dataset<T>
_zoom: default<T>
bound: boolean
click_handler: ClickFunction
div: Selection<any, any, any, any>
elements?: Selection<SVGElement, any, any, any>[]
handle_highlit_point_change: ChangeToHighlitPointFunction
height: number
hooks: Record<string, Hook> = {}
label_click_handler: LabelClick
mark_ready: (() => void) = ...

Type declaration

    • (): void
    • Returns void

on_zoom?: onZoomCallback
plot_queue: Promise<void> = ...
ready: Promise<void>

Has the scatterplot completed its initial load of the data?

secondary_renderers: Record<string, Renderer<T>> = {}
selection_history: SelectionRecord<T>[] = []
tileProxy?: TileProxy
tooltip_handler: TooltipHTML
util: Record<string, ((unknown: any) => unknown)> = ...
width: number

Accessors

Methods

  • Hooks provide a mechanism to run arbitrary code after call of plotAPI has resolved. This is useful for--e.g.--updating a legend only when the plot changes.

    Parameters

    • name: string

      The name of the hook to add.

    • hook: Hook

      A function to run after each plot command.

    • unsafe: boolean = false

    Returns void

  • Parameters

    • name: string

      The name of the new column to be created. If it already exists, this will throw an error in invocation

    • codes: Record<string, number> | string[] | bigint[]

      The codes to be assigned labels. This can be either a list of ids (in which case all ids will have the value 1.0 assigned) or a keyed of values like {'Rome': 3, 'Vienna': 13} in which case the numeric values will be used.

    • key_field: string

      The field in which to look for the identifiers.

    Returns void

  • Parameters

    • features: FeatureCollection<Geometry, {
          [name: string]: any;
      }>

      A geojson feature collection containing point labels

    • name: string

      A unique key to associate with this labelset. Labels can be enabled or disabled using this key.

    • label_key: string

      The text field in which the labels are stored in the geojson object.

    • size_key: string

      A field in the dataset to associate with the size of the labels.

    • options: LabelOptions = {}

    Returns void

  • Parameters

    • url: string
    • name: string
    • label_key: string
    • size_key: string
    • options: LabelOptions

    Returns Promise<void>

  • Parameters

    • selector: string

      A selector for the root element of the deepscatter; must already exist.

    • width: number

      Width of the plot, in pixels.

    • height: number

      Height of the plot, in pixels.

    Returns void

  • Destroy the scatterplot and release all associated resources. This is necessary because removing a deepscatter instance will not de-allocate tables from GPU memory.

    Returns void

  • Parameters

    • contours: any
    • drawTo: any

    Returns void

  • Plots a set of prefs, and returns a promise that resolves upon the completion of the plot (not including any time for transitions).

    Parameters

    Returns Promise<void>

  • Parameters

    • name: string
    • unsafe: boolean = false

    Returns void

  • Parameters

    • n: number = 10

    Returns Record<string, string | number>[]

  • Get a short head start on transformations. This prevents a flicker when a new data field needs to be loaded onto the GPU.

    Returns

    A promise that resolves immediately if there's no work to do, or after the delay if there is.

    Parameters

    • prefs: APICall

      The API call to prepare.

    • delay: number = 110

      Delay in milliseconds to give the data to get onto the GPU. 110 ms seems like a decent compromise; barely perceptible to humans as a UI response time, but enough time for three animation ticks to run.

    Returns Promise<void>

  • This is the main plot entry point: it's unsafe to fire multiple times in parallel because the transition state can get all borked up. plotAPI wraps it in an await wrapper.

    Parameters

    Returns Promise<void>

Generated using TypeDoc