basic_report.heatmap module

class basic_report.heatmap.CalendarColor(domain, scheme='Blues', range=None, interpolate=None, type='linear')[source]

Bases: object

Define the calendar color scheme

See https://cal-heatmap.com/docs/options/scale for all options and what they mean

Parameters:
  • domain (list[float])

  • scheme (Literal['YlOrRd', 'Blues', 'Greens', 'Greys', 'Oranges', 'Reds', 'Purples', 'Turbo', 'Viridis', 'Inferno', 'Magma', 'Plasma', 'Cividis', 'Warm', 'Cool', 'Cubehelix', 'BuPu', 'GnBu', 'OrRd', 'PuBuGn', 'PuBu', 'PuRd', 'RdPu', 'YlGnBu', 'YlGn', 'YlOrBr', 'BrBG', 'PRGn', 'PiYG', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'Rainbow', 'Sinebow', None])

  • range (list[str] | None)

  • interpolate (Literal['rgb', 'hsl', 'lab', 'hcl', None])

  • type (Literal['ordinal', 'linear', 'pow', 'sqrt', 'log', 'symlog', 'categorical', 'sequential', 'cyclical', 'threshold', 'quantile', 'quantize', 'diverging', 'diverging-log', 'diverging-pow', 'diverging-sqrt', 'diverging-symlog'])

domain: list[float]
interpolate: Literal['rgb', 'hsl', 'lab', 'hcl', None] = None
range: list[str] | None = None
scheme: Literal['YlOrRd', 'Blues', 'Greens', 'Greys', 'Oranges', 'Reds', 'Purples', 'Turbo', 'Viridis', 'Inferno', 'Magma', 'Plasma', 'Cividis', 'Warm', 'Cool', 'Cubehelix', 'BuPu', 'GnBu', 'OrRd', 'PuBuGn', 'PuBu', 'PuRd', 'RdPu', 'YlGnBu', 'YlGn', 'YlOrBr', 'BrBG', 'PRGn', 'PiYG', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'Rainbow', 'Sinebow', None] = 'Blues'
type: Literal['ordinal', 'linear', 'pow', 'sqrt', 'log', 'symlog', 'categorical', 'sequential', 'cyclical', 'threshold', 'quantile', 'quantize', 'diverging', 'diverging-log', 'diverging-pow', 'diverging-sqrt', 'diverging-symlog'] = 'linear'
class basic_report.heatmap.CalendarData(x, y, type='date')[source]

Bases: object

The actual calendar data to be displayed

Parameters:
  • x (list[str])

  • y (list[float])

  • type (Literal['date', 'timestamp'])

get_table()[source]

Return the dataset as a 2d list

type: Literal['date', 'timestamp'] = 'date'
x: list[str]
y: list[float]
class basic_report.heatmap.CalendarDate(start='2026-04-16', min=None, max=None, highlight=None, weekstart=1, timezone='Europe/Berlin')[source]

Bases: object

Define the calendar dates

See https://cal-heatmap.com/docs/options/date for all options and what they mean

Parameters:
  • start (str)

  • min (str | None)

  • max (str | None)

  • highlight (list[str] | None)

  • weekstart (int)

  • timezone (str)

highlight: list[str] | None = None
max: str | None = None
min: str | None = None
start: str = '2026-04-16'
timezone: str = 'Europe/Berlin'
weekstart: int = 1
class basic_report.heatmap.CalendarDomain(type='month', gutter=4, padding=<factory>, dynamic_dimensions=False, sort='asc')[source]

Bases: object

Define the calendar domain

See https://cal-heatmap.com/docs/options/domain for all options and what they mean

Parameters:
  • type (Literal['hour', 'day', 'week', 'month', 'year'])

  • gutter (int)

  • padding (list[int])

  • dynamic_dimensions (bool)

  • sort (Literal['asc', 'desc'])

dynamic_dimensions: bool = False
gutter: int = 4
padding: list[int]
sort: Literal['asc', 'desc'] = 'asc'
type: Literal['hour', 'day', 'week', 'month', 'year'] = 'month'
class basic_report.heatmap.CalendarHeatmap(misc, domain, label, subdomain, date, color)[source]

Bases: object

A calendar heatmap to display in the report

Parameters:
color: CalendarColor
data: CalendarData | None
date: CalendarDate
domain: CalendarDomain
classmethod from_config_file(cfg_file)[source]

Load a heatmap from a config file

Parameters:

cfg_file (str | Path) – The path to the config file

label: CalendarLabel
make_button_div(direction)[source]

Make the previous/next button div

Parameters:

direction (str)

make_css()[source]

