{
  "name": "Parameters for treemaps in Python: squarify.plot and plotly.express.treemap",
  "description": "A side-by-side table of the main arguments of squarify.plot and plotly.express.treemap, what each controls, and any constraint the project documentation states. Compiled from the squarify README and the Plotly treemap documentation.",
  "page": "https://casrai.org/guides/treemap-in-python",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-14T07:03:31Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Parameter",
      "unit": "",
      "description": ""
    },
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "What it controls",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented constraint or note",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Parameter": "sizes",
      "Function": "squarify.plot",
      "What it controls": "Values that become rectangle areas",
      "Documented constraint or note": "Must be positive and sorted in descending order"
    },
    {
      "Parameter": "label",
      "Function": "squarify.plot",
      "What it controls": "Text drawn in each rectangle",
      "Documented constraint or note": "Optional; default None"
    },
    {
      "Parameter": "pad",
      "Function": "squarify.plot",
      "What it controls": "Gap between rectangles",
      "Documented constraint or note": "Default False"
    },
    {
      "Parameter": "bar_kwargs / text_kwargs",
      "Function": "squarify.plot",
      "What it controls": "Styling passed to Axes.bar / Axes.text",
      "Documented constraint or note": "Optional; default None"
    },
    {
      "Parameter": "path",
      "Function": "px.treemap",
      "What it controls": "Columns defining the hierarchy, root to leaves",
      "Documented constraint or note": "id and parent should not be provided when path is given"
    },
    {
      "Parameter": "values",
      "Function": "px.treemap",
      "What it controls": "Column that sets rectangle area",
      "Documented constraint or note": "Used with a path of columns"
    },
    {
      "Parameter": "color",
      "Function": "px.treemap",
      "What it controls": "Column that sets color",
      "Documented constraint or note": "Numeric: parent is value-weighted average of children; non-numeric: discrete"
    },
    {
      "Parameter": "names / parents",
      "Function": "px.treemap",
      "What it controls": "Explicit hierarchy as parallel lists",
      "Documented constraint or note": "A root has an empty-string parent"
    },
    {
      "Parameter": "labels",
      "Function": "go.Treemap",
      "What it controls": "Graph-object equivalent of names",
      "Documented constraint or note": "Used where px uses names"
    }
  ],
  "sources": [
    {
      "title": "squarify (GitHub README)",
      "url": "https://github.com/laserson/squarify",
      "accessed": "2026-11-14"
    },
    {
      "title": "Plotly: Treemap Charts in Python",
      "url": "https://plotly.com/python/treemaps/",
      "accessed": "2026-11-14"
    }
  ]
}