memtab_visualizers.treemap_report module

Treemap Report for Memory Table Visualizers

This module generates an interactive treemap visualization of Flash memory usage.

The treemap organizes memory items hierarchically: - Top level: Categories (major code divisions) - Middle level: Subcategories (logical groupings within categories) - Lower levels: Files and individual symbols

Memory size calculation: - Flash usage is calculated at every level of the hierarchy - Category totals are sums of all contained subcategories - Subcategory totals are sums of all contained files - File totals are sums of all contained symbols within that category/subcategory context

Important: File sizes are calculated within their category/subcategory context. If a file contains symbols that span multiple categories, the file size shown within each category reflects only the symbols from that specific category, not the total file size across all categories.

Note

If the assigned_size is less than or equal to the size, the assigned_size parameter is used. Otherwise, the size parameter is used.

The visualization specifically targets Flash memory regions only, excluding RAM and other memory types. Size values are displayed in bytes at each level of the hierarchy to provide immediate insight into memory consumption patterns.

The output is an interactive HTML file that allows drilling down into memory usage details.

class memtab_visualizers.treemap_report.TreemapReport

Bases: object

A Treemap Report

generate_report(memtab, filename)

This function generates a treemap visualization of the ROM items by category, subcategory, and filename. It uses the Plotly library to create the treemap and saves it as an HTML file. The treemap provides a visual representation of the memory usage by different categories and subcategories. The function first filters the data to include only items with “region”: “ROM”. It then groups the data by category, subcategory, and filename or symbol, and calculates the size of each item.

Return type:

None

Args:

response (DataFrame): _description_ html (str): the filename

report_name = 'treemap'