@jupyterlab/vega5-extension
TypeScript icon, indicating that this package has built-in type declarations

4.3.1 • Public • Published

vega5-extension

A JupyterLab extension for rendering Vega 5 and Vega-Lite 3.

This extension is in the official JupyterLab distribution.

Usage

To render Vega-Lite output in IPython:

from IPython.display import display

display({
    "application/vnd.vegalite.v3+json": {
        "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
        "description": "A simple bar chart with embedded data.",
        "data": {
            "values": [
                {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
                {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
                {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
            ]
        },
        "mark": "bar",
        "encoding": {
            "x": {"field": "a", "type": "ordinal"},
            "y": {"field": "b", "type": "quantitative"}
        }
    }
}, raw=True)

Using the Altair library:

import altair as alt

cars = alt.load_dataset('cars')

chart = alt.Chart(cars).mark_point().encode(
    x='Horsepower',
    y='Miles_per_Gallon',
    color='Origin',
)

chart

Provide Vega-Embed options via metadata:

from IPython.display import display

display({
    "application/vnd.vegalite.v3+json": {
        "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
        "description": "A simple bar chart with embedded data.",
        "data": {
            "values": [
                {"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
                {"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
                {"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
            ]
        },
        "mark": "bar",
        "encoding": {
            "x": {"field": "a", "type": "ordinal"},
            "y": {"field": "b", "type": "quantitative"}
        }
    }
}, metadata={
    "application/vnd.vegalite.v3+json": {
        "embed_options": {
            "actions": False
        }
    }
}, raw=True)

Provide Vega-Embed options via Altair:

import altair as alt

alt.renderers.enable('default', embed_options={'actions': False})

cars = alt.load_dataset('cars')

chart = alt.Chart(cars).mark_point().encode(
    x='Horsepower',
    y='Miles_per_Gallon',
    color='Origin',
)

chart

To render a .vl, .vg, vl.json or .vg.json file, simply open it:

Development

See the JupyterLab Contributor Documentation.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.3.1
1,952latest
4.4.0-alpha.0
979next

Version History

VersionDownloads (Last 7 Days)Published
4.4.0-alpha.0
979
4.3.1
1,952
4.2.6
764
4.3.0
211
4.3.0-rc.1
2
4.3.0-rc.0
1
4.3.0-beta.3
2
4.3.0-beta.2
1
3.6.8
2,029
4.2.5
953
4.3.0-beta.1
5
4.3.0-beta.0
1
4.2.4
118
4.3.0-alpha.2
3
4.3.0-alpha.1
55
4.2.3
27
4.2.2
111
4.3.0-alpha.0
1
4.2.1
22
4.2.0
149
4.2.0-rc.0
1
4.1.8
147
4.1.7
1
4.2.0-beta.3
1
4.2.0-beta.2
1
4.2.0-beta.1
1
4.1.6
48
4.2.0-beta.0
1
4.2.0-alpha.2
1
4.2.0-alpha.1
1
4.1.5
41
4.1.4
2
4.2.0-alpha.0
20
4.1.3
6
4.0.13
57
4.1.2
12
4.1.1
1
4.1.0
9
4.1.0-rc.1
1
4.0.12
4
4.1.0-rc.0
1
3.6.765
4.1.0-beta.2
1
4.0.11
96
4.1.0-beta.1
1
4.0.10
62
4.1.0-beta.0
1
4.1.0-alpha.41
4.0.931
4.1.0-alpha.31
4.0.86
4.0.7763
4.1.0-alpha.21
3.6.6345
4.0.67
4.1.0-alpha.11
4.0.515
4.0.429
4.0.314
3.6.531
4.0.234
3.6.419
4.0.111
4.0.025
4.0.0-rc.11
4.0.0-rc.05
4.0.0-beta.21
4.0.0-beta.11
3.6.3129
4.0.0-beta.01
3.6.253
4.0.0-alpha.221
4.0.0-alpha.211
4.0.0-alpha.201
4.0.0-alpha.191
3.6.156
3.6.09
4.0.0-alpha.181
3.6.0-rc.11
3.5.3107
3.6.0-rc.01
4.0.0-alpha.171
3.5.213
3.6.0-beta.01
3.6.0-alpha.51
3.5.119
3.6.0-alpha.42
4.0.0-alpha.161
3.6.0-alpha.31
3.6.0-alpha.21
3.6.0-alpha.11
3.6.0-alpha.01
3.5.069
3.5.0-rc.01
4.0.0-alpha.151
3.5.0-beta.01
3.5.0-alpha.01
3.4.8207
4.0.0-alpha.141
3.4.79
3.4.62
4.0.0-alpha.131
3.4.59
4.0.0-alpha.121
3.4.413
4.0.0-alpha.111
3.4.344
4.0.0-alpha.101
3.4.214
3.4.11
3.4.02
3.4.0-rc.01
3.4.0-beta.01
4.0.0-alpha.91
3.4.0-alpha.01
3.3.4209
3.3.31
4.0.0-alpha.81
4.0.0-alpha.71
3.3.225
4.0.0-alpha.61
3.3.11
3.3.01
4.0.0-alpha.514
3.3.0-rc.01
3.3.0-beta.01
3.2.982
3.3.0-alpha.181
3.3.0-alpha.171
3.2.815
3.3.0-alpha.161
3.1.1916
3.2.71
4.0.0-alpha.41
3.2.61
4.0.0-alpha.31
3.2.512
4.0.0-alpha.21
4.0.0-alpha.11
3.2.440
3.2.36
3.3.0-alpha.151
3.2.21
3.3.0-alpha.141
3.2.16
3.2.017
3.3.0-alpha.131
3.2.0-rc.01
3.1.182
3.3.0-alpha.121
3.1.171
3.1.161
3.2.0-beta.01
3.3.0-alpha.111
3.1.141
3.2.0-alpha.11
3.2.0-alpha.01
3.1.132
3.3.0-alpha.101
3.1.121
3.3.0-alpha.91
3.3.0-alpha.81
3.1.112
3.3.0-alpha.71
3.1.104
3.3.0-alpha.61
3.1.91
3.3.0-alpha.51
3.1.81
3.3.0-alpha.41
3.1.710
3.3.0-alpha.31
3.1.617
3.3.0-alpha.21
3.1.51
3.3.0-alpha.11
3.0.10209
3.1.42
3.1.31
3.1.21
3.1.13
3.3.0-alpha.01
3.1.01
3.1.0-rc.21
3.1.0-rc.11
3.1.0-rc.01
3.1.0-beta.21
3.1.0-beta.11
3.1.0-beta.01
3.1.0-alpha.131
3.1.0-alpha.121
3.1.0-alpha.111
3.1.0-alpha.101
3.1.0-alpha.91
3.0.911
3.1.0-alpha.81
3.0.82
3.1.0-alpha.71
3.1.0-alpha.61
3.1.0-alpha.54
3.0.78
3.1.0-alpha.42
3.0.61
2.3.0433
3.0.52
3.1.0-alpha.36
3.0.41
3.1.0-alpha.22
3.1.0-alpha.12
3.1.0-alpha.03
3.0.32
2.3.0-rc.01
3.0.27
3.0.11
3.0.014
3.0.0-rc.151
3.0.0-rc.141
3.0.0-rc.132
3.0.0-rc.121
2.3.0-alpha.21
3.0.0-rc.111
3.0.0-rc.105
3.0.0-rc.91
3.0.0-rc.84
3.0.0-rc.74
3.0.0-rc.69
2.2.165
2.3.0-alpha.11
3.0.0-rc.51
2.3.0-alpha.01
3.0.0-rc.42
3.0.0-rc.31
3.0.0-rc.21
3.0.0-rc.11
3.0.0-rc.01
3.0.0-beta.81
3.0.0-beta.71
3.0.0-beta.61
3.0.0-beta.51
3.0.0-beta.41
3.0.0-beta.31
3.0.0-beta.21
3.0.0-beta.11
3.0.0-beta.01
3.0.0-alpha.141
3.0.0-alpha.131
3.0.0-alpha.121
3.0.0-alpha.111
3.0.0-alpha.101
3.0.0-alpha.91
3.0.0-alpha.81
3.0.0-alpha.71
3.0.0-alpha.61
3.0.0-alpha.51
2.2.024
3.0.0-alpha.41
3.0.0-alpha.31
3.0.0-alpha.21
3.0.0-alpha.11
2.2.0-rc.11
2.2.0-rc.01
2.2.0-alpha.23
3.0.0-alpha.01
2.2.0-alpha.01
2.1.06
2.1.0-rc.01
2.1.0-beta.01
2.1.0-a.01
2.0.19
2.0.01
2.0.0-rc.21
2.0.0-rc.11
2.0.0-rc.01
2.0.0-beta.31
2.0.0-beta.21
2.0.0-beta.11
2.0.0-beta.01
2.0.0-alpha.41
2.0.0-alpha.31
2.0.0-alpha.21
1.2.043
1.2.0-rc.02
1.2.0-alpha.31
1.2.0-alpha.21
1.2.0-alpha.11
2.0.0-alpha.12
2.0.0-alpha.01
1.2.0-alpha.08
1.1.05
1.0.32
1.1.0-rc.01
1.0.21
1.1.0-alpha.21
1.1.0-alpha.11
1.1.0-alpha.02
1.0.11
1.0.02
1.0.0-rc.11
1.0.0-rc.01
1.0.0-alpha.131
1.0.0-alpha.121
1.0.0-alpha.111
1.0.0-alpha.101
1.0.0-alpha.92
1.0.0-alpha.81
1.0.0-alpha.71
1.0.0-alpha.62
1.0.0-alpha.51
1.0.0-alpha.41

Package Sidebar

Install

npm i @jupyterlab/vega5-extension

Weekly Downloads

11,631

Version

4.3.1

License

BSD-3-Clause

Unpacked Size

25.1 kB

Total Files

10

Last publish

Collaborators

  • jupyterlab-release-bot
  • jweill-aws
  • krassowski
  • darian
  • blink1073
  • jasongrout
  • fcollonval
  • jtpio
  • echarles
  • mbektas