MAIDR JavaScript API
    Preparing search index...

    Interface ObservablePlotOptions

    Options for bindObservablePlot.

    Every field is optional: the adapter's whole point is that a plot drawn by somebody else, in a Quarto document it does not control, still becomes navigable. These exist for the cases where the DOM cannot carry the intent — a chart with no title, an axis Plot labelled from a column name, or a mark whose type the adapter would otherwise have to guess.

    interface ObservablePlotOptions {
        id?: string;
        title?: string;
        subtitle?: string;
        caption?: string;
        axes?: { x?: string; y?: string; z?: string };
        markTypes?: Record<string, string>;
        percentileBands?: PercentileBandOption[];
        autoApply?: boolean;
    }
    Index

    Properties

    id?: string

    Figure id. Generated when omitted.

    title?: string

    Chart title. Overrides the <h2> Plot renders from its title option.

    subtitle?: string

    Chart subtitle. Overrides Plot's <h3>.

    caption?: string

    Chart caption. Overrides Plot's <figcaption>.

    axes?: { x?: string; y?: string; z?: string }

    Axis labels. Each overrides the label Plot drew for that axis.

    markTypes?: Record<string, string>

    Forces the MAIDR trace type of a mark, keyed by the mark's Plot aria-label.

    Three keys are read. rect takes TraceType.HISTOGRAM: a rect mark is otherwise taken for a histogram when both axes are continuous and for a bar chart when one is categorical, which is right for the marks Plot's own examples produce. A binned rect drawn against a categorical axis is the case that needs telling. dot takes TraceType.HEXBIN, for hexagons a symbol: 'hexagon' scatter draws just the same. line takes TraceType.PR_CURVE, for a precision-recall curve whose axes are not labelled recall and precision; its points must still be fractions of one on both axes.

    Other keys are accepted and ignored, so a future release can honour them without breaking a caller that set one.

    markTypes: { rect: TraceType.HISTOGRAM }
    
    percentileBands?: PercentileBandOption[]

    Fan charts drawn on the plot, each read as one percentile_band layer.

    Plot.areaY given y1 and y2 draws a band, and nothing in the drawn chart says which quantiles its edges are, so a band is otherwise skipped. Each mark is named by the className Plot puts on its group: median names a line mark, and each band's series an area mark, with the band's two levels as fractions. The values are read back out of the paths, as every line and area is, and matched to the median by x.

    // Plot.areaY(rows, {x: 'step', y1: 'p5', y2: 'p95', className: 'p90'}),
    // Plot.lineY(rows, {x: 'step', y: 'p50', className: 'median'})
    percentileBands: [{
    median: 'median',
    bands: [{ series: 'p90', lower: 0.05, upper: 0.95 }],
    }]
    autoApply?: boolean

    When false, the schema is returned but not written to the DOM, and no maidr:bindchart event fires. Use it to post-process the schema before handing it to <Maidr> yourself.

    true