MAIDR Documentation - v4.4.0
    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>;
        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.

    Only rect is read today, and only to say 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.

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

    markTypes: { rect: TraceType.HISTOGRAM }
    
    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