Skip to content
HALOWERK

Formatwerk

vega render

Compiles Vega-Lite 6.5 to Vega 6.4 and renders to SVG with the string renderer (no canvas); PNG comes from the Chrome canvas. Both libraries run from node_modules inside a sandboxed Chrome renderer with network blocked, so Vega expressions never run in the API process. Data must be inline: any url is rejected and loader access is blocked and reported. Returns size, mark item count and warnings.

POST https://format.halowerk.com/v1/vega-render

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
specobjectYesVega-Lite or Vega specification with inline data values.
spec_typestringNo
formatstringNosvg, png (rasterised by Chrome) or both.
scalenumberNoDevice pixel ratio for PNG output.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "spec"
  ],
  "properties": {
    "spec": {
      "type": "object",
      "description": "Vega-Lite or Vega specification with inline data values."
    },
    "spec_type": {
      "type": "string",
      "enum": [
        "auto",
        "vega-lite",
        "vega"
      ],
      "default": "auto"
    },
    "format": {
      "type": "string",
      "enum": [
        "svg",
        "png",
        "both"
      ],
      "default": "svg",
      "description": "svg, png (rasterised by Chrome) or both."
    },
    "scale": {
      "type": "number",
      "minimum": 1,
      "maximum": 4,
      "default": 2,
      "description": "Device pixel ratio for PNG output."
    }
  }
}

Open original schema

Published input example

{
  "spec": {
    "data": {
      "values": [
        {
          "month": "Jan",
          "revenue": 120
        },
        {
          "month": "Feb",
          "revenue": 180
        }
      ]
    },
    "mark": "bar",
    "encoding": {
      "x": {
        "field": "month",
        "type": "nominal"
      },
      "y": {
        "field": "revenue",
        "type": "quantitative"
      }
    }
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’