Expand description
Prepare chart data from a LazyFrame: read the chart’s columns, then turn them into points, bins or statistics.
Every chart reads its rows through [read_columns]: up to a row limit of them,
spread across the table by the sampler the analysis tools use, so a chart shows the
table and not its first rows. What was read comes back as RowsRead, so the chart
can say when it shows a sample.
Structs§
- Aggregate
Spec - What an aggregated line or scatter chart groups by and makes of the rows.
- Axis
Format - How every tick of one numeric axis is written: one notation and one precision for all of them, chosen from the ticks, in the table’s grouping and decimal separator. Chosen per tick, an axis switched to scientific notation partway up.
- Axis
Numbers - What a numeric axis holds: the table’s format for its numbers, and whether they are whole (counts, an integer column), which ticks the axis only at whole numbers.
- Bar
- One bar: its category (
Nonefor a null category) and its value. Split by a color, a bar is a row of bars, one per group (Nonewhere a group has no rows), and its value is their total. - BarAggregate
- What an aggregated bar chart groups by and makes of the rows.
- BarData
- A bar chart: one bar per category, in order, up to
BAR_CAP. - BoxPlot
Data - BoxPlot
Stats - Box plot stats for a column.
- Chart
Data Result - Result of preparing chart data: series points and x-axis kind for label formatting.
- Chart
Sampling - How a chart reads its rows.
- ChartX
Range Result - Result of loading only the x column: min/max for axis bounds and temporal kind.
- Clipped
- A range that left values out: which, and how many.
- Color
Split - A column a chart is split by, and the values given a group each, in color order.
Noneis the rows with no value. Withother, every other value’s rows make one more group after them,OTHER. - Grouped
Series - Series of a line or scatter chart, each named: a Y column’s or a color group’s.
- Heatmap
Data - Heatmap data for two numeric columns.
- Held
Rows - The rows a chart last read from one view. Another bin count, range, bandwidth or chart over columns already read draws from them instead of reading the table again, and every chart of the view describes the same sample. Shared with the worker that reads; whoever owns the view starts a new one when the view changes.
- Histogram
Bin - Histogram bin (center and count).
- Histogram
Data - Histogram data for a single column.
- Histogram
Group - One group’s bins of a histogram split by a color: its count (or share) per bin, on the bins of the whole.
- KdeData
- KdeSeries
- KDE series and bounds.
- Rows
Read - What a chart read: the rows the table has, and how many of them were sampled when that was fewer.
- Value
Rows - A column’s values with the rows holding each, most rows first (equal counts in the column’s order), counted over the whole view.
Enums§
- BarOrder
- The order of a bar chart’s bars, top to bottom.
- BarValue
- What sets a bar’s length: a numeric column, one row per category, or how many rows each category has.
- Value
Range - Which values a histogram, box plot or KDE draws. Outliers far from the body squash it into a bin or two; a percentile range leaves them out and says how many.
- XAxis
Temporal Kind - Describes how x-axis numeric values map to temporal types for label formatting.
Constants§
- AGGREGATE_
POINTS_ MAX - Most points an aggregated chart keeps. Past this X is close to a value per row, and a time bucket is what it needs.
- BAR_CAP
- Most bars a bar chart prepares; the rest are counted, not drawn. More than a tall terminal shows, few enough that an export stays legible.
- COUNT_
CATEGORY_ CAP - Categories a count keeps before it stops: past this the column is an identifier, not a category, and a count per value would hold as much as the table.
- OTHER
- The name of the group of every value not given one of its own.
Functions§
- accumulate
- Make
pointscumulative along X: a running sum, or returns compounded (each value a rate; the point is what 1 grew to, less 1). - chart_
notes - What a chart says under the plot about its input, one line each: that it is a
sample, with the seed that draws it again, and how many values a range left out.
Empty when it shows every row and every value.
middotjoins the seed on. - color_
groups - The groups a color makes: the values picked, in the order picked, or else the
largest by rows; at most
most, one per series color. - format_
bar_ value - Format a bar’s value for the label beside it in
format: an integer column’s whole, anything else to the format’s decimal places or two, so every bar shows the same number of them. Values too large, or too small to show in those places, go to scientific notation. - group_
label - A group’s name as a legend writes it.
- is_
category_ dtype - Column types a bar chart takes as its category: text, categories, booleans and integers. A float or a timestamp is a measure, not a category.
- prepare_
aggregate_ xy - A line or scatter chart of Y aggregated per X (per time bucket of a temporal X), and per color group: one lazy group-by over every row of the view. A count needs no Y column; any other aggregate draws a series per Y column, or per color group of the first.
- prepare_
bar_ aggregate - A bar chart of
valueaggregated per category (and per color group): one lazy group-by over every row of the view. A count needs no value column; one without a color is the exact count a bar chart of counts draws. - prepare_
bar_ counts - Prepare a bar chart of how many rows each category has. The counts are exact: the
whole view is counted, whatever the sample size, in one streamed pass that keeps a
count per category and no rows. When the rows held are the whole view, those are
counted instead. Past
COUNT_CATEGORY_CAPcategories the count stops, and says so rather than drawing part of the view as the whole. - prepare_
bar_ data - Prepare a bar chart: one bar per row, the category from
category, the length fromvalue. The chart takes a grouped result — one row per category — and refuses a category that repeats rather than guess how to combine its rows. A null category is a bar of its own; a null value leaves its category out, counted inno_value. - prepare_
box_ by - Prepare one box of
columnper group ofby: a box per category. The range is each group’s own, as each box describes its group. - prepare_
box_ plot_ data - Prepare box plot stats for one or more numeric columns. Uses a single read for all columns.
- prepare_
chart_ data - Prepares XY series from the current LazyFrame. X is cast to f64 (temporal types as ordinal). Nulls are dropped per series: a null X drops the row, a null Y drops that series’ point and breaks its line. Points come in X order, so a line runs left to right whatever order the rows are in; ties keep table order.
- prepare_
chart_ x_ range - Loads only the x column and returns its min/max (for axis display when no y is selected).
- prepare_
heatmap_ data - Prepare heatmap data for two numeric columns. A row counts when both are present.
- prepare_
histogram_ by - Prepare a histogram of
column, split bycolorinto groups on the same bins when given. Withshare, a bin is its share of its group’s rows (of every row, unsplit), so groups of different sizes compare. The range is the whole column’s, so every group is clipped alike. - prepare_
histogram_ data - Prepare histogram data for a numeric column.
- prepare_
kde_ by - Prepare one density curve of
columnper group ofcolor. The range is the whole column’s, so every curve is clipped alike. - prepare_
kde_ data - Prepare KDE data for one or more numeric columns. Uses a single read for all columns.
- prepare_
xy_ by - A line or scatter chart of
ysplit bycolor, from the rows a chart samples: one series per group, in X order, each breaking where its Y has no value. - segments
- A series split at its breaks: the runs a line joins.
- table_
number_ format - The format the table prints
columnin, plain where it prints it unformatted. - value_
rows - Count
column’s values over the whole view, or take the count held for it: one streamed pass that keeps a count per value, the one a bar chart of counts makes. - x_
axis_ label_ at - An x tick at
levelof detail, 0 the fullest, orNonepast the shortest form. A narrow axis steps down until its labels fit: a date to year-month and then the year, or to month-day when both ends of the axis,bounds, fall in one year; a datetime first to its date, or to the minute when the axis spans one day; a time to the minute. A number, or a time past what it can stand for, is written innumbers. - x_
axis_ temporal_ kind_ for_ column - Returns the x-axis temporal kind for a column from the schema (for axis label formatting when no data is loaded yet).