Learn R Programming

ggsketch (version 2.0.0)

treemap_layout: Squarified treemap layout

Description

Lays out one rectangle per value inside the box [x, x + width] x [y, y + height], with area proportional to the value and aspect ratios kept close to 1. Returns rectangles in the original input order.

Usage

treemap_layout(values, x = 0, y = 0, width = 1, height = 1)

Value

A data frame with columns xmin, xmax, ymin, ymax, one row per input value, in input order.

Arguments

values

Non-negative numeric vector (one per tile). Zero / negative values produce zero-area tiles.

x, y

Lower-left corner of the bounding box. Default 0.

width, height

Bounding box size. Default 1.

See Also

Other sketch-core: arrowhead(), curve_fill(), engrave_fill(), engrave_ladder(), hachure_fill(), hachure_fill_multi(), leader_path(), repel_layout(), rough_arc(), rough_bezier(), rough_ellipse(), roughen_polyline(), sketch_arrowheads(), sketch_fill(), sketch_fill_multi(), spray_scatter(), stroke_profile(), stroke_ribbon(), wash_bleed(), watercolor_wash(), watercolor_wash_multi()

Examples

Run this code
treemap_layout(c(6, 3, 2, 1))

Run the code above in your browser using DataLab