Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Faceting / Small Multiples

Combine multiple charts into a grid layout — one call instead of manually composing HTML.

Python

import seraplot as sp

charts = [sp.bar([1,2,3], ["a","b","c"], title=region) for region in ["EU","US","APAC"]]
grid = sp.facet(charts, cols=3, gap=12, cell_height=400)
grid.save("regions.html")

JavaScript

import { buildGrid } from "seraplot";
const html = buildGrid(JSON.stringify({ charts: [chart1Html, chart2Html], cols: 2 }));

Parameters

NameTypeDefaultDescription
chartslist[Chart]requiredCharts to lay out
colsint2Columns per row
gapint16Gap in pixels
bgstrNoneBackground color
cell_heightint520Per-cell height

Combine plusieurs charts dans une grille — un seul appel au lieu de composer le HTML manuellement.

Python

import seraplot as sp

charts = [sp.bar([1,2,3], ["a","b","c"], title=region) for region in ["EU","US","APAC"]]
grid = sp.facet(charts, cols=3, gap=12, cell_height=400)
grid.save("regions.html")

JavaScript

import { buildGrid } from "seraplot";
const html = buildGrid(JSON.stringify({ charts: [chart1Html, chart2Html], cols: 2 }));

Paramètres

NomTypeDéfautDescription
chartslist[Chart]requisCharts à disposer
colsint2Colonnes par ligne
gapint16Espacement en pixels
bgstrNoneCouleur de fond
cell_heightint520Hauteur par cellule