Skip to main content

Module default

Module default 

Source
Expand description

Reasonable default builders for a figgy chart.

The Default trait is intentionally not implemented for the chart types; values that carry user intent (titles, data ranges) must go through builders like Chart::with_title. This module only provides visual / layout defaults that work for any chart. (Sole exceptions: DrawStyle / SketchOptions — pure visual parameters with no user intent, and serde(default) requires the impls.)

Included: visual style (colors, widths, font sizes, tick lengths, grid), axis visibility policy (all axis lines and inside ticks on; top/right labels and titles off, bottom/left labels and titles on), units / formatting (Linear, Decimal, 3 sig digits), and margins.

Not included (caller supplies): chart and axis text (empty segments — filled in by builders), axis range (0..1 placeholder updated by Chart::set_*_range or auto_fit_*), and chart_area pixel size (set to match the host viewport).

Functions§

default_axis_options_colorbar
The colourbar’s z axis. Range is a 0..1 placeholder — replace with the matrix’s z statistics.
default_axis_options_x
X axis options. Range is a 0..1 placeholder — replace with Chart::set_x_range or auto_fit_x.
default_axis_options_y
Y axis options. Range is a 0..1 placeholder — replace with Chart::set_y_range or auto_fit_y.
default_axis_title_options
Axis title style. Text starts empty and is filled in by a builder.
default_chart_area
chart_area placeholder — caller resizes to match the host viewport.
default_chart_title_options
Chart title style. Text starts empty and is filled in by a builder.
default_colorbar_options
Colourbar defaults — visible, on the right, three quarters of the data area’s height, Viridis. nan_color is fully transparent: a value the ramp cannot place reads as absent rather than as some particular colour.
default_config
Reasonable default Config.
default_grid_options
Major grid on, minor grid off. Light gray lines.
default_label_style_x
Tick label style (X axis).
default_label_style_y
Tick label style (Y axis). Currently identical to X.
default_legend
Legend defaults — hidden, top-right corner, standard padding. Content starts empty; its font/font_size are live and consumed at draw time.
default_rich_text
Empty RichText (no segments). Filled in by builders.