Graflume · Alpha

Distribution · Extreme-environment application

Compare raw samples through univariate or bivariate density, summary statistics, and theoretical curves. Combine container size, input method, display capability, and user preference instead of guessing a device name. Compare mobile, watch, e-paper, monochrome, dot-matrix, and standards-based extreme environments on the same chart.

Chart family · Default families

Distribution

Compare raw samples through univariate or bivariate density, summary statistics, and theoretical curves.

Quick API
distribution()
Browser snapshot
graflume
mark
distribution
Presets
10

Extreme environments

Reconfigure for display, input, and device capability

Combine container size, input method, display capability, and user preference instead of guessing a device name. Compare mobile, watch, e-paper, monochrome, dot-matrix, and standards-based extreme environments on the same chart.

Fluid responsive

Reflow axes, legends, descriptions, and controls from the available container size.

960×540 · adaptive.profiles=responsive-fluid
  • zoom-reflow
  • shape-rectangle
  • display-color
  • input-fine
  • motion-full
  • renderer-canvas-spatial

Extreme environment preview

Choose a profile above to preserve the same data and ChartSpec while reconfiguring the chart for display size, input method, display capability, and user preference.

StatusLoading

  • adaptive
  • capability-driven
  • no-user-agent-branching
  • Legend: legend · categories · series
  • Point and range highlights: highlights[] · datum · value
  • Custom callouts: annotations[] · datum · value · callout · placement:auto
  • Interactive selection: selection · multiple · toggle
Graflume.distribution() Canvas 2D
Control help

Zoom and pan inspect the rendered surface without changing data axes or values. When playback controls are available, they move through real steps in the order each unique value first appears in the source data.

Use Tab to reach a control and Enter or Space to activate it. With the chart focused, use plus and minus to zoom and arrow keys to pan.

Auto placement compares perimeter candidates and avoids the plot, legend, and other callouts when possible. Explicit placement is preserved with only necessary safety correction. Callout text wraps safely inside the bubble. Long unbroken tokens are visually shortened within the line budget, while the complete source text remains available to assistive technology.

Loading

Browser API · Portable schema

Browser API

Graflume.distribution()

