MAIDR Documentation - v4.4.0
    Preparing search index...
    • Binds a D3.js Kaplan-Meier survival curve to MAIDR, generating the accessible data representation.

      Point selector at the step paths — one per arm — exactly as with bindD3Line, and fill at whatever names the arm. Everything a survival figure adds is optional and read from the same data:

      • Censoring. Either the curve's samples carry a censored column, or the ticks are their own selection — set censoredSelector and the binder merges each tick into its arm by time.
      • The confidence band. yMin and yMax are announced alongside the estimate, which is the comparison a reader makes when two arms look separated.

      The trace derives median survival itself, so nothing here computes it.

      Parameters

      • svg: Element

        The SVG element containing the D3 survival curve.

      • config: D3SurvivalConfig

        Configuration specifying selectors and data accessors.

      Returns D3BinderResult

      A D3BinderResult with the MAIDR data and generated layer.

      Timing — call after D3 has rendered. Like every D3 binder, this reads each matched element's D3-bound __data__; calling it before .data().join() has run (or before the SVG is mounted) throws "No elements found for selector …".

      • MaidrD3
      • useD3Adapter
      const result = bindD3Survival(svgElement, {
      selector: 'path.km-curve',
      censoredSelector: 'line.censor-tick',
      title: 'Overall Survival',
      axes: { x: 'Months', y: 'Survival probability', fill: 'Arm' },
      x: 'time',
      y: 'surv',
      fill: 'arm',
      yMin: 'lower',
      yMax: 'upper',
      });