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

    Function resolveOrientation

    • Resolves the orientation a trace is actually navigated by.

      Mirrors what the trace constructors do — layer.orientation ?? VERTICAL — so the announcement matches the model's behaviour rather than the presence of a key in the JSON. A bar chart whose layer omits orientation is navigated as a vertical bar chart, so it is announced as one.

      traceType is a plain string rather than a TraceType: the pre-activation builder in maidr-component.tsx reads it straight off the JSON, where an absent or unknown type is possible, and an unknown type simply has no orientation.

      Parameters

      • traceType: string

        The layer's type, as declared in the MAIDR JSON

      • Optionaldeclared: Orientation

        The layer's orientation, when the JSON declares one

      Returns Orientation | undefined

      The effective orientation, or undefined for types that have none