Statwise.Visualization.Dataset (Statwise v0.1.0)

Copy Markdown View Source

Normalized row-oriented visualization data.

Plot builders accept tidy rows, maps of columns, Explorer data frames, and one-dimensional numeric samples. Internally they work with this struct so extraction and missing-value behavior stay consistent across chart types.

Summary

Functions

Fetches a row field using atom or string keys.

Builds a dataset from a map or dataframe-like object of equal-length columns.

Builds a dataset from Explorer.DataFrame when Explorer is loaded.

Builds a dataset from tidy row maps.

Builds a single-field dataset from a one-dimensional numeric sample.

Chooses a dataset conversion based on the input shape.

Extracts complete rows for a list of mapped fields.

Types

source()

@type source() :: :rows | :columns | :explorer | :values

t()

@type t() :: %Statwise.Visualization.Dataset{
  fields: MapSet.t(),
  rows: [map()],
  source: source()
}

Functions

fetch!(row, field)

fetch!(dataset, row, field)

Fetches a row field using atom or string keys.

from_columns(columns)

Builds a dataset from a map or dataframe-like object of equal-length columns.

from_explorer(df)

Builds a dataset from Explorer.DataFrame when Explorer is loaded.

from_rows(rows)

Builds a dataset from tidy row maps.

from_values(values, field \\ :value, opts \\ [])

Builds a single-field dataset from a one-dimensional numeric sample.

new(dataset)

Chooses a dataset conversion based on the input shape.

select_rows(dataset, fields, opts \\ [])

Extracts complete rows for a list of mapped fields.