Graflume · Alpha

Vector field · Extreme-environment application

Encode direction and magnitude at each coordinate with arrow angle and length. 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 · Specialized families

Vector field

Encode direction and magnitude at each coordinate with arrow angle and length.

Quick API
vectorField()
Browser snapshot
graflume/complete
mark
vector
Presets
2

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 · explicit · 1 channels
  • Point and range highlights: highlights[] · datum · direction
  • Custom callouts: annotations[] · datum · direction · callout · placement:auto
  • Interactive selection: selection · multiple · toggle
Graflume.vector() 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.vector()

const data = [
  {
    "direction": 310.267,
    "high": -1.7,
    "magnitude": 2.228,
    "value": 1.44,
    "x": -4,
    "y": -3
  },
  {
    "direction": 322.357,
    "high": -1.22,
    "magnitude": 1.998,
    "value": 1.582,
    "x": -3,
    "y": -3
  },
  {
    "direction": 335.932,
    "high": -0.74,
    "magnitude": 1.815,
    "value": 1.657,
    "x": -2,
    "y": -3
  },
  {
    "direction": 350.937,
    "high": -0.26,
    "magnitude": 1.651,
    "value": 1.63,
    "x": -1,
    "y": -3
  },
  {
    "direction": 8.269000000000005,
    "high": 0.22,
    "magnitude": 1.53,
    "value": 1.514,
    "x": 0,
    "y": -3
  },
  {
    "direction": 27.187000000000012,
    "high": 0.7,
    "magnitude": 1.532,
    "value": 1.363,
    "x": 1,
    "y": -3
  },
  {
    "direction": 43.389999999999986,
    "high": 1.18,
    "magnitude": 1.718,
    "value": 1.248,
    "x": 2,
    "y": -3
  },
  {
    "direction": 53.60000000000002,
    "high": 1.66,
    "magnitude": 2.062,
    "value": 1.224,
    "x": 3,
    "y": -3
  },
  {
    "direction": 58.69999999999999,
    "high": 2.14,
    "magnitude": 2.504,
    "value": 1.301,
    "x": 4,
    "y": -3
  },
  {
    "direction": 298.909,
    "high": -1.738,
    "magnitude": 1.986,
    "value": 0.96,
    "x": -4,
    "y": -2
  },
  {
    "direction": 311.202,
    "high": -1.258,
    "magnitude": 1.673,
    "value": 1.102,
    "x": -3,
    "y": -2
  },
  {
    "direction": 326.516,
    "high": -0.778,
    "magnitude": 1.411,
    "value": 1.177,
    "x": -2,
    "y": -2
  },
  {
    "direction": 345.451,
    "high": -0.298,
    "magnitude": 1.188,
    "value": 1.15,
    "x": -1,
    "y": -2
  },
  {
    "direction": 9.963000000000022,
    "high": 0.182,
    "magnitude": 1.05,
    "value": 1.034,
    "x": 0,
    "y": -2
  },
  {
    "direction": 36.84699999999998,
    "high": 0.662,
    "magnitude": 1.103,
    "value": 0.883,
    "x": 1,
    "y": -2
  },
  {
    "direction": 56.06,
    "high": 1.142,
    "magnitude": 1.376,
    "value": 0.768,
    "x": 2,
    "y": -2
  },
  {
    "direction": 65.358,
    "high": 1.622,
    "magnitude": 1.784,
    "value": 0.744,
    "x": 3,
    "y": -2
  },
  {
    "direction": 68.65899999999999,
    "high": 2.102,
    "magnitude": 2.256,
    "value": 0.821,
    "x": 4,
    "y": -2
  },
  {
    "direction": 284.619,
    "high": -1.84,
    "magnitude": 1.902,
    "value": 0.48,
    "x": -4,
    "y": -1
  },
  {
    "direction": 294.563,
    "high": -1.36,
    "magnitude": 1.496,
    "value": 0.622,
    "x": -3,
    "y": -1
  },
  {
    "direction": 308.364,
    "high": -0.88,
    "magnitude": 1.123,
    "value": 0.697,
    "x": -2,
    "y": -1
  },
  {
    "direction": 329.141,
    "high": -0.4,
    "magnitude": 0.78,
    "value": 0.67,
    "x": -1,
    "y": -1
  },
  {
    "direction": 8.192999999999984,
    "high": 0.08,
    "magnitude": 0.559,
    "value": 0.554,
    "x": 0,
    "y": -1
  },
  {
    "direction": 54.25799999999998,
    "high": 0.56,
    "magnitude": 0.69,
    "value": 0.403,
    "x": 1,
    "y": -1
  },
  {
    "direction": 74.50400000000002,
    "high": 1.04,
    "magnitude": 1.079,
    "value": 0.288,
    "x": 2,
    "y": -1
  },
  {
    "direction": 80.14999999999998,
    "high": 1.52,
    "magnitude": 1.542,
    "value": 0.264,
    "x": 3,
    "y": -1
  },
  {
    "direction": 80.31900000000002,
    "high": 2,
    "magnitude": 2.029,
    "value": 0.341,
    "x": 4,
    "y": -1
  },
  {
    "direction": 270,
    "high": -1.97,
    "magnitude": 1.97,
    "value": 0,
    "x": -4,
    "y": 0
  },
  {
    "direction": 275.434,
    "high": -1.49,
    "magnitude": 1.497,
    "value": 0.142,
    "x": -3,
    "y": 0
  },
  {
    "direction": 282.115,
    "high": -1.01,
    "magnitude": 1.033,
    "value": 0.217,
    "x": -2,
    "y": 0
  },
  {
    "direction": 289.714,
    "high": -0.53,
    "magnitude": 0.563,
    "value": 0.19,
    "x": -1,
    "y": 0
  },
  {
    "direction": 325.853,
    "high": -0.05,
    "magnitude": 0.089,
    "value": 0.074,
    "x": 0,
    "y": 0
  },
  {
    "direction": 100.17399999999998,
    "high": 0.43,
    "magnitude": 0.437,
    "value": -0.077,
    "x": 1,
    "y": 0
  },
  {
    "direction": 101.899,
    "high": 0.91,
    "magnitude": 0.93,
    "value": -0.192,
    "x": 2,
    "y": 0
  },
  {
    "direction": 98.83800000000002,
    "high": 1.39,
    "magnitude": 1.407,
    "value": -0.216,
    "x": 3,
    "y": 0
  },
  {
    "direction": 94.24700000000001,
    "high": 1.87,
    "magnitude": 1.875,
    "value": -0.139,
    "x": 4,
    "y": 0
  },
  {
    "direction": 257.019,
    "high": -2.082,
    "magnitude": 2.137,
    "value": -0.48,
    "x": -4,
    "y": 1
  },
  {
    "direction": 258.078,
    "high": -1.602,
    "magnitude": 1.638,
    "value": -0.338,
    "x": -3,
    "y": 1
  },
  {
    "direction": 256.801,
    "high": -1.122,
    "magnitude": 1.153,
    "value": -0.263,
    "x": -2,
    "y": 1
  },
  {
    "direction": 245.691,
    "high": -0.642,
    "magnitude": 0.705,
    "value": -0.29,
    "x": -1,
    "y": 1
  },
  {
    "direction": 201.766,
    "high": -0.162,
    "magnitude": 0.437,
    "value": -0.406,
    "x": 0,
    "y": 1
  },
  {
    "direction": 150.30200000000002,
    "high": 0.318,
    "magnitude": 0.641,
    "value": -0.557,
    "x": 1,
    "y": 1
  },
  {
    "direction": 130.098,
    "high": 0.798,
    "magnitude": 1.043,
    "value": -0.672,
    "x": 2,
    "y": 1
  },
  {
    "direction": 118.582,
    "high": 1.278,
    "magnitude": 1.455,
    "value": -0.696,
    "x": 3,
    "y": 1
  },
  {
    "direction": 109.39600000000002,
    "high": 1.758,
    "magnitude": 1.864,
    "value": -0.619,
    "x": 4,
    "y": 1
  },
  {
    "direction": 245.817,
    "high": -2.138,
    "magnitude": 2.343,
    "value": -0.96,
    "x": -4,
    "y": 2
  },
  {
    "direction": 243.73,
    "high": -1.658,
    "magnitude": 1.849,
    "value": -0.818,
    "x": -3,
    "y": 2
  },
  {
    "direction": 237.748,
    "high": -1.178,
    "magnitude": 1.393,
    "value": -0.743,
    "x": -2,
    "y": 2
  },
  {
    "direction": 222.18,
    "high": -0.698,
    "magnitude": 1.039,
    "value": -0.77,
    "x": -1,
    "y": 2
  },
  {
    "direction": 193.806,
    "high": -0.218,
    "magnitude": 0.913,
    "value": -0.886,
    "x": 0,
    "y": 2
  },
  {
    "direction": 165.813,
    "high": 0.262,
    "magnitude": 1.07,
    "value": -1.037,
    "x": 1,
    "y": 2
  },
  {
    "direction": 147.202,
    "high": 0.742,
    "magnitude": 1.37,
    "value": -1.152,
    "x": 2,
    "y": 2
  },
  {
    "direction": 133.89999999999998,
    "high": 1.222,
    "magnitude": 1.696,
    "value": -1.176,
    "x": 3,
    "y": 2
  },
  {
    "direction": 122.84500000000003,
    "high": 1.702,
    "magnitude": 2.026,
    "value": -1.099,
    "x": 4,
    "y": 2
  },
  {
    "direction": 235.78,
    "high": -2.117,
    "magnitude": 2.561,
    "value": -1.44,
    "x": -4,
    "y": 3
  },
  {
    "direction": 231.588,
    "high": -1.637,
    "magnitude": 2.09,
    "value": -1.298,
    "x": -3,
    "y": 3
  },
  {
    "direction": 223.414,
    "high": -1.157,
    "magnitude": 1.684,
    "value": -1.223,
    "x": -2,
    "y": 3
  },
  {
    "direction": 208.448,
    "high": -0.677,
    "magnitude": 1.422,
    "value": -1.25,
    "x": -1,
    "y": 3
  },
  {
    "direction": 188.216,
    "high": -0.197,
    "magnitude": 1.38,
    "value": -1.366,
    "x": 0,
    "y": 3
  },
  {
    "direction": 169.44399999999996,
    "high": 0.283,
    "magnitude": 1.543,
    "value": -1.517,
    "x": 1,
    "y": 3
  },
  {
    "direction": 154.94799999999998,
    "high": 0.763,
    "magnitude": 1.801,
    "value": -1.632,
    "x": 2,
    "y": 3
  },
  {
    "direction": 143.11700000000002,
    "high": 1.243,
    "magnitude": 2.071,
    "value": -1.656,
    "x": 3,
    "y": 3
  },
  {
    "direction": 132.505,
    "high": 1.723,
    "magnitude": 2.337,
    "value": -1.579,
    "x": 4,
    "y": 3
  }
];

