.interactive only working with certain data types.
See original GitHub issueHi Altair users,
Is there a reason why adding “.interactive” does not work for the following example? I’m unable to pan or zoom. However if I use a temporal data type for the dates, then it works (although the rect marks now go on forever in the past).
df=pd.DataFrame({'days_between': ['2017-01-01', '2017-01-02', '2017-01-03'], 'variable': ['person_1', 'person_2', 'person_3'], 'value': [1,2,3]})
alt.Chart(df).mark_rect().encode(
x='days_between:O',
y='variable:N',
color=alt.Color('value:Q', scale=alt.Scale(range=['green','yellow','red']))).properties(width=300, height=100).interactive()
With a temporal data type:
...
x='days_between:T',
...
Any help is appreciated.
Al
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Linked data types FAQ and tips - Microsoft Support
Linked data types pull in reliable data from online sources such as Bing, Wolfram, etc. If you want to view the type or...
Read more >How to Select the Right Data Types | Tutorial by Chartio
The basic strategy for selecting the best data type is to select the smallest data type that matches the kind of data you...
Read more >[Interactive Coding Exercise] Data Types - YouTube
We're releasing a free preview (first 3 hours) of our 60+ hour 100 Days of Python Bootcamp on YouTube.In this free series, you'll...
Read more >How to get more new data types in Microsoft Excel - YouTube
Excel is evolving. With Stocks and Geography “ data types,” we introduced the idea of cells in the Excel grid containing more than...
Read more >SQL Data Types | Advanced SQL - Mode Analytics
In previous lessons, you learned that certain functions work on some data types, but not others. For example, COUNT works with any data...
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
same issue -
.interactive()
does not work with geoshapes for me:results in
Vega-Lite achieves pan/zoom behavior by binding an interval selection to
"scales"
. This is precisely what callingchart.interactive()
does in Altair.The issue here is that interval selections bound to scales for non-quantitative encodings do not have any effect in Vega-lite, and from the linked issues this appears to be by design. So no, there currently is no way to make this work.