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

    Interface ChartJsTreemapValue

    One drawn rectangle of a chartjs-chart-treemap dataset.

    The plugin replaces dataset.data with these during chart.update(), one per rectangle it laid out — measured on chartjs-chart-treemap@4.2.0, they are the identical objects each element's $context.raw points at, so the dataset is read directly and no element walk is needed.

    The layout reorders: a two-row source listing France then Japan comes back Japan first, largest rectangle first. That is the order the chart draws in and so the order the nodes are emitted in.

    A flat tree carries only v, s and a numeric _data: no g, no l, no isLeaf. Those three fields arrive together, once groups is declared.

    interface ChartJsTreemapValue {
        x?: number;
        y?: number;
        w?: number;
        h?: number;
        v: number;
        s?: number;
        l?: number;
        g?: string;
        gs?: number;
        isLeaf?: boolean;
        _data?: unknown;
    }
    Index

    Properties

    Properties

    x?: number

    The rectangle, in pixels.

    y?: number
    w?: number
    h?: number
    v: number

    The node's magnitude: a leaf's own value, or a group's sum.

    s?: number

    The value the layout sized by, which sumKeys can separate from v.

    l?: number

    Its depth, 0 at the outermost declared group.

    g?: string

    Its name at that level — the value of groups[l] on its rows.

    gs?: number

    Its parent group's sum.

    isLeaf?: boolean

    Whether it sits at the deepest declared group, which is not the same as having no children in the source: measured with groups: ['continent'] over rows that also carry a country, Asia comes back isLeaf: true with two children. It says where the drawn hierarchy stops.

    _data?: unknown

    The plugin's own record for the node. For a grouped tree it is an object whose children are the source rows that fell under it; for a flat tree it is the source number itself.