-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support concatenation #33
Comments
The comment in OP refers to two tile_charts next to each other. Another concatenation issue is the following, while trying to add a basemap to the following example in the altair gallery: https://altair-viz.github.io/gallery/interval_selection_map_quakes.html This works: import altair as alt
import altair_tiles as til
from vega_datasets import data
import geopandas as gpd
# load data
gdf_quakies = gpd.read_file(data.earthquakes.url, driver="GeoJSON")
# defintion for interactive brush
brush = alt.selection_interval(
encodings=["longitude"],
empty=False,
value={"longitude": [-50, -110]}
)
# world disk
sphere = alt.Chart(alt.sphere()).mark_geoshape(
fill="transparent", stroke="lightgray", strokeWidth=1
)
# earthquakes as dots on map
quakes = alt.Chart(gdf_quakies).transform_calculate(
lon="datum.geometry.coordinates[0]",
lat="datum.geometry.coordinates[1]",
).mark_circle(opacity=0.35, tooltip=True).encode(
longitude="lon:Q",
latitude="lat:Q",
color=alt.condition(brush, alt.value("goldenrod"), alt.value("steelblue")),
size=alt.Size("mag:Q").scale(type="pow", range=[1, 1000], domain=[0, 7], exponent=4),
).add_params(brush)
# combine layers for the map
left_map = alt.layer(til.create_tiles_chart(), sphere, quakes).project(type="mercator").properties(width=300, height=300)
left_map But adding bars as chart next to it, make the tile-layer disappear: # histogram of binned earthquakes
bars = alt.Chart(gdf_quakies).mark_bar().encode(
x=alt.X("mag:Q").bin(extent=[0,7]),
y="count(mag):Q",
color=alt.value("steelblue")
)
# filtered earthquakes
bars_overlay = bars.encode(color=alt.value("goldenrod")).transform_filter(brush)
# combine layers for histogram
right_bars = alt.layer(bars, bars_overlay)
left_map | right_bars Increasing the width of the left_map.properties(width=400) | right_bars |
Same here. Just commenting to say this does not work independent on creation mode: when creating an independent map (through I also noticed that the tiles are not even requested. Meaning, the behavior is not: map is being rendered and then not displayed - but, I assume, the size of the map is wrongly specified due to the concatenation / some offset not being considered. |
See #31 (comment)
The text was updated successfully, but these errors were encountered: