#pragma once // Squarified treemap (Bruls, Huijbrechts, van Wijk 2000). // // Layout puro (treemap_layout) separado del render (treemap) — la layout // no toca ImGui y es testeable. #include "imgui.h" #include #include struct TreemapItem { std::string label; float value; ImU32 color; }; struct TreemapRect { ImVec2 min; ImVec2 max; const TreemapItem* item; }; // Layout puro. Devuelve un rect por item con coords absolutas dentro de [0,0]-region. // Items con value <= 0 se ignoran. std::vector treemap_layout(const std::vector& items, ImVec2 region); // Render. Si size.x <= 0 usa el ancho disponible. Reserva size en el layout ImGui. void treemap(const char* id, const std::vector& items, ImVec2 size = ImVec2(-1.0f, 300.0f));