MAIDR Documentation - v3.65.0
    Preparing search index...

    Type Alias MaidrD3Props

    MaidrD3Props: D3AdapterSpec & {
        svgRef: RefObject<SVGElement | null>;
        deps?: React.DependencyList;
        onError?: (error: Error) => void;
        children: ReactNode;
    }

    Props for the MaidrD3 wrapper component.

    The chartType field is a discriminator that narrows config to the correct binder-specific type at the call site.

    Type Declaration

    • svgRef: RefObject<SVGElement | null>

      Ref to the SVG element that D3 draws into. The same ref must be attached to the <svg> inside children so the binder can read it.

    • Optionaldeps?: React.DependencyList

      React dependency list that triggers re-binding. Include anything that changes the D3 chart's data or DOM. Defaults to [] (bind once).

    • OptionalonError?: (error: Error) => void

      Optional callback invoked when the binder throws (e.g. the selector matched no elements, or the SVG was not yet drawn). Fires once per failed bind. The error is also logged via console.error regardless. When the next bind succeeds, the callback is not invoked — consumers tracking error UI should clear it on their own (e.g. via the dependency that triggers re-binding).

    • children: ReactNode

      The rendered SVG (and any siblings) to make accessible.