MAIDR JavaScript API
    Preparing search index...

    Type Alias VictoryLayerData

    VictoryLayerData:
        | { kind: "bar"; points: BarPoint[] }
        | { kind: "line"; points: LinePoint[][]; stepDirection?: StepDirection }
        | { kind: "area"; points: LinePoint[][] }
        | { kind: "stackedArea"; points: LinePoint[][]; normalized: boolean }
        | { kind: "polarArea"; points: LinePoint[][] }
        | { kind: "scatter"; points: ScatterPoint[] }
        | { kind: "dot"; points: BarPoint[] }
        | { kind: "errorBar"; points: ErrorBarPoint[] }
        | { kind: "waterfall"; points: WaterfallPoint[] }
        | { kind: "box"; points: BoxPoint[] }
        | { kind: "candlestick"; points: CandlestickPoint[] }
        | { kind: "histogram"; points: HistogramPoint[] }
        | { kind: "pie"; points: PiePoint[] }
        | { kind: "segmented"; points: SegmentedPoint[][] }
        | { kind: "dodged"; points: SegmentedPoint[][] }
        | { kind: "diverging"; points: SegmentedPoint[][] }

    Discriminated union of all supported layer data shapes.

    Using a discriminated union instead of unknown ensures that each layer's data is validated at extraction time and carries the correct type through to the MAIDR schema conversion.

    Type Declaration

    • { kind: "bar"; points: BarPoint[] }
    • { kind: "line"; points: LinePoint[][]; stepDirection?: StepDirection }

      A VictoryLine. stepDirection is set when its interpolation draws a staircase, making the layer a step rather than a line.

    • { kind: "area"; points: LinePoint[][] }

      A VictoryArea — a line whose region down to the baseline is filled. The fill is what the chart is called rather than a second magnitude, so the payload is a line's.

    • { kind: "stackedArea"; points: LinePoint[][]; normalized: boolean }

      A VictoryStack of VictoryArea children, one row per band. Each band carries its own untransformed value; the running total is the trace's to compute. normalized marks a stack whose columns are shares of a common whole.

    • { kind: "polarArea"; points: LinePoint[][] }

      A VictoryBar drawn polar — values as wedges around a circle.

    • { kind: "scatter"; points: ScatterPoint[] }
    • { kind: "dot"; points: BarPoint[] }

      A VictoryScatter whose x values name categories — a Cleveland dot plot. One magnitude per category is what a reader navigates, so the payload is a bar's rather than a scatter's.

    • { kind: "errorBar"; points: ErrorBarPoint[] }

      A VictoryErrorBar, with Victory's error deltas resolved to bounds.

    • { kind: "waterfall"; points: WaterfallPoint[] }

      A VictoryBar whose bars float between a per-datum y0 and y.

    • { kind: "box"; points: BoxPoint[] }
    • { kind: "candlestick"; points: CandlestickPoint[] }
    • { kind: "histogram"; points: HistogramPoint[] }
    • { kind: "pie"; points: PiePoint[] }

      A VictoryPie (or a doughnut — the same component with an innerRadius).

    • { kind: "segmented"; points: SegmentedPoint[][] }
    • { kind: "dodged"; points: SegmentedPoint[][] }

      A VictoryGroup of VictoryBar children -- the grouped bar chart that is VictoryStack's direct counterpart, and that used to emit no layer at all because the walk never descended into the group (#1057).

      The same per-series points a stack carries: what differs is that the bars sit side by side rather than on one another, so nothing accumulates and the values are read as they are.

    • { kind: "diverging"; points: SegmentedPoint[][] }

      A VictoryStack of two VictoryBar children signed against each other — a population pyramid. The values stay signed as the chart draws them, and the two sides are listed in the order Victory paints them.