const options = {
  "accessibility": {
    "description": "A balanced vortex keeps direction, magnitude, and the calm center visible. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Vector field chart: A balanced vortex keeps direction, magnitude, and the calm center visible"
  },
  "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": "direction",
        "type": "datum",
        "value": 325.853
      },
      "text": "Point and range highlights · 0"
    }
  ],
  "axes": {
    "x": {
      "format": {
        "fractionDigits": 0,
        "suffix": " km",
        "type": "number"
      },
      "ticks": {
        "count": 5
      },
      "title": {
        "text": "East–west distance"
      }
    },
    "y": {
      "format": {
        "fractionDigits": 0,
        "suffix": " km",
        "type": "number"
      },
      "ticks": {
        "count": 5
      },
      "title": {
        "text": "North–south distance"
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "direction",
        "type": "datum",
        "value": 325.853
      }
    }
  ],
  "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": "direction",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "fields": [
        {
          "field": "x",
          "format": "number",
          "label": "X"
        },
        {
          "field": "y",
          "format": "number",
          "label": "Y"
        },
        {
          "field": "direction",
          "format": "number",
          "fractionDigits": 0,
          "label": "Direction",
          "suffix": "°"
        },
        {
          "field": "magnitude",
          "format": "number",
          "label": "Magnitude"
        }
      ],
      "title": "Vector field",
      "trigger": "mark"
    }
  },
  "legend": {
    "interactive": false,
    "items": [
      {
        "id": "semantic-0",
        "label": "Magnitude · length"
      }
    ],
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "layers",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Vector field",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "fields": {
      "direction": "direction",
      "magnitude": "magnitude"
    }
  },
  "padding": {
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "A balanced vortex keeps direction, magnitude, and the calm center visible",
    "text": "Vector field chart"
  },
  "width": "container",
  "x": {
    "field": "x",
    "title": "Horizontal position",
    "type": "quantitative"
  },
  "y": {
    "field": "y",
    "title": "Vertical position",
    "type": "quantitative"
  }
};

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

