plotting a column name with '.' in it eventually leads to a vega error
See original GitHub issueI’m doing an Altair chart with a color given by color=Color('gpuinfo.name:N', ...
. This produces an eventual Vega error.
(Why do I have a column with a period in its name? Reading nested JSONs into pandas is nicely handled by json_normalize
, which flattens nested JSON levels into dot-separated column names.)
undefined:3
return x["gpuinfo"]["name"];
^
TypeError: Cannot read property 'name' of undefined
at Object.eval [as get] (eval at <anonymous> (/Users/jowens/Documents/working/vega/node_modules/datalib/src/util.js:147:20), <anonymous>:3:20)
at Facetor.proto._cellkey (/Users/jowens/Documents/working/vega/node_modules/datalib/src/aggregate/aggregator.js:106:23)
at Facetor.proto._cell (/Users/jowens/Documents/working/vega/node_modules/datalib/src/aggregate/aggregator.js:114:38)
at Facetor.proto._add (/Users/jowens/Documents/working/vega/node_modules/datalib/src/aggregate/aggregator.js:151:19)
at add (/Users/jowens/Documents/working/vega/src/transforms/Aggregate.js:174:31)
at Array.forEach (native)
at Aggregate.prototype.transform (/Users/jowens/Documents/working/vega/src/transforms/Aggregate.js:190:13)
at Aggregate.prototype.evaluate (/Users/jowens/Documents/working/vega/src/transforms/Transform.js:48:15)
at Node.dataRef (/Users/jowens/Documents/working/vega/src/scene/Scale.js:387:15)
at Node.ordinal (/Users/jowens/Documents/working/vega/src/scene/Scale.js:127:20)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
plotting a column name with '.' in it eventually leads to a vega ...
I'm doing an Altair chart with a color given by color=Color('gpuinfo.name:N', ... . This produces an eventual Vega error.
Read more >How can I overcome issue on column name of the given data ...
I have been trying to extract some data from a DataFrame, where I ran into this issue. While I am trying to plot...
Read more >TOPCAT - Tool for OPerations on Catalogues And Tables
Plot columns against each other in 1, 2 and 3 dimensions, distinguishing different subsets; Calculate statistics on each column for some or all ......
Read more >OmniSci Release Notes
Fixed an issue importing MULTIPOLYGON columns from PostGIS via SQL Importer. ... Fixed issue where empty string as group name causes server program...
Read more >tescan_vega3_sem_manual.pdf - Dartmouth
The VEGA 3 SEM column has a fixed aperture placed over the intermediate and objective lenses and scanning coils.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is expected:
x.x
is one way Vega-Lite uses to refer to hierarchical data. If you want to use special characters in field names, they should be escaped. e.g.This is true regardless of the Altair/Vega-Lite version you are using.
For more information, see field under Encoding Channel Options
Great, glad you got it working.
Regarding auto-escaping, there’s no functionality built-in for that… it would be a useful feature to have.