const data = [
  {
    "sample": "Seoul · baseline · W1",
    "series": "Before launch",
    "value": 44.8,
    "weight": 1
  },
  {
    "sample": "Tokyo · baseline · W1",
    "series": "Before launch",
    "value": 48.609,
    "weight": 1.25
  },
  {
    "sample": "Singapore · baseline · W1",
    "series": "Before launch",
    "value": 51.351,
    "weight": 1.5
  },
  {
    "sample": "Paris · baseline · W1",
    "series": "Before launch",
    "value": 52.38,
    "weight": 1.75
  },
  {
    "sample": "New York · baseline · W1",
    "series": "Before launch",
    "value": 51.584,
    "weight": 1
  },
  {
    "sample": "Sydney · baseline · W1",
    "series": "Before launch",
    "value": 49.421,
    "weight": 1.25
  },
  {
    "sample": "Seoul · baseline · W2",
    "series": "Before launch",
    "value": 46.777,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · baseline · W2",
    "series": "Before launch",
    "value": 38.377,
    "weight": 1.75
  },
  {
    "sample": "Singapore · baseline · W2",
    "series": "Before launch",
    "value": 37.656,
    "weight": 1
  },
  {
    "sample": "Paris · baseline · W2",
    "series": "Before launch",
    "value": 38.692,
    "weight": 1.25
  },
  {
    "sample": "New York · baseline · W2",
    "series": "Before launch",
    "value": 41.286,
    "weight": 1.5
  },
  {
    "sample": "Sydney · baseline · W2",
    "series": "Before launch",
    "value": 44.733,
    "weight": 1.75
  },
  {
    "sample": "Seoul · baseline · W3",
    "series": "Before launch",
    "value": 48.059,
    "weight": 1
  },
  {
    "sample": "Tokyo · baseline · W3",
    "series": "Before launch",
    "value": 50.344,
    "weight": 1.25
  },
  {
    "sample": "Singapore · baseline · W3",
    "series": "Before launch",
    "value": 44.729,
    "weight": 1.5
  },
  {
    "sample": "Paris · baseline · W3",
    "series": "Before launch",
    "value": 43.798,
    "weight": 1.75
  },
  {
    "sample": "New York · baseline · W3",
    "series": "Before launch",
    "value": 41.794,
    "weight": 1
  },
  {
    "sample": "Sydney · baseline · W3",
    "series": "Before launch",
    "value": 39.634,
    "weight": 1.25
  },
  {
    "sample": "Seoul · baseline · W4",
    "series": "Before launch",
    "value": 38.32,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · baseline · W4",
    "series": "Before launch",
    "value": 38.603,
    "weight": 1.75
  },
  {
    "sample": "Singapore · baseline · W4",
    "series": "Before launch",
    "value": 40.742,
    "weight": 1
  },
  {
    "sample": "Paris · baseline · W4",
    "series": "Before launch",
    "value": 38.114,
    "weight": 1.25
  },
  {
    "sample": "New York · baseline · W4",
    "series": "Before launch",
    "value": 42.518,
    "weight": 1.5
  },
  {
    "sample": "Sydney · baseline · W4",
    "series": "Before launch",
    "value": 46.633,
    "weight": 1.75
  },
  {
    "sample": "Seoul · baseline · W5",
    "series": "Before launch",
    "value": 49.548,
    "weight": 1
  },
  {
    "sample": "Tokyo · baseline · W5",
    "series": "Before launch",
    "value": 50.754,
    "weight": 1.25
  },
  {
    "sample": "Singapore · baseline · W5",
    "series": "Before launch",
    "value": 50.304,
    "weight": 1.5
  },
  {
    "sample": "Paris · baseline · W5",
    "series": "Before launch",
    "value": 48.795,
    "weight": 1.75
  },
  {
    "sample": "New York · baseline · W5",
    "series": "Before launch",
    "value": 40.859,
    "weight": 1
  },
  {
    "sample": "Sydney · baseline · W5",
    "series": "Before launch",
    "value": 40.062,
    "weight": 1.25
  },
  {
    "sample": "Seoul · baseline · W6",
    "series": "Before launch",
    "value": 40.777,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · baseline · W6",
    "series": "Before launch",
    "value": 43.161,
    "weight": 1.75
  },
  {
    "sample": "Singapore · baseline · W6",
    "series": "Before launch",
    "value": 46.801,
    "weight": 1
  },
  {
    "sample": "Paris · baseline · W6",
    "series": "Before launch",
    "value": 50.846,
    "weight": 1.25
  },
  {
    "sample": "New York · baseline · W6",
    "series": "Before launch",
    "value": 54.285,
    "weight": 1.5
  },
  {
    "sample": "Sydney · baseline · W6",
    "series": "Before launch",
    "value": 49.975,
    "weight": 1.75
  },
  {
    "sample": "Seoul · post-launch · W1",
    "series": "After launch",
    "value": 55.8,
    "weight": 1
  },
  {
    "sample": "Tokyo · post-launch · W1",
    "series": "After launch",
    "value": 59.609,
    "weight": 1.25
  },
  {
    "sample": "Singapore · post-launch · W1",
    "series": "After launch",
    "value": 62.351,
    "weight": 1.5
  },
  {
    "sample": "Paris · post-launch · W1",
    "series": "After launch",
    "value": 63.38,
    "weight": 1.75
  },
  {
    "sample": "New York · post-launch · W1",
    "series": "After launch",
    "value": 62.584,
    "weight": 1
  },
  {
    "sample": "Sydney · post-launch · W1",
    "series": "After launch",
    "value": 60.421,
    "weight": 1.25
  },
  {
    "sample": "Seoul · post-launch · W2",
    "series": "After launch",
    "value": 57.777,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · post-launch · W2",
    "series": "After launch",
    "value": 49.377,
    "weight": 1.75
  },
  {
    "sample": "Singapore · post-launch · W2",
    "series": "After launch",
    "value": 48.656,
    "weight": 1
  },
  {
    "sample": "Paris · post-launch · W2",
    "series": "After launch",
    "value": 49.692,
    "weight": 1.25
  },
  {
    "sample": "New York · post-launch · W2",
    "series": "After launch",
    "value": 52.286,
    "weight": 1.5
  },
  {
    "sample": "Sydney · post-launch · W2",
    "series": "After launch",
    "value": 55.733,
    "weight": 1.75
  },
  {
    "sample": "Seoul · post-launch · W3",
    "series": "After launch",
    "value": 59.059,
    "weight": 1
  },
  {
    "sample": "Tokyo · post-launch · W3",
    "series": "After launch",
    "value": 61.344,
    "weight": 1.25
  },
  {
    "sample": "Singapore · post-launch · W3",
    "series": "After launch",
    "value": 55.729,
    "weight": 1.5
  },
  {
    "sample": "Paris · post-launch · W3",
    "series": "After launch",
    "value": 54.798,
    "weight": 1.75
  },
  {
    "sample": "New York · post-launch · W3",
    "series": "After launch",
    "value": 52.794,
    "weight": 1
  },
  {
    "sample": "Sydney · post-launch · W3",
    "series": "After launch",
    "value": 50.634,
    "weight": 1.25
  },
  {
    "sample": "Seoul · post-launch · W4",
    "series": "After launch",
    "value": 49.32,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · post-launch · W4",
    "series": "After launch",
    "value": 49.603,
    "weight": 1.75
  },
  {
    "sample": "Singapore · post-launch · W4",
    "series": "After launch",
    "value": 51.742,
    "weight": 1
  },
  {
    "sample": "Paris · post-launch · W4",
    "series": "After launch",
    "value": 49.114,
    "weight": 1.25
  },
  {
    "sample": "New York · post-launch · W4",
    "series": "After launch",
    "value": 53.518,
    "weight": 1.5
  },
  {
    "sample": "Sydney · post-launch · W4",
    "series": "After launch",
    "value": 57.633,
    "weight": 1.75
  },
  {
    "sample": "Seoul · post-launch · W5",
    "series": "After launch",
    "value": 60.548,
    "weight": 1
  },
  {
    "sample": "Tokyo · post-launch · W5",
    "series": "After launch",
    "value": 61.754,
    "weight": 1.25
  },
  {
    "sample": "Singapore · post-launch · W5",
    "series": "After launch",
    "value": 61.304,
    "weight": 1.5
  },
  {
    "sample": "Paris · post-launch · W5",
    "series": "After launch",
    "value": 59.795,
    "weight": 1.75
  },
  {
    "sample": "New York · post-launch · W5",
    "series": "After launch",
    "value": 51.859,
    "weight": 1
  },
  {
    "sample": "Sydney · post-launch · W5",
    "series": "After launch",
    "value": 51.062,
    "weight": 1.25
  },
  {
    "sample": "Seoul · post-launch · W6",
    "series": "After launch",
    "value": 51.777,
    "weight": 1.5
  },
  {
    "sample": "Tokyo · post-launch · W6",
    "series": "After launch",
    "value": 54.161,
    "weight": 1.75
  },
  {
    "sample": "Singapore · post-launch · W6",
    "series": "After launch",
    "value": 57.801,
    "weight": 1
  },
  {
    "sample": "Paris · post-launch · W6",
    "series": "After launch",
    "value": 61.846,
    "weight": 1.25
  },
  {
    "sample": "New York · post-launch · W6",
    "series": "After launch",
    "value": 65.285,
    "weight": 1.5
  },
  {
    "sample": "Sydney · post-launch · W6",
    "series": "After launch",
    "value": 60.975,
    "weight": 1.75
  }
];

