n

nulite

@preview

Generate charts with vegalite.

v0.1.0
MIT

Package Information

Last Updated
Minimum Typst Version
0.11.1
Authors
j-mueller
Categories
visualizationintegration
Disciplines
mathematics

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/nulite:0.1.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/nulite:0.1.0": *

Version History

0.1.00.11.1
9ad9be94057a...

nulite

A typst plugin to generate charts using vegalite

Usage

#import "@preview/nulite:0.1.0" as vegalite

#vegalite.render(
  width: 100%,
  height: 100%,
  zoom: 1,
  json("spec.json")
  )

Example

The module exports a single function, render with four arguments

  • width: Width of the chart in percent of the container's width
  • height: Height of the chart in percent of the container's height
  • zoom: Zoom factor applied to the SVG. This mainly affects the sizing of text in relation to the graphical elements.
  • spec: Vegalite specification

Compatibility

This plugin uses vegalite v5.21 and vega v5.30.

The following features of vegalite are not supported:

  • Setting width and height in the spec. These values should be provided as arguments to render. If width or height are included in the spec then they will be ignored.
  • Loading data with the url property. Attempting to do this will result in an error while trying to compile the typst document. All data should be provided as part of the spec itself (inline).
  • Interactive charts and tooltips.