question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: alt.datum does not support nested properties

See original GitHub issue

and those nested properties are typical for topojson/geojson objects; consider example:


boundaries = alt.topo_feature(map_url, 'area')


alt.Chart(boundaries).transform_filter(alt.datum.properties['area_type'] == 'neighborhood').mark_geoshape(fill='red').encode(color='area_id:N').project(
    type="mercator",
    center=[-73.99,40.72]
).properties(width=500,height=300)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Casyfillcommented, Jun 11, 2018

had to workaround with

MAP = alt.Chart(boundaries).transform_calculate(area_type='datum.properties.area_type',).transform_filter(alt.datum.area_type == 'neighborhood')
MAP.mark_geoshape(fill='red').encode(color='area_id:N').project(
    type="mercator",
    center=[-73.99,40.72]
).properties(width=500,height=300)
1reaction
jakevdpcommented, Sep 10, 2019

You can pass any string to a getitem, e.g.

alt.datum['acey-ducey']
Read more comments on GitHub >

github_iconTop Results From Across the Web

Encodings — Altair 4.2.0 documentation
An object defining properties of axis's gridlines, ticks and labels. If null , the axis for the encoding channel will be removed.
Read more >
'int' is a primitive and doesn't support nested properties: Azure ...
Where varInputFolderName = String = abcde as per this sample. Here is the pipeline JSON payload for this sample. You can play around...
Read more >
typeerror: cannot read properties of undefined (reading 'dark') - You ...
Since you are accessing the nested value from the array, there may be some cases, the value might not be presented. You can...
Read more >
Chapter 14 PLAN SHEET PRODUCTION
14A.4.b Nested References in Drawing Models and Sheet Models . ... from the Civil Plan Mode, this Mode does not require an Alignment...
Read more >
Subtemplate - Racket Documentation
The expression splicing-lists are not recognised by templates, and it is not possible for a template to produce a “splicing syntax object” (instead,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found