Based on algorithm from Bruls, Huizing, van Wijk, "Squarified Treemaps", but implements it differently. The function returns a list of dicts (i.e., JSON objects), each one a rectangle with coordinates ...
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADnCAYAAAC9roUQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy ...