Layout

Layout :: # (opaque)

A chart's layout is independent of its trace coordinate types.

new : Props -> Layout

Construct a layout from already validated settings. This function is infallible. Combine Title.new, Font.new and Axis.new when the corresponding presentation needs an override.

get_title : Layout -> Str

Title for a generated HTML document, with a display fallback when no explicit title exists. This does not add a Plotly chart title.

to_json_value : Layout -> InternalJson

Internal composition hook used by Plume's renderers. Applications normally use Layout.to_json for complete JSON text; this returns the package's safe internal value without accepting raw JSON.

to_json : Layout -> Str

Serialize this validated value as a complete JSON document.

BarMode : [Group, Stack, Overlay, Relative]

Choose how several bar traces share a position. Group places them side by side, Stack piles them up, Overlay draws them over each other (use translucent colors), and Relative stacks positive values upwards and negative values downwards.

HoverMode : [Auto, Closest, X, Y, XUnified, YUnified, Off]

Choose what the pointer reveals. Auto keeps Plotly's default, the closest point. Closest names it explicitly. X and Y show every trace's point at the pointer's x or y position in separate labels; XUnified and YUnified gather them into one label, which suits time series. Off disables hover labels.

LegendPosition : [Auto, Above, Below, InsideTopLeft, InsideTopRight, InsideBottomLeft, InsideBottomRight]

Choose where the legend sits when it is shown. Auto keeps Plotly's position, to the right of the plotting area. Above and Below lay the entries out in a row above or below it, which leaves the plotting area its full width. The Inside corners place the legend over the plotting area.

UiRevision : [ResetOnUpdate, Preserve(Str)]

Choose what happens to the viewer's zoom, pan, selections and hidden traces when an application draws an updated figure in the same chart with Plotly's react. ResetOnUpdate draws exactly the new figure. Preserve(revision) keeps the viewer's changes while revision stays the same; change the revision to reset them deliberately, such as when the chart switches to a different dataset.

Props

:= {
    global_font : Font ?? Font.default,
    title : Title ?? Title.default,
    x_axis : Axis ?? Axis.default,
    y_axis : Axis ?? Axis.default,
    legend : [Shown, Hidden] ?? Hidden,
    legend_position : LegendPosition ?? Auto,
    size : Size ?? Size.default,
    bar_mode : BarMode ?? Group,
    hover_mode : HoverMode ?? Auto,
    ui_revision : UiRevision ?? ResetOnUpdate,
    shapes : List(Shape) ?? [],
}

Configure shared chart presentation. global_font supplies text styling for the chart; title supplies its visible title. x_axis and y_axis configure Cartesian axes. Their defaults inherit Plotly settings. legend: Hidden suppresses the legend by default; use Shown to display trace names, and legend_position to place it. size sets pixel dimensions and margins, defaulting to Size.default. bar_mode defaults to Group, hover_mode to Auto and ui_revision to ResetOnUpdate. shapes adds reference lines and bands, drawn in list order, and defaults to none.