Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

558 B
Raw Blame
interface UmamiLayoutInput {
  width: number;
  height: number;
  displayMode: "compact" | "advanced";
}

export const getUmamiLayout = ({ width, height, displayMode }: UmamiLayoutInput) => {
  const isAdvanced = displayMode === "advanced";
  return {
    isDense: !isAdvanced && height < 120,
    showXAxis: isAdvanced || (width >= 220 && height >= 150),
    showSecondaryStats: isAdvanced || (width >= 220 && height >= 180),
    showDetailedStats: isAdvanced || (width >= 360 && height >= 240),
    stackAdvancedContent: isAdvanced && width < 900,
  };
};