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

    Interface D3ContourConfig

    Configuration for binding a D3 contour plot.

    d3.contours() and d3.contourDensity() emit one GeoJSON MultiPolygon per threshold, carrying the threshold as .value, so selector matches one <path> per level and the layer's rows are the levels.

    The coordinates are not in data space. d3.contours() emits grid indices and d3.contourDensity() emits pixels, so x and y are the transforms back onto the axes — x: i => x0 + i * dx for the former, x: px => xScale.invert(px) for the latter. Left out, the chart announces its positions in grid cells or screen pixels.

    A level drawn as several disjoint rings is flattened into one curve, in the order the rings appear, since a row of the payload is a single polyline. Every point announced is a real point of the level; what a reader cannot hear is the jump from the end of one ring to the start of the next.

    interface D3ContourConfig {
        id?: string;
        title?: string;
        subtitle?: string;
        caption?: string;
        axes?: { x?: D3AxisInput; y?: D3AxisInput; fill?: D3AxisInput };
        format?: AxisFormat;
        autoApply?: boolean;
        selector: string;
        level?: DataAccessor<number>;
        coordinates?: DataAccessor<unknown>;
        x?: D3GridTransform;
        y?: D3GridTransform;
    }

    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 level paths (e.g. 'path.contour'). One per level.

    level?: DataAccessor<number>

    Accessor for the level's value.

    'value', falling back to level, threshold or z.

    coordinates?: DataAccessor<unknown>

    Accessor for the GeoJSON rings.

    'coordinates'.
    

    Maps a grid x onto the x axis.

    identity.
    

    Maps a grid y onto the y axis.

    identity.