Vega-lite API version control

Hi everybody,

I have been using Vega-lite API V5 (import { vl } from “@vega/vega-lite-api-v5”) and ObservableHQ lately, with growing excitement. Now I’d like to make use of the latest Vega-lite (API?) version 5.2 as it is said to also support xOffset encoding for grouped bar charts. Is this already possible in Observable ?
And how does the release of new versions work ? Do they always go hand-in-hand for both Vega-lite and Vega-lite API ?

Yes, you can override values when importing from another notebook, by passing in your own values:

vlVersion = '5.2.0'
import {vl} with {vlVersion} from '@vega/vega-lite-api-v5'

Names can also be aliased:

import {vl} with {myVersion as vlVersion} from '@vega/vega-lite-api-v5'

You may want to leave that question as a comment on the notebook, as not all Observable users are active on the forum.

1 Like