-
Notifications
You must be signed in to change notification settings - Fork 16
fix: DH-21259: Fix maps and add docs #1279
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2e9fabf
initial fix and docs
jnumainville b68a931
fix tests
jnumainville e4f78f1
remove AI slop
jnumainville 64a4c89
wip outages
jnumainville c539460
update docs and generators
jnumainville 6bc04f0
snapshots
jnumainville 19dd49b
wip
jnumainville 63c7df3
snapshots
jnumainville 973f19b
comments and theme fix
jnumainville 5d1067d
remove default map from tests
jnumainville 958dbd0
docs
jnumainville af9d4ae
switch to center
jnumainville 431c6c6
updated snapshots
jnumainville File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Density Map | ||
|
|
||
| A density map plot is a geographic visualization that connects data points with a heatmap on a geographic map using latitude and longitude coordinates or locations. The heatmap is ideal for visualizing the density of data across geographic areas. | ||
|
|
||
| Density map plots are appropriate when the dataset contains geographic coordinates (latitude and longitude) or locations that represent individual points on a map. `density_map` visualizes data using detailed map tiles. For visualizing individual points, use [`scatter_geo`](./scatter-geo.md) or [`scatter_map`](./scatter-map.md). | ||
|
|
||
| ## What are density map plots useful for? | ||
|
|
||
| - **Geographic density**: They are excellent for showing the density of individual geographic locations on a map. | ||
| - **Detailed geographic context**: Density map plots provide a rich and detailed way to visualize geographic data with map tile features. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### A basic density map plot | ||
|
|
||
| Visualize geographic density by passing longitude and latitude column names to the `lon` and `lat` arguments. | ||
| It's recommended to set the initial `zoom` level and `center` coordinates for better visualization based on the data. Click and drag on the resulting map to pan and zoom. | ||
|
|
||
| ```python order=density_map_plot,outages_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the outages dataset | ||
| outages_table = dx.data.outages() | ||
|
|
||
| # Create a density map showing concentration of outages | ||
| # Zoom and center are set for better initial view | ||
| density_map_plot = dx.density_map( | ||
| outages_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| zoom=9, | ||
| center=dx.data.OUTAGE_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ### Adjust the density radius | ||
|
|
||
| Control how spread out the density visualization appears using the `radius` argument. | ||
|
|
||
| ```python order=density_map_plot,outages_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the outages dataset | ||
| outages_table = dx.data.outages() | ||
|
|
||
| # Use a larger radius for a more diffuse heatmap | ||
| # Zoom and center are set for better initial view | ||
| density_map_plot = dx.density_map( | ||
| outages_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| radius=10, | ||
| zoom=9, | ||
| center=dx.data.OUTAGE_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ### Customize the color scale | ||
|
|
||
| Change the color scale using the `color_continuous_scale` argument. | ||
|
|
||
| ```python order=density_map_plot,outages_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the outages dataset | ||
| outages_table = dx.data.outages() | ||
|
|
||
| # Use a different color scale | ||
| # Zoom and center are set for better initial view | ||
| density_map_plot = dx.density_map( | ||
| outages_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| color_continuous_scale=["yellow", "orange", "red"], | ||
| zoom=9, | ||
| center=dx.data.OUTAGE_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ### Change map style | ||
|
|
||
| Use different base map styles with the `map_style` argument. The default style is dependent on the theme. | ||
|
|
||
| ```python order=density_map_plot,outages_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the outages dataset | ||
| outages_table = dx.data.outages() | ||
|
|
||
| # Change the map style for different tiles | ||
| # Zoom and center are set for better initial view | ||
| density_map_plot = dx.density_map( | ||
| outages_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| map_style="open-street-map", | ||
| zoom=9, | ||
| center=dx.data.OUTAGE_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ## API Reference | ||
|
|
||
| ```{eval-rst} | ||
| .. dhautofunction:: deephaven.plot.express.density_map | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Line Geo | ||
|
|
||
| A line geo plot is a geographic visualization that connects data points with lines on a map using latitude and longitude coordinates or locations. The lines are ideal for visualizing relationships between geographic locations, such as paths or routes. | ||
|
|
||
| Line geo plots are appropriate when the dataset contains geographic coordinates (latitude and longitude) or locations that connect across geographic areas. `line_geo` visualizes data using a basic map projection, without a high degree of detail. For richer tile maps, use [`line_map`](./line-map.md). For visualizing values at individual locations, consider using [`scatter_geo`](./scatter-geo.md). | ||
|
|
||
| ## What are line geo plots useful for? | ||
|
|
||
| - **Geographic relationships**: They are excellent for showing connections or relationships between different geographic locations, such as routes or paths. | ||
| - **Simple geographic context**: Line geo plots provide a clear and straightforward way to visualize geographic data that does not require detailed map features. | ||
| - **Sequential geographic data**: Line geo plots specialize in showing how data changes across connected geographic points over time or other ordered dimensions. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### A basic line geo plot | ||
|
|
||
| Visualize geographic paths by passing longitude and latitude column names to the `lon` and `lat` arguments. It's recommended to set `fitbounds` to `"locations"`, which automatically adjusts the map view to include all points, unless a broader view is desired. Click and drag on the resulting map to pan and zoom. | ||
|
|
||
| ```python order=line_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Plot a single flight path | ||
| # color is set for visibility | ||
| # fitbounds is set for better initial view | ||
| single_flight = flights_table.where("FlightId = `SAL101`") | ||
| line_geo_plot = dx.line_geo( | ||
| single_flight, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| color_discrete_sequence="red", | ||
| fitbounds="locations", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Color by group | ||
|
|
||
| Denote different routes by using the color of the lines as group indicators by passing the grouping column name to the `by` argument. Set the color of each group using the `color_discrete_sequence` argument. | ||
|
|
||
| ```python order=line_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Color each flight path differently | ||
| # fitbounds is set for better view | ||
| line_geo_plot = dx.line_geo( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| color_discrete_sequence=["red", "blue", "green", "orange"], | ||
| fitbounds="locations", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Use different projections and scopes | ||
|
|
||
| Change the map projection using the `projection` argument. Options include "natural earth", "mercator", and "orthographic". Adjust the geographic scope using the `scope` argument to focus on specific regions such as "world", "usa", "europe," or "north american". Set the `center` argument for a better initial view, especially when scoping to a specific region. | ||
|
|
||
| ```python order=line_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Use an orthographic (globe) projection and set scope to North America | ||
| # center is set for better initial view | ||
| line_geo_plot = dx.line_geo( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| projection="orthographic", | ||
| scope="north america", | ||
| center=dx.data.FLIGHT_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ## API Reference | ||
|
|
||
| ```{eval-rst} | ||
| .. dhautofunction:: deephaven.plot.express.line_geo | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Line Map | ||
|
|
||
| A line map plot is a geographic visualization that connects data points with lines on a map using latitude and longitude coordinates or locations. The lines are ideal for visualizing relationships between geographic locations such as paths or routes. | ||
|
|
||
| Line map plots are appropriate when the dataset contains geographic coordinates (latitude and longitude) or locations that connect across geographic areas. `line_map` visualizes data using detailed map tiles. For simpler projection maps, use [`line_geo`](./line-geo.md). For visualizing values at individual locations, consider using [`scatter_map`](./scatter-map.md). | ||
|
|
||
| ## What are line map plots useful for? | ||
|
|
||
| - **Geographic relationships**: They are excellent for showing connections or relationships between different geographic locations, such as routes or paths. | ||
| - **Detailed geographic context**: Line map plots provide a rich and detailed way to visualize geographic data with map tile features. | ||
| - **Sequential geographic data**: Line map plots specialize in showing how data changes across connected geographic points over time or other ordered dimensions. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### A basic line map plot | ||
|
|
||
| Visualize geographic paths by passing longitude and latitude column names to the `lon` and `lat` arguments. It's recommended to set the initial `zoom` level and `center` coordinates for better visualization based on the data. Click and drag on the resulting map to pan and zoom. | ||
|
|
||
| ```python order=line_map_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Plot a single flight path | ||
| # Color is set for visibility | ||
| # Zoom and center are set for better initial view | ||
| single_flight = flights_table.where("FlightId = `SAL101`") | ||
| line_map_plot = dx.line_map( | ||
| single_flight, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| color_discrete_sequence="red", | ||
| zoom=3, | ||
| center=dx.data.FLIGHT_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ### Color by group | ||
|
|
||
| Denote different routes by using the color of the lines as group indicators by passing the grouping column name to the `by` argument. Set the color of each group using the `color_discrete_sequence` argument. | ||
|
|
||
| ```python order=line_map_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Color each flight path differently | ||
| # Zoom and center are set for better initial view | ||
| line_map_plot = dx.line_map( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| color_discrete_sequence=["red", "blue", "green", "orange"], | ||
| zoom=3, | ||
| center=dx.data.FLIGHT_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ### Customize map style | ||
|
|
||
| Use different base map styles with the `map_style` argument. The default style is dependent on the theme. | ||
|
|
||
| ```python order=line_map_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Change the map style for different tiles | ||
| # Zoom and center are set for better initial view | ||
| line_map_plot = dx.line_map( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| map_style="open-street-map", | ||
| zoom=3, | ||
| center=dx.data.FLIGHT_CENTER, | ||
| ) | ||
| ``` | ||
|
|
||
| ## API Reference | ||
|
|
||
| ```{eval-rst} | ||
| .. dhautofunction:: deephaven.plot.express.line_map | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Scatter Geo | ||
|
|
||
| A scatter geo plot is a geographic visualization that displays individual data points on a map using latitude and longitude coordinates or locations. The points are ideal for visualizing the distribution of data across geographic areas. | ||
|
|
||
| Scatter geo plots are appropriate when the dataset contains geographic coordinates (latitude and longitude) or locations that represent individual points on a map. `scatter_geo` visualizes data using a basic map projection, without a high degree of detail. For richer tile maps, use [`scatter_map`](./scatter-map.md). For visualizing connections between locations, consider using [`line_geo`](./line-geo.md). | ||
|
|
||
| ## What are scatter geo plots useful for? | ||
|
|
||
| - **Geographic distribution**: They are excellent for showing the distribution of individual geographic locations on a map. | ||
| - **Simple geographic context**: Scatter geo plots provide a clear and straightforward way to visualize geographic data that does not require detailed map features. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### A basic scatter geo plot | ||
|
|
||
| Visualize geographic points by passing longitude and latitude column names to the `lon` and `lat` arguments. It's recommended to set `fitbounds` to `"locations"`, which automatically adjusts the map view to include all points, unless a broader view is desired. Click and drag on the resulting map to pan and zoom. | ||
|
|
||
| ```python order=scatter_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Plot a single flight path | ||
| # color is set for visibility | ||
| # fitbounds is set for better initial view | ||
| single_flight = flights_table.where("FlightId = `SAL101`") | ||
| scatter_geo_plot = dx.scatter_geo( | ||
| single_flight, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| color_discrete_sequence="red", | ||
| fitbounds="locations", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Color by group | ||
|
|
||
| Denote different categories by using the color of the points as group indicators by passing the grouping column name to the `by` argument. Set the color of each group using the `color_discrete_sequence` argument. | ||
|
|
||
| ```python order=scatter_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Color each flight path differently | ||
| # fitbounds is set for better view | ||
| scatter_geo_plot = dx.scatter_geo( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| color_discrete_sequence=["red", "blue", "green", "orange"], | ||
| fitbounds="locations", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Use different projections and scopes | ||
|
|
||
| Change the map projection using the `projection` argument. Options include "natural earth", "mercator", and "orthographic". Adjust the geographic scope using the `scope` argument to focus on specific regions such as "world", "usa", "europe," or "north american". Set the `center` argument for a better initial view, especially when scoping to a specific region. | ||
|
|
||
| ```python order=scatter_geo_plot,flights_table | ||
| import deephaven.plot.express as dx | ||
|
|
||
| # Load the flights dataset | ||
| # The speed_multiplier parameter speeds up the flight | ||
| flights_table = dx.data.flights(speed_multiplier=50) | ||
|
|
||
| # Use an orthographic (globe) projection and set scope to North America | ||
| # center is set for better initial view | ||
| scatter_geo_plot = dx.scatter_geo( | ||
| flights_table, | ||
| lat="Lat", | ||
| lon="Lon", | ||
| by="FlightId", | ||
| projection="orthographic", | ||
| scope="north america", | ||
| center=dx.data.FLIGHT_CENTER | ||
| ) | ||
| ``` | ||
|
|
||
| ## API Reference | ||
|
|
||
| ```{eval-rst} | ||
| .. dhautofunction:: deephaven.plot.express.scatter_geo | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.