MAIDR Documentation - v4.4.0
    Preparing search index...

    Interface D3ForestConfig

    Configuration for binding a D3 forest plot.

    Extends D3ErrorBarConfig because a forest plot is a point-range chart: one row per study, an estimate and an interval read the same way. What it adds is the part a sighted reader takes from the drawing — how much each study weighs, which row is the pooled summary, and where the null line sits.

    The pooled row is usually a differently-shaped mark (a diamond <path>, not a whip), so it is selected separately with pooledSelector and appended after the studies. A chart that draws every row alike can instead mark it with the pooled accessor.

    bindD3Forest(svgElement, {
    selector: 'g.study',
    pooledSelector: 'path.pooled',
    orientation: Orientation.HORIZONTAL,
    axes: { x: 'Odds ratio', y: 'Study' },
    x: 'study',
    y: 'or',
    yMin: 'ciLow',
    yMax: 'ciHigh',
    weight: 'weight',
    nullValue: 1,
    });
    interface D3ForestConfig {
        id?: string;
        title?: string;
        subtitle?: string;
        caption?: string;
        axes?: { x?: D3AxisInput; y?: D3AxisInput; fill?: D3AxisInput };
        format?: AxisFormat;
        autoApply?: boolean;
        weight?: DataAccessor<number>;
        pooled?: DataAccessor<boolean>;
        pooledSelector?: string;
        nullValue?: number;
        selector: string;
        x?: DataAccessor<string | number>;
        y?: DataAccessor<number>;
        yMin?: DataAccessor<number>;
        yMax?: DataAccessor<number>;
        orientation?: Orientation;
    }

    Hierarchy (View Summary)

    Index

    Properties

    id?: string

    Unique identifier for the chart. Used as the MAIDR id.

    title?: string

    Chart title displayed in text descriptions.

    subtitle?: string

    Chart subtitle.

    caption?: string

    Chart caption.

    axes?: { x?: D3AxisInput; y?: D3AxisInput; fill?: D3AxisInput }

    Axis configuration. Each axis may be provided as either a plain string (shorthand for { label: value }) or a full AxisConfig object (for per-axis format, or grid navigation on scatter).

    For heatmaps and segmented bar charts, use fill for the color/category axis; the binder maps it to the canonical z axis in the MAIDR schema.

    Type Declaration

    format?: AxisFormat

    Optional formatting configuration applied to axes that do not specify their own format. Per-axis format on AxisConfig takes precedence.

    autoApply?: boolean

    When true (the default), the binder writes the generated MAIDR schema to the SVG as a maidr-data attribute so vanilla-JS users don't need to call svg.setAttribute(...) themselves. The returned result is unchanged either way.

    Set to false if you are driving MAIDR yourself — e.g. passing the returned schema to <Maidr data={...}> or persisting it elsewhere. The React adapter (useD3Adapter, MaidrD3) forces this to false internally so it can stay in control of the schema.

    true
    
    weight?: DataAccessor<number>

    Accessor for the study's weight in the pooled estimate, as a fraction of one.

    'weight', falling back to w or share. Omitted from the payload when the datum carries none of them — a forest plot without weights is a real chart.

    pooled?: DataAccessor<boolean>

    Accessor marking a row as the pooled summary rather than a study.

    'pooled', falling back to isPooled or summary. Every row matched by pooledSelector is pooled regardless.

    pooledSelector?: string

    CSS selector for the pooled summary's own mark, when it is drawn differently from the studies — the diamond a meta-analysis ends with. Its rows are appended after the studies, in the order they are drawn.

    nullValue?: number

    The value that means "no effect" — 1 for a ratio measure, 0 for a difference.

    Whether a study's interval crosses it is the result for that study, so the trace announces the crossing. There is deliberately no default: a ratio chart guessed at 0 would report every study as not crossing, which is a confident wrong answer given to every row.

    selector: string

    CSS selector for the per-estimate elements (e.g. 'g.estimate').

    x?: DataAccessor<string | number>

    Accessor for the x-axis (category) value.

    'x'
    
    y?: DataAccessor<number>

    Accessor for the estimate itself.

    'y', falling back to value, mean, estimate, or median.

    yMin?: DataAccessor<number>

    Accessor for the interval's absolute lower bound.

    'yMin', falling back to lower, ciLow, ci_low, low, or min. Omitted from the payload when the datum carries none of them — a one-sided interval is a real chart.

    yMax?: DataAccessor<number>

    Accessor for the interval's absolute upper bound.

    'yMax', falling back to upper, ciHigh, ci_high, high, or max.

    orientation?: Orientation

    Chart orientation.

    Orientation.VERTICAL