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

    Interface MosaicPoint

    One cell of a mosaic (marimekko) plot.

    A mosaic is a stacked bar chart in which the bar widths also encode data -- typically each category's share of all observations. A reader given only the segment heights has half the table: the conditional proportions without the group sizes they were computed from, so a category of six people and one of six hundred read identically.

    interface MosaicPoint {
        x: string | number;
        y: string | number;
        z: string;
        width?: number;
        count?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Properties

    x: string | number
    y: string | number
    z: string
    width?: number

    The category's share of all observations, as a fraction of one -- the width its column is drawn at.

    Carried on every cell of the column rather than once per column, the way z is carried on every cell of a series: the grammar's unit is the point, and a producer emitting a flat list has nowhere else to put it.

    count?: number

    The cell's own count, when the producer has the contingency table.

    A mosaic is drawn from a two-way table, and the count is the number the table was built on. It is optional because a producer working from proportions alone genuinely does not have it, and inventing one by multiplying out a rounded share would put a number in the announcement that the data does not contain.