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

    Interface D3SurvivalConfig

    Configuration for binding a D3 Kaplan-Meier survival curve.

    A survival curve is a step line — d3.line().curve(d3.curveStepAfter) over one <path> per arm — so selector, pointSelector and the x/y/fill accessors are D3LineConfig's, unchanged. What a survival figure carries beyond a step chart is the two things it is read for: which times were censored, and how wide the confidence band is.

    Censoring marks are drawn as ticks from their own data join, not as vertices of the curve, so they are usually a separate selection: point censoredSelector at them and the binder merges each tick into its arm by time — flagging the vertex already at that time, or inserting one carrying the probability the curve holds there. When the curve's own samples already say (a censored column), leave censoredSelector unset and let the censored accessor read it.

    interface D3SurvivalConfig {
        id?: string;
        title?: string;
        subtitle?: string;
        caption?: string;
        axes?: { x?: D3AxisInput; y?: D3AxisInput; fill?: D3AxisInput };
        format?: AxisFormat;
        autoApply?: boolean;
        selector: string;
        pointSelector?: string;
        x?: DataAccessor<string | number>;
        y?: DataAccessor<number>;
        fill?: DataAccessor<string>;
        stepDirection?: StepDirection;
        censored?: DataAccessor<unknown>;
        censoredSelector?: string;
        yMin?: DataAccessor<number>;
        yMax?: DataAccessor<number>;
    }

    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
    
    selector: string

    CSS selector for the line path elements (e.g., 'path.line', '.line'). Each matched element represents one line/series.

    pointSelector?: string

    CSS selector for the data point elements per line (e.g., 'circle'). If not provided, data is extracted from the line path __data__ binding.

    x?: DataAccessor<string | number>

    Accessor for the x-axis value of each point.

    'x'
    
    y?: DataAccessor<number>

    Accessor for the y-axis value of each point.

    'y'
    
    fill?: DataAccessor<string>

    Accessor for the series/fill label.

    'fill'
    
    stepDirection?: StepDirection

    Which way the risers of a step curve go, when the line is drawn as one.

    'hv' holds the level and jumps at the next sample, which is d3.curveStepAfter; 'vh' jumps at the current one, d3.curveStepBefore; 'mid' jumps halfway between the two, d3.curveStep. Declaring it is what turns a bindD3Line bind into a step reading — navigated by transition rather than by sample, and described in terms of its runs — and what tells an area's trace that the extra vertices in the rendered path are risers rather than samples.

    Left undefined by default rather than guessed, because this binder reads its data off __data__ and never looks at the path: which curve you drew is your own knowledge, not something the drawing gives back. All three of d3's step curves have a name here, so leaving it out is a caller saying nothing rather than a convention MAIDR cannot express.

    censored?: DataAccessor<unknown>

    Accessor for whether a sample is a censored time.

    'censored', falling back to censor or isCensored. true, 1, '1' and 'true' count as censored; anything else does not.

    Deliberately NOT aliased to event, which most survival datasets carry with the opposite meaning — a 1 there is the event happening, which is exactly the times that are not censored.

    censoredSelector?: string

    CSS selector for the censoring tick marks, when the chart draws them from a separate data join (e.g. 'line.censor'). Each tick is merged into the arm its fill names — or the only arm, on a single-curve chart — at the time its x gives.

    yMin?: DataAccessor<number>

    Accessor for the confidence band's lower bound.

    'yMin', falling back to lower, lo, ciLower or low.

    yMax?: DataAccessor<number>

    Accessor for the confidence band's upper bound.

    'yMax', falling back to upper, hi, ciUpper or high.