Example Visualizations using CyberGIS-Vis¶
Documentations and Demos about CyberGIS-Vis are available at: https://github.com/cybergis/CyberGIS-Vis¶
Setup environment¶
In [3]:
import pandas as pd
import geopandas as gpd
from Adaptive_Choropleth_Mapper import Adaptive_Choropleth_Mapper_viz, Adaptive_Choropleth_Mapper_log
Visualizations for Exploring Relationship between data¶
Set input data: Socioeconomic and Demographic Data from LTDB¶
In [2]:
input_attributes = pd.read_csv("attributes/Los_Angeles_1980_1990_2000_2010.csv", dtype={'geoid':str})
input_attributes = input_attributes.rename(columns={'geoid': 'geoid', 'year': 'period'})
input_attributes
Out[2]:
geoid | period | n_asian_under_15 | n_black_under_15 | n_hispanic_under_15 | n_native_under_15 | n_white_under_15 | n_persons_under_18 | n_asian_over_60 | n_black_over_60 | ... | n_vietnamese_persons | n_widowed_divorced | n_white_persons | n_total_housing_units_sample | p_white_over_60 | p_black_over_60 | p_hispanic_over_60 | p_native_over_60 | p_asian_over_60 | p_disabled | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 06037101110 | 1980 | 4.512923 | 0.0 | 17.805532 | 3.938551 | 118.074478 | 159.429260 | 0.328213 | 0.0 | ... | 0.164106 | 72.042664 | NaN | 216.045944 | 11.362683 | 0.0 | 0.181691 | 0.000000 | 0.055905 | 4.416492 |
1 | 06037101122 | 1980 | 49.069336 | 0.0 | 193.180725 | 42.705280 | 1281.120850 | 1729.904922 | 3.555239 | 0.0 | ... | 1.795797 | 781.720006 | NaN | 2344.410583 | 11.367037 | 0.0 | 0.181974 | 0.000000 | 0.055802 | 4.420126 |
2 | 06037101210 | 1980 | 5.341171 | 0.0 | 143.240494 | 2.913366 | 473.907501 | 649.680603 | 2.913366 | 0.0 | ... | 2.427805 | 468.080780 | NaN | 1035.216064 | 11.672832 | 0.0 | 1.294698 | 0.184957 | 0.123305 | 9.103987 |
3 | 06037101220 | 1980 | 5.658829 | 0.0 | 151.759506 | 3.086634 | 502.092438 | 688.319336 | 3.086634 | 0.0 | ... | 2.572195 | 495.919190 | NaN | 1096.783936 | 11.672832 | 0.0 | 1.294698 | 0.184957 | 0.123305 | 9.103987 |
4 | 06037101300 | 1980 | 60.132671 | 0.0 | 100.549713 | 13.800941 | 691.032837 | 959.165405 | 0.000000 | 0.0 | ... | 5.914689 | 437.686981 | NaN | 1358.406860 | 13.719433 | 0.0 | 0.334620 | 0.000000 | 0.000000 | 6.383527 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
9361 | 06037980031 | 2010 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | NaN | NaN | ... | 0.000000 | 281.000000 | NaN | 25.000000 | NaN | NaN | NaN | NaN | NaN | NaN |
9362 | 06037980033 | 2010 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | NaN | NaN | ... | 0.000000 | 0.000000 | NaN | 0.000000 | NaN | NaN | NaN | NaN | NaN | NaN |
9363 | 06037990100 | 2010 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | NaN | NaN | ... | 0.000000 | 0.000000 | NaN | 0.000000 | NaN | NaN | NaN | NaN | NaN | NaN |
9364 | 06037990200 | 2010 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | NaN | NaN | ... | 0.000000 | 0.000000 | NaN | 0.000000 | NaN | NaN | NaN | NaN | NaN | NaN |
9365 | 06037990300 | 2010 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | NaN | NaN | ... | 0.000000 | 0.000000 | NaN | 0.000000 | NaN | NaN | NaN | NaN | NaN | NaN |
9366 rows × 192 columns
In [3]:
shapefile = gpd.read_file("shp/Los_Angeles_tract/Los_Angeles_2.shp")
shapefile = shapefile.rename(columns={'tractID': 'geoid', 'tract_key': 'name'})
shapefile
Out[3]:
geoid | name | geometry | |
---|---|---|---|
0 | 06037101110 | 101110 | POLYGON ((-118.29792 34.26322, -118.29696 34.2... |
1 | 06037101122 | 101122 | POLYGON ((-118.29697 34.27881, -118.29410 34.2... |
2 | 06037101210 | 101210 | POLYGON ((-118.29945 34.25598, -118.29792 34.2... |
3 | 06037101220 | 101220 | POLYGON ((-118.27610 34.24648, -118.27618 34.2... |
4 | 06037101300 | 101300 | POLYGON ((-118.26602 34.24036, -118.26657 34.2... |
... | ... | ... | ... |
2339 | 06037920108 | 920108 | POLYGON ((-118.55944 34.44441, -118.55957 34.4... |
2340 | 06037920200 | 920200 | POLYGON ((-118.57207 34.47017, -118.57211 34.4... |
2341 | 06037990100 | 990100 | POLYGON ((-118.94518 34.04309, -118.93753 34.0... |
2342 | 06037990200 | 990200 | POLYGON ((-118.42545 33.76085, -118.42816 33.7... |
2343 | 06037990300 | 990300 | POLYGON ((-118.24463 33.71077, -118.24457 33.7... |
2344 rows × 3 columns
Adaptive Choropleth Map Only¶
In [4]:
param_Stacked = {
'title': "Adaptive Choropleth Mapper with Stacked Chart",
'filename_suffix': "LA",
'inputCSV': input_attributes,
'shapefile': shapefile,
'periods': [1980, 1990, 2000, 2010],
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'variables': [ # Enter variable names of the column you entered above.
"p_nonhisp_white_persons",
"p_nonhisp_black_persons",
"p_hispanic_persons",
"p_asian_persons",
"p_employed_manufacturing",
"p_poverty_rate",
"p_foreign_born_pop",
"p_persons_under_18",
"p_persons_over_60",
"p_edu_college_greater",
"p_unemployment_rate",
"p_employed_professional",
"p_vacant_housing_units",
"p_owner_occupied_units",
"p_housing_units_multiunit_structures",
"median_home_value",
"p_structures_30_old",
"p_household_recent_move",
],
'NumOfMaps': 4,
'SortLayers': "temporal", # Enter “compare” or “temporal”. compare mode is for comparing variables at a specific point of time.
# temporal mode is for displaying spatiotemporal patterns of the same variable using multiple maps.
'InitialLayers':["1980_% nonhisp white persons", "1990_% nonhisp white persons", "2000_% nonhisp white persons", "2010_% nonhisp white persons"],
'Map_width':"350px",
'Map_height':"350px",
'Stacked_Chart': False, #Comment out if you do not want to visualize this chart
}
Adaptive_Choropleth_Mapper_viz(param_Stacked)
Adaptive_Choropleth_Mapper_log(param_Stacked)
output directory : ACM_LA To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA/data/CONFIG_LA.js
Adaptive Choropleth Mapper with Stacked Chart¶
In [5]:
param_Stacked = {
'title': "Adaptive Choropleth Mapper with Stacked Chart",
'filename_suffix': "LA_Stacked",
'inputCSV': input_attributes,
'shapefile': shapefile,
'periods': [1980, 1990, 2000, 2010],
'NumOfMaps': 4,
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'variables': [ # Enter variable names of the column you entered above.
"p_nonhisp_white_persons",
"p_nonhisp_black_persons",
"p_hispanic_persons",
"p_asian_persons",
"p_employed_manufacturing",
"p_poverty_rate",
"p_foreign_born_pop",
"p_persons_under_18",
"p_persons_over_60",
"p_edu_college_greater",
"p_unemployment_rate",
"p_employed_professional",
"p_vacant_housing_units",
"p_owner_occupied_units",
"p_housing_units_multiunit_structures",
"median_home_value",
"p_structures_30_old",
"p_household_recent_move",
],
'NumOfMaps': 4,
'SortLayers': "temporal", # Enter “compare” or “temporal”. compare mode is for comparing variables at a specific point of time.
# temporal mode is for displaying spatiotemporal patterns of the same variable using multiple maps.
'InitialLayers':["1980_% nonhisp white persons", "1990_% nonhisp white persons", "2000_% nonhisp white persons", "2010_% nonhisp white persons"],
'Map_width':"350px",
'Map_height':"350px",
'Stacked_Chart': True, #Comment out if you do not want to visualize this chart
}
Adaptive_Choropleth_Mapper_viz(param_Stacked)
Adaptive_Choropleth_Mapper_log(param_Stacked)
output directory : ACM_LA_Stacked To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Stacked/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Stacked/data/CONFIG_LA_Stacked.js
Adaptive Choropleth Mapper with Top 10 Bar Chart¶
In [6]:
param_bar = {
'title': "Adaptive Choropleth Mapper with Top 10 Bar Chart",
'filename_suffix': "LA_bar",
'inputCSV': input_attributes,
'shapefile': shapefile,
'periods': [1980, 1990, 2000, 2010],
'NumOfMaps': 3,
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'variables': [ #enter variable names of the column you entered above.
"p_other_language",
"p_female_headed_families",
"per_capita_income",
],
'Top10_Chart': True, #Comment out if you do not want to visualize this chart
}
Adaptive_Choropleth_Mapper_viz(param_bar)
Adaptive_Choropleth_Mapper_log(param_bar)
output directory : ACM_LA_bar To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_bar/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_bar/data/CONFIG_LA_bar.js
Adaptive Choropleth Mapper with Scatter Plot¶
In [7]:
param_Scatter = {
'title': "Adaptive Choropleth Mapper with Scatter Plot",
'filename_suffix': "LA_Scatter",
'inputCSV': input_attributes,
'shapefile': shapefile,
'periods': [2010],
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'variables': [ #enter variable names of the column you entered above.
"p_nonhisp_white_persons",
"p_nonhisp_black_persons",
"p_hispanic_persons",
"p_asian_persons",
"p_foreign_born_pop",
"p_edu_college_greater",
"p_unemployment_rate",
"p_employed_manufacturing",
"p_poverty_rate",
"p_vacant_housing_units",
"p_owner_occupied_units",
"p_housing_units_multiunit_structures",
"median_home_value",
"p_structures_30_old",
"p_household_recent_move",
"p_persons_under_18",
"p_persons_over_60",
],
'InitialLayers':["2010_% edu college greater", "2010_% employed manufacturing" ],
'Map_width':"470px",
'Map_height':"450px",
'Scatter_Plot': True,
}
Adaptive_Choropleth_Mapper_viz(param_Scatter)
Adaptive_Choropleth_Mapper_log(param_Scatter)
output directory : ACM_LA_Scatter To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Scatter/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Scatter/data/CONFIG_LA_Scatter.js
Adaptive Choropleth Mapper with Correlogram¶
In [8]:
param_Correlogram = {
'title': "Adaptive Choropleth Mapper with Correlogram",
'filename_suffix': "LA_Correlogram",
'inputCSV': input_attributes,
'shapefile': shapefile,
'NumOfMaps':6,
'periods': [2010],
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'variables': [ #enter variable names of the column you entered above.
"p_nonhisp_white_persons",
"p_nonhisp_black_persons",
"p_hispanic_persons",
"p_asian_persons",
"p_foreign_born_pop",
"p_edu_college_greater",
"p_unemployment_rate",
"p_employed_manufacturing",
"p_poverty_rate",
"p_vacant_housing_units",
"p_owner_occupied_units",
"p_housing_units_multiunit_structures",
"median_home_value",
"p_structures_30_old",
"p_household_recent_move",
"p_persons_under_18",
"p_persons_over_60",
],
'Map_width':"350px",
'Map_height':"350px",
'Correlogram': True,
}
Adaptive_Choropleth_Mapper_viz(param_Correlogram)
Adaptive_Choropleth_Mapper_log(param_Correlogram)
output directory : ACM_LA_Correlogram To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Correlogram/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Correlogram/data/CONFIG_LA_Correlogram.js
Adaptive Choropleth Mapper with Parallel Coordinate Plot (PCP) to visulize relationship between variables.¶
In [9]:
param_PCP = {
'title': "Adaptive Choropleth Mapper with Paralle Coordinate Plot",
'filename_suffix': "Census_PCP", # max 30 character
'inputCSV': input_attributes,
'shapefile': shapefile,
'periods': [2010],
'variables': [ #enter variable names of the column you entered above.
"p_nonhisp_white_persons",
"p_nonhisp_black_persons",
"p_hispanic_persons",
"p_asian_persons",
"p_employed_manufacturing",
"p_poverty_rate",
"p_foreign_born_pop",
"p_persons_under_18",
"p_persons_over_60",
"p_edu_college_greater",
"p_unemployment_rate",
"p_employed_professional",
"p_vacant_housing_units",
"p_owner_occupied_units",
"p_housing_units_multiunit_structures",
"median_home_value",
"p_structures_30_old",
"p_household_recent_move",
],
'shortLabelCSV': "attributes/LTDB_ShortLabel.csv",
'NumOfMaps':4,
'Map_width':"350px",
'Map_height':"350px",
'Top10_Chart': True,
'Parallel_Coordinates_Plot': True,
'NumOfPCP':4,
'InitialVariablePCP': ["2010_% white (non-Hispanic)", "2010_% black (non-Hispanic)", "2010_% Hispanic", "2010_% Asian & PI race", "2010_% professional employees", "2010_% manufacturing employees", "2010_% in poverty", "2010_% foreign born", "2010_% 17 and under (total)", "2010_% 60 and older"]
}
Adaptive_Choropleth_Mapper_viz(param_PCP)
Adaptive_Choropleth_Mapper_log(param_PCP)
output directory : ACM_Census_PCP To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Census_PCP/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Census_PCP/data/CONFIG_Census_PCP.js
Visualizations for Spatiotemporal Data¶
Set input data: COVID-19 data and the number of visits estimated based on Twitter data¶
In [7]:
Covid_Visits = pd.read_csv("attributes/Covid_Visits.csv", dtype={'geoid':str})
Covid_Visits = Covid_Visits.rename(columns={'geoid': 'geoid'})
Covid_Visits
Out[7]:
geoid | period | Confirmed Rate | Death Rate | The Number of Visits from Outside to Inside of the selected MSA | |
---|---|---|---|---|---|
0 | 1 | 2020-02-16 | 0 | 0 | 26 |
1 | 2 | 2020-02-16 | 0 | 0 | 52 |
2 | 3 | 2020-02-16 | 0 | 0 | 60 |
3 | 4 | 2020-02-16 | 0 | 0 | 42 |
4 | 5 | 2020-02-16 | 0 | 0 | 25 |
... | ... | ... | ... | ... | ... |
53723 | 48260 | 2020-12-27 | -9999 | -9999 | 21 |
53724 | 48300 | 2020-12-27 | -9999 | -9999 | 50 |
53725 | 48460 | 2020-12-27 | -9999 | -9999 | 4 |
53726 | 48540 | 2020-12-27 | -9999 | -9999 | 36 |
53727 | 48580 | 2020-12-27 | -9999 | -9999 | 35 |
53728 rows × 5 columns
In [8]:
shapefile_MSA = gpd.read_file("shp/MSA_country/MSA_US.shp", dtype={'GEOID':str})
shapefile_MSA = shapefile_MSA.rename(columns={'GEOID': 'geoid', 'NAME_1':'name'})
shapefile_MSA
Out[8]:
geoid | name | region | LON | LAT | ISO3 | ISO3_1 | Shape_Leng | Shape_Area | geometry | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 12660 | Baraboo, WI | WI | -89.95 | 43.43 | 12660 | None | 2.322364 | 0.244303 | POLYGON ((-90.31241 43.64100, -90.29665 43.641... |
1 | 38300 | Pittsburgh, PA | PA | -79.83 | 40.44 | 38300 | None | 7.137698 | 1.468706 | POLYGON ((-80.51922 39.96243, -80.51921 39.963... |
2 | 17460 | Cleveland-Elyria, OH | OH | -81.68 | 41.38 | 17460 | None | 4.210584 | 0.562277 | POLYGON ((-82.34808 41.42840, -82.34412 41.429... |
3 | 38920 | Port Lavaca, TX | TX | -96.64 | 28.50 | 38920 | None | 3.901207 | 0.136378 | MULTIPOLYGON (((-96.38985 28.38963, -96.38527 ... |
4 | 48660 | Wichita Falls, TX | TX | -98.49 | 33.77 | 48660 | None | 3.937540 | 0.674297 | POLYGON ((-98.95383 33.49638, -98.95378 33.531... |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
924 | 12980 | Battle Creek, MI | MI | -85.01 | 42.25 | 12980 | None | 1.864599 | 0.202977 | POLYGON ((-85.29888 42.41986, -85.27795 42.419... |
925 | 22020 | Fargo, ND-MN | ND-MN | -96.97 | 46.92 | 22020 | None | 4.492438 | 0.862697 | POLYGON ((-97.70619 46.99107, -97.70602 46.992... |
926 | 11580 | Arcadia, FL | FL | -81.81 | 27.19 | 11580 | None | 1.604625 | 0.150757 | POLYGON ((-82.05752 27.07649, -82.05738 27.119... |
927 | 14700 | Branson, MO | MO | -93.22 | 36.70 | 14700 | None | 2.681764 | 0.303571 | POLYGON ((-93.61287 36.82587, -93.61278 36.834... |
928 | 24100 | Gloversville, NY | NY | -74.42 | 43.11 | 24100 | None | 1.936258 | 0.152618 | POLYGON ((-74.77423 43.08228, -74.77374 43.083... |
929 rows × 10 columns
Adaptive Choropleth Mapper with Multiple Line Chart (MLC)¶
In [9]:
param_MLC_COVID = {
'title': "Covid-19 Risk Assessment using Twitter, Metropolitan Statistical Areas, USA",
'Subject': "Temporal Patterns of COVID-19 Risk Factors",
'filename_suffix': "Mobility_MLC", # max 30 character
'inputCSV': Covid_Visits,
'shapefile': shapefile_MSA,
'periods': "All",
'variables': [ #enter variable names of the column you entered above.
"Confirmed Rate",
"Death Rate",
"The Number of Visits from Outside to Inside of the selected MSA"
],
'NumOfMaps':2,
'InitialLayers':["2020-03-15_Confirmed Rate" , "2020-12-27_Confirmed Rate"],
'Initial_map_center':[37, -97],
'Initial_map_zoom_level':4,
'Map_width':"650px",
'Map_height':"400px",
'Top10_Chart': True,
'Multiple_Line_Chart': True,
'NumOfMLC':3,
'titlesOfMLC':["1. COVID-19 Confirmed Cases (/100k pop)", "2. COVID-19 Death Cases (/100k pop)", "3. The Number of Visits from Outside to Inside of the selected MSA"],
'DefaultRegion_MLC':"35620"
}
Adaptive_Choropleth_Mapper_viz(param_MLC_COVID)
Adaptive_Choropleth_Mapper_log(param_MLC_COVID)
/cvmfs/cybergis.illinois.edu/software/conda/cybergisx/python3-0.9.4/lib/python3.8/site-packages/pandas/core/dtypes/cast.py:1542: ShapelyDeprecationWarning: __len__ for multi-part geometries is deprecated and will be removed in Shapely 2.0. Check the length of the `geoms` property instead to get the number of parts of a multi-part geometry. result[:] = values
output directory : ACM_Mobility_MLC To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Mobility_MLC/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Mobility_MLC/data/CONFIG_Mobility_MLC.js
Adaptive Choropleth Mapper with Comparison Line Chart (CLC)¶
In [10]:
param_CLC_COVID = {
'title': "Comparison of COVID-19 Confirmed Rate between Metropolitan Statistical Areas, USA",
'Subject': "Temporal Patterns of COVID-19 Confirmed Rate",
'filename_suffix': "Mobility_CLC", # max 30 character
'inputCSV': Covid_Visits,
'shapefile': shapefile_MSA,
'periods': "All",
'variables': [ #enter variable names of the column you entered above.
"Confirmed Rate"
],
'NumOfMaps':2,
'InitialLayers':["2020-04-19_Confirmed Rate" , "2020-11-01_Confirmed Rate"],
'Initial_map_center':[37, -97],
'Initial_map_zoom_level':4,
'Map_width':"650px",
'Map_height':"400px",
'Top10_Chart': True,
'Comparision_Chart': True,
'NumOfCLC': 46,
'DefaultRegion_CLC': ["35620", "16980"]
}
Adaptive_Choropleth_Mapper_viz(param_CLC_COVID)
Adaptive_Choropleth_Mapper_log(param_CLC_COVID)
output directory : ACM_Mobility_CLC To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Mobility_CLC/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Mobility_CLC/data/CONFIG_Mobility_CLC.js
More Examples¶
Set input data: HIV data¶
In [5]:
input_attributes_hiv = pd.read_csv("attributes/HIV_US_multiple_long.csv", dtype={'geoid':str})
input_attributes_hiv = input_attributes_hiv.rename(columns={'geoid': 'geoid'})
input_attributes_hiv
Out[5]:
geoid | period | Health Care Center (/100k pop) | HIV | |
---|---|---|---|---|
0 | 1001 | 2012 | 3.796153 | 15.50 |
1 | 1003 | 2012 | 2.507915 | 7.50 |
2 | 1005 | 2012 | 6.641990 | 14.71 |
3 | 1007 | 2012 | 4.207311 | 17.70 |
4 | 1009 | 2012 | 2.630077 | 6.92 |
... | ... | ... | ... | ... |
21954 | 56037 | 2018 | 4.474590 | 9.15 |
21955 | 56039 | 2018 | 0.265288 | 17.17 |
21956 | 56041 | 2018 | 4.603247 | 0.00 |
21957 | 56043 | 2018 | 7.180956 | 0.00 |
21958 | 56045 | 2018 | 0.265288 | 0.00 |
21959 rows × 4 columns
In [6]:
shapefile_us = gpd.read_file("shp/US/counties.shp")
shapefile_us
Out[6]:
geoid | name | geometry | |
---|---|---|---|
0 | 2013 | Aleutians East,AK | MULTIPOLYGON (((-162.63769 54.80112, -162.6440... |
1 | 2016 | Aleutians West,AK | MULTIPOLYGON (((177.44593 52.11133, 177.44302 ... |
2 | 28107 | Panola,MS | POLYGON ((-90.19854 34.51109, -90.19863 34.554... |
3 | 28101 | Newton,MS | POLYGON ((-88.91452 32.57695, -88.91559 32.558... |
4 | 28027 | Coahoma,MS | POLYGON ((-90.65700 33.98759, -90.66036 33.987... |
... | ... | ... | ... |
3216 | 27057 | Hubbard,MN | POLYGON ((-95.16917 47.15252, -95.16909 47.182... |
3217 | 27169 | Winona,MN | POLYGON ((-92.07949 44.10699, -92.07921 44.117... |
3218 | 2270 | None | POLYGON ((-160.85114 63.01269, -160.85156 62.9... |
3219 | 51515 | None | POLYGON ((-79.54339 37.32615, -79.54230 37.334... |
3220 | 46113 | None | POLYGON ((-102.79211 42.99998, -102.86790 42.9... |
3221 rows × 3 columns
Adaptive Choropleth Mapper with Parallel Coordinate Plot (PCP) for Time Series Visualization¶
In [7]:
param_PCP_hiv = {
'title': "Adaptive Choropleth Mapper with Paralle Coordinate Plot",
'filename_suffix': "HIV_PCP", # max 30 character
'inputCSV': input_attributes_hiv,
'shapefile': shapefile_us,
'periods': [2012, 2013, 2014, 2015, 2016, 2017, 2018],
'variables': [ #enter variable names of the column you entered above.
"HIV",
#"Health Care Center (/100k pop)"
],
'NumOfMaps':2,
'Initial_map_center':[37, -97],
'Initial_map_zoom_level':4,
'Map_width':"650px",
'Map_height':"410px",
'Top10_Chart': True,
'Parallel_Coordinates_Plot': True,
'NumOfPCP':7,
}
Adaptive_Choropleth_Mapper_viz(param_PCP_hiv)
Adaptive_Choropleth_Mapper_log(param_PCP_hiv)
/cvmfs/cybergis.illinois.edu/software/conda/cybergisx/python3-0.9.4/lib/python3.8/site-packages/pandas/core/dtypes/cast.py:1542: ShapelyDeprecationWarning: __len__ for multi-part geometries is deprecated and will be removed in Shapely 2.0. Check the length of the `geoms` property instead to get the number of parts of a multi-part geometry. result[:] = values
output directory : ACM_HIV_PCP To see your visualization, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_HIV_PCP/index.html To access all visualizations that you have created, click the URL below (or locate the files): https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html Advanced options are available in https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_HIV_PCP/data/CONFIG_HIV_PCP.js