-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Description
Hi! I tried to generate a x-y-Line-Graph with altair from a pandas DataFrame with two columns named "Force in [N]" and "Travel in [inches]".
When I use the default altair renderer in a JupyterLab Notebook it fails with a Javascript error very similar to this bug report vega/vega-lite#8153
When I use the png renderer (which uses vl-convert) the graph does not render, just the canvas without a line.

This is the SPEC: with_brackets.json
Excerpt of SPEC:
{
// OMITTED //
"encoding": {
"x": {
"field": "Travel in [inches]",
"type": "quantitative"
},
"y": {
"field": "Force in [N]",
"type": "quantitative"
}
},
// OMITTED //
}When I remove all brackets the graph renders as expected. SPEC: without_brackets.json
Excerpt of SPEC:
{
// EVERYTHING LIKE ABOVE //
"encoding": {
"x": {
"field": "Travel in inches",
"type": "quantitative"
},
"y": {
"field": "Force in N",
"type": "quantitative"
}
},
// OMITTED //
}When I escape the brackets [ ] with \\[ and \\] in the encoding section (like mentioned in the vega-lite issue) the graph renders as expected but the axis labels contain one escaping backslash: Force in \[N\]
SPEC: with_brackets_escaped.json
Excerpt of SPEC:
{
// EVERYTHING LIKE ABOVE //
"encoding": {
"x": {
"field": "Travel in \\[inches\\]",
"type": "quantitative"
},
"y": {
"field": "Force in \\[N\\]",
"type": "quantitative"
}
},
// OMITTED //
}Used Versions
Sourcecode: VegaError.ipynb.txt
pandas 2.3.0
altair 5.5.0
vl_convert 1.7.0
RendererRegistry.enable('png')