const options = {
  "accessibility": {
    "description": "Before-and-after cohorts reveal the shift, spread, and remaining overlap. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Distribution chart: Before-and-after cohorts reveal the shift, spread, and remaining overlap"
  },
  "annotations": [
    {
      "connector": {
        "visible": true
      },
      "detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
      "id": "manual-callout",
      "placement": "auto",
      "style": {
        "maxWidth": 220,
        "padding": 8
      },
      "target": {
        "field": "value",
        "type": "datum",
        "value": 55.8
      },
      "text": "Point and range highlights · 55.8"
    }
  ],
  "axes": {
    "x": {
      "format": {
        "type": "integer"
      },
      "ticks": {
        "spacing": 8,
        "values": [
          18,
          24,
          30,
          36,
          39
        ]
      }
    },
    "y": {
      "format": {
        "type": "integer"
      },
      "ticks": {
        "count": 5,
        "spacing": 8
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "value",
        "type": "datum",
        "value": 55.8
      }
    }
  ],
  "interaction": {
    "controls": {
      "annotations": true,
      "export": true,
      "fullscreen": true,
      "labels": {
        "controls": "Chart controls",
        "enterFullscreen": "Enter fullscreen",
        "exitFullscreen": "Exit fullscreen",
        "exportPng": "Download PNG",
        "hideAnnotations": "Hide callouts",
        "loop": "Loop playback",
        "nextFrame": "Next frame",
        "pause": "Pause",
        "play": "Play",
        "previousFrame": "Previous frame",
        "reset": "Reset view",
        "seek": "Playback position",
        "showAnnotations": "Show callouts",
        "speed": "Playback speed",
        "zoomIn": "Zoom in",
        "zoomOut": "Zoom out"
      },
      "playback": false,
      "reset": true,
      "zoom": true
    },
    "hover": true,
    "navigation": {
      "drag": true,
      "keyboard": true,
      "maxZoom": 6,
      "minZoom": 1,
      "pinch": true,
      "wheel": "modifier"
    },
    "selection": {
      "ariaLabel": "Interactive selection",
      "clearOnBackground": true,
      "clearOnEscape": true,
      "highlight": {
        "padding": 5
      },
      "key": "value",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "axis": "x",
      "fields": [
        {
          "field": "binStart",
          "format": "number",
          "label": "Bin start"
        },
        {
          "field": "binEnd",
          "format": "number",
          "label": "Bin end"
        },
        {
          "field": "count",
          "format": "integer",
          "label": "Count"
        },
        {
          "field": "proportion",
          "format": "percent",
          "fractionDigits": 1,
          "label": "Proportion"
        }
      ],
      "title": "Distribution",
      "trigger": "axis"
    }
  },
  "legend": {
    "field": "series",
    "interactive": false,
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "categories",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Series",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "fields": {
      "group": "series",
      "value": "value"
    },
    "options": {
      "mode": "histogram"
    }
  },
  "padding": {
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "Before-and-after cohorts reveal the shift, spread, and remaining overlap",
    "text": "Distribution chart"
  },
  "width": "container",
  "x": {
    "field": "value",
    "title": "Outcome score",
    "type": "quantitative"
  },
  "y": {
    "field": "value",
    "title": "Frequency",
    "type": "quantitative"
  }
};