Create the CSS file for the heatmap

make_heatmap()[source]

Create the actual heatmap html

make_heatmap_div()[source]

Make the heatmap div section

make_heatmap_script()[source]

Make the heatmap html script section

make_legend_div()[source]

Make the heatmap html legend section

misc: CalendarMisc
set_color_range(rng)[source]

Set the color range of the heatmap

Parameters:

rng (list[float])

set_data(x, y, data_type='date')[source]

Update the data to be plotted in the heatmap

Parameters:
  • x (list[str])

  • y (list[str])

  • data_type (str)

subdomain: CalendarSubDomain
class basic_report.heatmap.CalendarLabel(text=None, position='bottom', align='middle', offset=<factory>, rotate=None, width=100, height=100, font_size=16, font_weight=450)[source]

Bases: object

Define the calendar label

See https://cal-heatmap.com/docs/options/domain/label for all options and what they mean

Parameters:
  • text (Literal['YY', 'YYYY', 'M', 'MM', 'MMM', 'MMMM', 'D', 'DD', 'd', 'dd', 'ddd', 'dddd', 'H', 'HH', 'h', 'hh', None] | None)

  • position (Literal['top', 'right', 'bottom', 'left'])

  • align (Literal['start', 'middle', 'end'])

  • offset (list[int])

  • rotate (Literal['left', 'right', None])

  • width (int)

  • height (int)

  • font_size (int)

  • font_weight (int)

align: Literal['start', 'middle', 'end'] = 'middle'
font_size: int = 16
font_weight: int = 450
height: int = 100
offset: list[int]
position: Literal['top', 'right', 'bottom', 'left'] = 'bottom'
rotate: Literal['left', 'right', None] = None
text: Literal['YY', 'YYYY', 'M', 'MM', 'MMM', 'MMMM', 'D', 'DD', 'd', 'dd', 'ddd', 'dddd', 'H', 'HH', 'h', 'hh', None] | None = None
width: int = 100
class basic_report.heatmap.CalendarMisc(id='hm-d5c0a077-4386-4c7d-9db8-331333a9c0e1', range=12, animation_duration=200, vertical_orientation=False, tooltip_enabled=True, tooltip_function='predefined:date+value', tooltip_precision=None, legend_width=300, legend_label=None, legend_font_size=14, legend_font_weight=450)[source]

Bases: object

Define the calendar miscellaneous configuration

See https://cal-heatmap.com/docs/options for all options and what they mean

Parameters:
  • id (str)

  • range (int)

  • animation_duration (int)

  • vertical_orientation (bool)

  • tooltip_enabled (bool)

  • tooltip_function (str)

  • tooltip_precision (int | None)

  • legend_width (int)

  • legend_label (str | None)

  • legend_font_size (int)

  • legend_font_weight (int)

animation_duration: int = 200
id: str = 'hm-d5c0a077-4386-4c7d-9db8-331333a9c0e1'
legend_font_size: int = 14
legend_font_weight: int = 450
legend_label: str | None = None
legend_width: int = 300
range: int = 12
tooltip_enabled: bool = True
tooltip_function: str = 'predefined:date+value'
tooltip_precision: int | None = None
vertical_orientation: bool = False
class basic_report.heatmap.CalendarSubDomain(type='day', gutter=2, width=10, height=10, radius=0, sort='asc', label=None, font_size=14, font_weight=450, background_color='#ededed')[source]

Bases: object

Define the calendar sub domain

See https://cal-heatmap.com/docs/options/subDomainfor all options and what they mean

Parameters:
  • type (Literal['minute', 'hour', 'day', 'week', 'month', 'xDay', 'ghDay'])

  • gutter (int)

  • width (int)

  • height (int)

  • radius (int)

  • sort (Literal['asc', 'desc'])

  • label (Literal['M', 'MM', 'MMM', 'MMMM', 'D', 'DD', 'd', 'dd', 'ddd', 'dddd', 'H', 'HH', 'h', 'hh', 'm', 'mm', None])

  • font_size (int)

  • font_weight (int)

  • background_color (str)

background_color: str = '#ededed'
font_size: int = 14
font_weight: int = 450
gutter: int = 2
height: int = 10
label: Literal['M', 'MM', 'MMM', 'MMMM', 'D', 'DD', 'd', 'dd', 'ddd', 'dddd', 'H', 'HH', 'h', 'hh', 'm', 'mm', None] = None
radius: int = 0
sort: Literal['asc', 'desc'] = 'asc'
type: Literal['minute', 'hour', 'day', 'week', 'month', 'xDay', 'ghDay'] = 'day'
width: int = 10