Minimal reproducible example

funkyheatmap in R

g <- funkyheatmap::funky_heatmap(
  data = data,
  column_info = column_info,
  column_groups = column_groups,
  row_info = row_info,
  row_groups = row_groups,
  palettes = palettes
)
ℹ Column info did not contain a column called 'legend', generating options based on the 'geom' column.
! Package `magick` is required to draw images. Skipping columns with geom == "image".
g

funkyheatmap-js in JavaScript

Transform R parameters to JS

js_palettes <- palettes
js_palettes$pie <- list(colors = unname(js_palettes$pie), names = names(js_palettes$pie))

column_info <- column_info %>%
    filter(is.na(overlay) | overlay != TRUE) %>%
    mutate(label = case_when(
        name == "Rect 1" ~ "numerical1_str",
        name == "Rect 2" ~ "numerical2_str",
        name == "Rect 3" ~ "numerical3_str"
    ))

ojs_define(
  funky_heatmap_args = list(
    data = data,
    column_info = column_info,
    column_groups = column_groups,
    row_info = row_info,
    row_groups = row_groups,
    palettes = js_palettes
  )
)
funkyheatmap(
  funky_heatmap_args.data,
  funky_heatmap_args.column_info,
  funky_heatmap_args.row_info,
  funky_heatmap_args.column_groups,
  funky_heatmap_args.row_groups,
  funky_heatmap_args.palettes,
  {
    fontSize: 14,
    rowHeight: 26,
    rootStyle: 'max-width: none',
    colorByRank: color_by_rank,
    theme: {
        oddRowBackground: 'white',
        evenRowBackground: '#ddd',
        textColor: 'black',
        strokeColor: 'black',
        headerColor: 'black',
        hoverColor: 'blue'
    }
  }
);

funkyheatmappy in Python

# TODO: remove workaround
column_info.index = column_info["id"]
column_info["name"] = [ "" if not isinstance(name, str) else name for name in column_info["name"] ]
row_info.index = row_info["id"]

# TODO: remove another workaround
column_info = column_info[column_info["geom"] != "image"]
column_groups = column_groups[column_groups["group"] != "image"]

funky_heatmap(
  data=data,
  column_info=column_info,
  column_groups=column_groups,
  row_info=row_info,
  row_groups=row_groups,
  palettes=palettes,
)