Portable schema

ChartSpec 0.1 · options

{
  "accessibility": {
    "description": "A balanced vortex keeps direction, magnitude, and the calm center visible. The example uses curated, deterministic data and exposes its exact values in a semantic table.",
    "label": "Vector field chart: A balanced vortex keeps direction, magnitude, and the calm center visible"
  },
  "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": "direction",
        "type": "datum",
        "value": 325.853
      },
      "text": "Point and range highlights · 0"
    }
  ],
  "axes": {
    "x": {
      "format": {
        "fractionDigits": 0,
        "suffix": " km",
        "type": "number"
      },
      "ticks": {
        "count": 5
      },
      "title": {
        "text": "East–west distance"
      }
    },
    "y": {
      "format": {
        "fractionDigits": 0,
        "suffix": " km",
        "type": "number"
      },
      "ticks": {
        "count": 5
      },
      "title": {
        "text": "North–south distance"
      }
    }
  },
  "create": {
    "adaptive": {
      "profiles": "auto"
    }
  },
  "height": 620,
  "highlights": [
    {
      "id": "manual-focus",
      "padding": 7,
      "target": {
        "field": "direction",
        "type": "datum",
        "value": 325.853
      }
    }
  ],
  "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": "direction",
      "mode": "multiple",
      "toggle": true
    },
    "tooltip": {
      "fields": [
        {
          "field": "x",
          "format": "number",
          "label": "X"
        },
        {
          "field": "y",
          "format": "number",
          "label": "Y"
        },
        {
          "field": "direction",
          "format": "number",
          "fractionDigits": 0,
          "label": "Direction",
          "suffix": "°"
        },
        {
          "field": "magnitude",
          "format": "number",
          "label": "Magnitude"
        }
      ],
      "title": "Vector field",
      "trigger": "mark"
    }
  },
  "legend": {
    "interactive": false,
    "items": [
      {
        "id": "semantic-0",
        "label": "Magnitude · length"
      }
    ],
    "labels": {
      "hide": "Hide",
      "show": "Show"
    },
    "maxItems": 8,
    "mode": "layers",
    "orientation": "horizontal",
    "position": "bottom",
    "title": "Vector field",
    "visible": true
  },
  "locale": "en",
  "mark": {
    "fields": {
      "direction": "direction",
      "magnitude": "magnitude"
    }
  },
  "padding": {
    "top": 52
  },
  "theme": "graflume-light",
  "title": {
    "subtitle": "A balanced vortex keeps direction, magnitude, and the calm center visible",
    "text": "Vector field chart"
  },
  "width": "container",
  "x": {
    "field": "x",
    "title": "Horizontal position",
    "type": "quantitative"
  },
  "y": {
    "field": "y",
    "title": "Vertical position",
    "type": "quantitative"
  }
}