Graflume.distribution('#chart', data, options);

Portable schema

ChartSpec 0.1 · options

{
  "accessibility": {
    "description": "Before-and-after cohorts reveal the shift, spread, and remaining overlap. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Distribution chart: Before-and-after cohorts reveal the shift, spread, and remaining overlap"
  },
  "annotations": [
    {
      "connector": {
        "visible": true
      },
      "detail": "Attach user-authored safe text to a datum, axis range, or normalized plot position.",
      "id": "manual-callout",
      "placement": "auto",
      "style": {
        "maxWidth": 220,
        "padding": 8
      },
      "target": {
        "field": "value",
        "type": "datum",
        "value": 55.8
      },
      "text": "Point and range highlights · 55.8"
    }
  ],
  "axes": {
    "x": {
      "format": {
        "type": "integer"
      },
      "ticks": {
        "spacing": 8,
        "values": [
          18,
          24,
          30,
          36,
          39
        ]
      }
    },
    "y": {
      "format": {
        "type": "integer"
      },
      "ticks": {
        "count": 5,
        "spacing": 8
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "value",
        "type": "datum",
        "value": 55.8
      }
    }
  ],
  "interaction": {
    "controls": {
      "annotations": true,
      "export": true,
      "fullscreen": true,
      "labels": {
        "controls": "Chart controls",
        "enterFullscreen": "Enter fullscreen",
        "exitFullscreen": "Exit fullscreen",
        "exportPng": "Download PNG",
        "hideAnnotations": "Hide callouts",
        "loop": "Loop playback",
        "nextFrame": "Next frame",
        "pause": "Pause",
        "play": "Play",
        "previousFrame": "Previous frame",
        "reset": "Reset view",
        "seek": "Playback position",
        "showAnnotations": "Show callouts",
        "speed": "Playback speed",
        "zoomIn": "Zoom in",
        "zoomOut": "Zoom out"
      },
      "playback": false,
      "reset": true,
      "zoom": true
    },
    "hover": true,
    "navigation": {
      "drag": true,
      "keyboard": true,
      "maxZoom": 6,
      "minZoom": 1,
      "pinch": true,
      "wheel": "modifier"
    },
    "selection": {
      "ariaLabel": "Interactive selection",
      "clearOnBackground": true,
      "clearOnEscape": true,
      "highlight": {
        "padding": 5
      },
      "key": "value",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "axis": "x",
      "fields": [
        {
          "field": "binStart",
          "format": "number",
          "label": "Bin start"
        },
        {
          "field": "binEnd",
          "format": "number",
          "label": "Bin end"
        },
        {
          "field": "count",
          "format": "integer",
          "label": "Count"
        },
        {
          "field": "proportion",
          "format": "percent",
          "fractionDigits": 1,
          "label": "Proportion"
        }
      ],
      "title": "Distribution",
      "trigger": "axis"
    }
  },
  "legend": {
    "field": "series",
    "interactive": false,
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "categories",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Series",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "fields": {
      "group": "series",
      "value": "value"
    },
    "options": {
      "mode": "histogram"
    }
  },
  "padding": {
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "Before-and-after cohorts reveal the shift, spread, and remaining overlap",
    "text": "Distribution chart"
  },
  "width": "container",
  "x": {
    "field": "value",
    "title": "Outcome score",
    "type": "quantitative"
  },
  "y": {
    "field": "value",
    "title": "Frequency",
    "type": "quantitative"
  }
}