code: def treemap(df, col, x, y, dx, dy, *, N=100):
      sub_df = df.nlargest(N, col)
      normed = normalize_sizes(sub_df[col], dx, dy)
      blocks = squarify(normed, x, y, dx, dy)
      blocks_df = pd.DataFrame.from_dict(blocks).set_index(sub_df.index)
      return sub_df.join(blocks_df, how="left").reset_index()
  
imports: import pandas
  from squarify import normalize_sizes, squarify
  from bokeh.plotting import figure, show
  from bokeh.sampledata.sample_superstore import data
  from bokeh.transform import factor_cmap
label_desc: Use image node_id 1 for calling a global function with example usage: treemap(df, col, x, y, dx, dy) and returns: sub_df