{ "cells": [ { "cell_type": "markdown", "id": "e8abbdd5", "metadata": {}, "source": [ "# Example Visualizations using CyberGIS-Vis" ] }, { "cell_type": "markdown", "id": "66bde9ed", "metadata": {}, "source": [ "#### Documentations and Demos about CyberGIS-Vis are available at: https://github.com/cybergis/CyberGIS-Vis" ] }, { "cell_type": "markdown", "id": "787d719f", "metadata": {}, "source": [ "## Setup environment" ] }, { "cell_type": "code", "execution_count": 1, "id": "4eaef78c-e842-413e-91a7-3ad2fcf5039e", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import geopandas as gpd\n", "from Adaptive_Choropleth_Mapper import Adaptive_Choropleth_Mapper_viz, Adaptive_Choropleth_Mapper_log" ] }, { "cell_type": "markdown", "id": "a545f40b-dd42-427d-b36b-c7151e4c8a13", "metadata": {}, "source": [ "## Visualizations for Exploring Relationship between data" ] }, { "cell_type": "markdown", "id": "69e7203c", "metadata": { "tags": [] }, "source": [ "### Set input data: Socioeconomic and Demographic Data from LTDB" ] }, { "cell_type": "code", "execution_count": 2, "id": "250cfd6b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidperiodn_asian_under_15n_black_under_15n_hispanic_under_15n_native_under_15n_white_under_15n_persons_under_18n_asian_over_60n_black_over_60...n_vietnamese_personsn_widowed_divorcedn_white_personsn_total_housing_units_samplep_white_over_60p_black_over_60p_hispanic_over_60p_native_over_60p_asian_over_60p_disabled
00603710111019804.5129230.017.8055323.938551118.074478159.4292600.3282130.0...0.16410672.042664NaN216.04594411.3626830.00.1816910.0000000.0559054.416492
106037101122198049.0693360.0193.18072542.7052801281.1208501729.9049223.5552390.0...1.795797781.720006NaN2344.41058311.3670370.00.1819740.0000000.0558024.420126
20603710121019805.3411710.0143.2404942.913366473.907501649.6806032.9133660.0...2.427805468.080780NaN1035.21606411.6728320.01.2946980.1849570.1233059.103987
30603710122019805.6588290.0151.7595063.086634502.092438688.3193363.0866340.0...2.572195495.919190NaN1096.78393611.6728320.01.2946980.1849570.1233059.103987
406037101300198060.1326710.0100.54971313.800941691.032837959.1654050.0000000.0...5.914689437.686981NaN1358.40686013.7194330.00.3346200.0000000.0000006.383527
..................................................................
93610603798003120100.0000000.00.0000000.0000000.0000000.000000NaNNaN...0.000000281.000000NaN25.000000NaNNaNNaNNaNNaNNaN
93620603798003320100.0000000.00.0000000.0000000.0000000.000000NaNNaN...0.0000000.000000NaN0.000000NaNNaNNaNNaNNaNNaN
93630603799010020100.0000000.00.0000000.0000000.0000000.000000NaNNaN...0.0000000.000000NaN0.000000NaNNaNNaNNaNNaNNaN
93640603799020020100.0000000.00.0000000.0000000.0000000.000000NaNNaN...0.0000000.000000NaN0.000000NaNNaNNaNNaNNaNNaN
93650603799030020100.0000000.00.0000000.0000000.0000000.000000NaNNaN...0.0000000.000000NaN0.000000NaNNaNNaNNaNNaNNaN
\n", "

9366 rows × 192 columns

\n", "
" ], "text/plain": [ " geoid period n_asian_under_15 n_black_under_15 \\\n", "0 06037101110 1980 4.512923 0.0 \n", "1 06037101122 1980 49.069336 0.0 \n", "2 06037101210 1980 5.341171 0.0 \n", "3 06037101220 1980 5.658829 0.0 \n", "4 06037101300 1980 60.132671 0.0 \n", "... ... ... ... ... \n", "9361 06037980031 2010 0.000000 0.0 \n", "9362 06037980033 2010 0.000000 0.0 \n", "9363 06037990100 2010 0.000000 0.0 \n", "9364 06037990200 2010 0.000000 0.0 \n", "9365 06037990300 2010 0.000000 0.0 \n", "\n", " n_hispanic_under_15 n_native_under_15 n_white_under_15 \\\n", "0 17.805532 3.938551 118.074478 \n", "1 193.180725 42.705280 1281.120850 \n", "2 143.240494 2.913366 473.907501 \n", "3 151.759506 3.086634 502.092438 \n", "4 100.549713 13.800941 691.032837 \n", "... ... ... ... \n", "9361 0.000000 0.000000 0.000000 \n", "9362 0.000000 0.000000 0.000000 \n", "9363 0.000000 0.000000 0.000000 \n", "9364 0.000000 0.000000 0.000000 \n", "9365 0.000000 0.000000 0.000000 \n", "\n", " n_persons_under_18 n_asian_over_60 n_black_over_60 ... \\\n", "0 159.429260 0.328213 0.0 ... \n", "1 1729.904922 3.555239 0.0 ... \n", "2 649.680603 2.913366 0.0 ... \n", "3 688.319336 3.086634 0.0 ... \n", "4 959.165405 0.000000 0.0 ... \n", "... ... ... ... ... \n", "9361 0.000000 NaN NaN ... \n", "9362 0.000000 NaN NaN ... \n", "9363 0.000000 NaN NaN ... \n", "9364 0.000000 NaN NaN ... \n", "9365 0.000000 NaN NaN ... \n", "\n", " n_vietnamese_persons n_widowed_divorced n_white_persons \\\n", "0 0.164106 72.042664 NaN \n", "1 1.795797 781.720006 NaN \n", "2 2.427805 468.080780 NaN \n", "3 2.572195 495.919190 NaN \n", "4 5.914689 437.686981 NaN \n", "... ... ... ... \n", "9361 0.000000 281.000000 NaN \n", "9362 0.000000 0.000000 NaN \n", "9363 0.000000 0.000000 NaN \n", "9364 0.000000 0.000000 NaN \n", "9365 0.000000 0.000000 NaN \n", "\n", " n_total_housing_units_sample p_white_over_60 p_black_over_60 \\\n", "0 216.045944 11.362683 0.0 \n", "1 2344.410583 11.367037 0.0 \n", "2 1035.216064 11.672832 0.0 \n", "3 1096.783936 11.672832 0.0 \n", "4 1358.406860 13.719433 0.0 \n", "... ... ... ... \n", "9361 25.000000 NaN NaN \n", "9362 0.000000 NaN NaN \n", "9363 0.000000 NaN NaN \n", "9364 0.000000 NaN NaN \n", "9365 0.000000 NaN NaN \n", "\n", " p_hispanic_over_60 p_native_over_60 p_asian_over_60 p_disabled \n", "0 0.181691 0.000000 0.055905 4.416492 \n", "1 0.181974 0.000000 0.055802 4.420126 \n", "2 1.294698 0.184957 0.123305 9.103987 \n", "3 1.294698 0.184957 0.123305 9.103987 \n", "4 0.334620 0.000000 0.000000 6.383527 \n", "... ... ... ... ... \n", "9361 NaN NaN NaN NaN \n", "9362 NaN NaN NaN NaN \n", "9363 NaN NaN NaN NaN \n", "9364 NaN NaN NaN NaN \n", "9365 NaN NaN NaN NaN \n", "\n", "[9366 rows x 192 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "input_attributes = pd.read_csv(\"attributes/Los_Angeles_1980_1990_2000_2010.csv\", dtype={'geoid':str})\n", "input_attributes = input_attributes.rename(columns={'geoid': 'geoid', 'year': 'period'})\n", "input_attributes" ] }, { "cell_type": "code", "execution_count": 3, "id": "32474e42", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidnamegeometry
006037101110101110POLYGON ((-118.29792 34.26322, -118.29696 34.2...
106037101122101122POLYGON ((-118.29697 34.27881, -118.29410 34.2...
206037101210101210POLYGON ((-118.29945 34.25598, -118.29792 34.2...
306037101220101220POLYGON ((-118.27610 34.24648, -118.27618 34.2...
406037101300101300POLYGON ((-118.26602 34.24036, -118.26657 34.2...
............
233906037920108920108POLYGON ((-118.55944 34.44441, -118.55957 34.4...
234006037920200920200POLYGON ((-118.57207 34.47017, -118.57211 34.4...
234106037990100990100POLYGON ((-118.94518 34.04309, -118.93753 34.0...
234206037990200990200POLYGON ((-118.42545 33.76085, -118.42816 33.7...
234306037990300990300POLYGON ((-118.24463 33.71077, -118.24457 33.7...
\n", "

2344 rows × 3 columns

\n", "
" ], "text/plain": [ " geoid name geometry\n", "0 06037101110 101110 POLYGON ((-118.29792 34.26322, -118.29696 34.2...\n", "1 06037101122 101122 POLYGON ((-118.29697 34.27881, -118.29410 34.2...\n", "2 06037101210 101210 POLYGON ((-118.29945 34.25598, -118.29792 34.2...\n", "3 06037101220 101220 POLYGON ((-118.27610 34.24648, -118.27618 34.2...\n", "4 06037101300 101300 POLYGON ((-118.26602 34.24036, -118.26657 34.2...\n", "... ... ... ...\n", "2339 06037920108 920108 POLYGON ((-118.55944 34.44441, -118.55957 34.4...\n", "2340 06037920200 920200 POLYGON ((-118.57207 34.47017, -118.57211 34.4...\n", "2341 06037990100 990100 POLYGON ((-118.94518 34.04309, -118.93753 34.0...\n", "2342 06037990200 990200 POLYGON ((-118.42545 33.76085, -118.42816 33.7...\n", "2343 06037990300 990300 POLYGON ((-118.24463 33.71077, -118.24457 33.7...\n", "\n", "[2344 rows x 3 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shapefile = gpd.read_file(\"shp/Los_Angeles_tract/Los_Angeles_2.shp\")\n", "shapefile = shapefile.rename(columns={'tractID': 'geoid', 'tract_key': 'name'})\n", "shapefile" ] }, { "cell_type": "markdown", "id": "ef7e04d3", "metadata": {}, "source": [ "### Adaptive Choropleth Map Only" ] }, { "cell_type": "code", "execution_count": 4, "id": "bfa66fa7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_LA\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA/data/CONFIG_LA.js\n" ] } ], "source": [ "param_Stacked = {\n", " 'title': \"Adaptive Choropleth Mapper with Stacked Chart\",\n", " 'filename_suffix': \"LA\",\n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile,\n", " 'periods': [1980, 1990, 2000, 2010],\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\", \n", " 'variables': [ # Enter variable names of the column you entered above.\n", " \"p_nonhisp_white_persons\",\n", " \"p_nonhisp_black_persons\",\n", " \"p_hispanic_persons\",\n", " \"p_asian_persons\",\n", " \"p_employed_manufacturing\",\n", " \"p_poverty_rate\",\n", " \"p_foreign_born_pop\",\n", " \"p_persons_under_18\",\n", " \"p_persons_over_60\", \n", " \"p_edu_college_greater\",\n", " \"p_unemployment_rate\",\n", " \"p_employed_professional\",\n", " \"p_vacant_housing_units\",\n", " \"p_owner_occupied_units\",\n", " \"p_housing_units_multiunit_structures\",\n", " \"median_home_value\",\n", " \"p_structures_30_old\",\n", " \"p_household_recent_move\",\n", " ],\n", " 'NumOfMaps': 4,\n", " 'SortLayers': \"temporal\", # Enter “compare” or “temporal”. compare mode is for comparing variables at a specific point of time.\n", " # temporal mode is for displaying spatiotemporal patterns of the same variable using multiple maps. \n", " 'InitialLayers':[\"1980_% nonhisp white persons\", \"1990_% nonhisp white persons\", \"2000_% nonhisp white persons\", \"2010_% nonhisp white persons\"], \n", " 'Map_width':\"350px\",\n", " 'Map_height':\"350px\", \n", " 'Stacked_Chart': False, #Comment out if you do not want to visualize this chart \n", "} \n", "Adaptive_Choropleth_Mapper_viz(param_Stacked)\n", "Adaptive_Choropleth_Mapper_log(param_Stacked)" ] }, { "cell_type": "markdown", "id": "56be27cd", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Stacked Chart" ] }, { "cell_type": "code", "execution_count": 5, "id": "0c3d2c63", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_LA_Stacked\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Stacked/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Stacked/data/CONFIG_LA_Stacked.js\n" ] } ], "source": [ "param_Stacked = {\n", " 'title': \"Adaptive Choropleth Mapper with Stacked Chart\",\n", " 'filename_suffix': \"LA_Stacked\",\n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile,\n", " 'periods': [1980, 1990, 2000, 2010],\n", " 'NumOfMaps': 4,\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\", \n", " 'variables': [ # Enter variable names of the column you entered above.\n", " \"p_nonhisp_white_persons\",\n", " \"p_nonhisp_black_persons\",\n", " \"p_hispanic_persons\",\n", " \"p_asian_persons\",\n", " \"p_employed_manufacturing\",\n", " \"p_poverty_rate\",\n", " \"p_foreign_born_pop\",\n", " \"p_persons_under_18\",\n", " \"p_persons_over_60\", \n", " \"p_edu_college_greater\",\n", " \"p_unemployment_rate\",\n", " \"p_employed_professional\",\n", " \"p_vacant_housing_units\",\n", " \"p_owner_occupied_units\",\n", " \"p_housing_units_multiunit_structures\",\n", " \"median_home_value\",\n", " \"p_structures_30_old\",\n", " \"p_household_recent_move\",\n", " ],\n", " 'NumOfMaps': 4,\n", " 'SortLayers': \"temporal\", # Enter “compare” or “temporal”. compare mode is for comparing variables at a specific point of time.\n", " # temporal mode is for displaying spatiotemporal patterns of the same variable using multiple maps. \n", " 'InitialLayers':[\"1980_% nonhisp white persons\", \"1990_% nonhisp white persons\", \"2000_% nonhisp white persons\", \"2010_% nonhisp white persons\"], \n", "\n", " 'Map_width':\"350px\",\n", " 'Map_height':\"350px\", \n", " 'Stacked_Chart': True, #Comment out if you do not want to visualize this chart \n", "} \n", "Adaptive_Choropleth_Mapper_viz(param_Stacked)\n", "Adaptive_Choropleth_Mapper_log(param_Stacked)" ] }, { "cell_type": "markdown", "id": "d22d95c6", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Top 10 Bar Chart" ] }, { "cell_type": "code", "execution_count": 6, "id": "fc756f85", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_LA_bar\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_bar/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_bar/data/CONFIG_LA_bar.js\n" ] } ], "source": [ "param_bar = {\n", " 'title': \"Adaptive Choropleth Mapper with Top 10 Bar Chart\",\n", " 'filename_suffix': \"LA_bar\",\n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile,\n", " 'periods': [1980, 1990, 2000, 2010],\n", " 'NumOfMaps': 3,\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\", \n", " 'variables': [ #enter variable names of the column you entered above. \n", " \"p_other_language\",\n", " \"p_female_headed_families\",\n", " \"per_capita_income\", \n", " ],\n", " 'Top10_Chart': True, #Comment out if you do not want to visualize this chart \n", "} \n", "Adaptive_Choropleth_Mapper_viz(param_bar)\n", "Adaptive_Choropleth_Mapper_log(param_bar)" ] }, { "cell_type": "markdown", "id": "80368e00", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Scatter Plot" ] }, { "cell_type": "code", "execution_count": 7, "id": "019f99e2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_LA_Scatter\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Scatter/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Scatter/data/CONFIG_LA_Scatter.js\n" ] } ], "source": [ "param_Scatter = {\n", " 'title': \"Adaptive Choropleth Mapper with Scatter Plot\",\n", " 'filename_suffix': \"LA_Scatter\",\n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile,\n", " 'periods': [2010],\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\", \n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"p_nonhisp_white_persons\",\n", " \"p_nonhisp_black_persons\",\n", " \"p_hispanic_persons\",\n", " \"p_asian_persons\",\n", " \"p_foreign_born_pop\",\n", " \"p_edu_college_greater\",\n", " \"p_unemployment_rate\",\n", " \"p_employed_manufacturing\",\n", " \"p_poverty_rate\",\n", " \"p_vacant_housing_units\",\n", " \"p_owner_occupied_units\",\n", " \"p_housing_units_multiunit_structures\",\n", " \"median_home_value\",\n", " \"p_structures_30_old\",\n", " \"p_household_recent_move\",\n", " \"p_persons_under_18\",\n", " \"p_persons_over_60\", \n", " ],\n", " 'InitialLayers':[\"2010_% edu college greater\", \"2010_% employed manufacturing\" ],\n", " 'Map_width':\"470px\",\n", " 'Map_height':\"450px\", \n", " 'Scatter_Plot': True, \n", "} \n", "Adaptive_Choropleth_Mapper_viz(param_Scatter)\n", "Adaptive_Choropleth_Mapper_log(param_Scatter) " ] }, { "cell_type": "markdown", "id": "df0dfe0d", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Correlogram" ] }, { "cell_type": "code", "execution_count": 8, "id": "b00c1dc6", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_LA_Correlogram\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Correlogram/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_LA_Correlogram/data/CONFIG_LA_Correlogram.js\n" ] } ], "source": [ "param_Correlogram = {\n", " 'title': \"Adaptive Choropleth Mapper with Correlogram\",\n", " 'filename_suffix': \"LA_Correlogram\",\n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile,\n", " 'NumOfMaps':6,\n", " 'periods': [2010],\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\", \n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"p_nonhisp_white_persons\",\n", " \"p_nonhisp_black_persons\",\n", " \"p_hispanic_persons\",\n", " \"p_asian_persons\",\n", " \"p_foreign_born_pop\",\n", " \"p_edu_college_greater\",\n", " \"p_unemployment_rate\",\n", " \"p_employed_manufacturing\",\n", " \"p_poverty_rate\",\n", " \"p_vacant_housing_units\",\n", " \"p_owner_occupied_units\",\n", " \"p_housing_units_multiunit_structures\",\n", " \"median_home_value\",\n", " \"p_structures_30_old\",\n", " \"p_household_recent_move\",\n", " \"p_persons_under_18\",\n", " \"p_persons_over_60\", \n", " ],\n", " 'Map_width':\"350px\",\n", " 'Map_height':\"350px\",\n", " 'Correlogram': True, \n", "} \n", "Adaptive_Choropleth_Mapper_viz(param_Correlogram)\n", "Adaptive_Choropleth_Mapper_log(param_Correlogram) " ] }, { "cell_type": "markdown", "id": "b036e427-1236-43a9-829a-556b47edc636", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Parallel Coordinate Plot (PCP) to visulize relationship between variables." ] }, { "cell_type": "code", "execution_count": 9, "id": "7c0d50cb-e95a-4717-bb72-0661e36d27ed", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_Census_PCP\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Census_PCP/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_Census_PCP/data/CONFIG_Census_PCP.js\n" ] } ], "source": [ "param_PCP = {\n", " 'title': \"Adaptive Choropleth Mapper with Paralle Coordinate Plot\",\n", " 'filename_suffix': \"Census_PCP\", # max 30 character \n", " 'inputCSV': input_attributes, \n", " 'shapefile': shapefile, \n", " 'periods': [2010],\n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"p_nonhisp_white_persons\",\n", " \"p_nonhisp_black_persons\",\n", " \"p_hispanic_persons\",\n", " \"p_asian_persons\",\n", " \"p_employed_manufacturing\",\n", " \"p_poverty_rate\",\n", " \"p_foreign_born_pop\",\n", " \"p_persons_under_18\",\n", " \"p_persons_over_60\", \n", " \"p_edu_college_greater\",\n", " \"p_unemployment_rate\",\n", " \"p_employed_professional\",\n", " \"p_vacant_housing_units\",\n", " \"p_owner_occupied_units\",\n", " \"p_housing_units_multiunit_structures\",\n", " \"median_home_value\",\n", " \"p_structures_30_old\",\n", " \"p_household_recent_move\",\n", " \n", " ],\n", " 'shortLabelCSV': \"attributes/LTDB_ShortLabel.csv\",\n", " 'NumOfMaps':4,\n", " 'Map_width':\"350px\",\n", " 'Map_height':\"350px\", \n", " 'Top10_Chart': True, \n", " 'Parallel_Coordinates_Plot': True,\n", " 'NumOfPCP':4,\n", " '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\"]\n", "}\n", "Adaptive_Choropleth_Mapper_viz(param_PCP)\n", "Adaptive_Choropleth_Mapper_log(param_PCP) " ] }, { "cell_type": "markdown", "id": "3d9bbb46", "metadata": {}, "source": [ "## Visualizations for Spatiotemporal Data" ] }, { "cell_type": "markdown", "id": "68f04b06-abad-44cf-9ce8-6baab80a4955", "metadata": {}, "source": [ "### Set input data: COVID-19 data and the number of visits estimated based on Twitter data" ] }, { "cell_type": "code", "execution_count": 10, "id": "760be7fc-4c51-491a-b28a-c84fdebe6e74", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidperiodConfirmed RateDeath RateThe Number of Visits from Outside to Inside of the selected MSA
012020-02-160026
122020-02-160052
232020-02-160060
342020-02-160042
452020-02-160025
..................
53723482602020-12-27-9999-999921
53724483002020-12-27-9999-999950
53725484602020-12-27-9999-99994
53726485402020-12-27-9999-999936
53727485802020-12-27-9999-999935
\n", "

53728 rows × 5 columns

\n", "
" ], "text/plain": [ " geoid period Confirmed Rate Death Rate \\\n", "0 1 2020-02-16 0 0 \n", "1 2 2020-02-16 0 0 \n", "2 3 2020-02-16 0 0 \n", "3 4 2020-02-16 0 0 \n", "4 5 2020-02-16 0 0 \n", "... ... ... ... ... \n", "53723 48260 2020-12-27 -9999 -9999 \n", "53724 48300 2020-12-27 -9999 -9999 \n", "53725 48460 2020-12-27 -9999 -9999 \n", "53726 48540 2020-12-27 -9999 -9999 \n", "53727 48580 2020-12-27 -9999 -9999 \n", "\n", " The Number of Visits from Outside to Inside of the selected MSA \n", "0 26 \n", "1 52 \n", "2 60 \n", "3 42 \n", "4 25 \n", "... ... \n", "53723 21 \n", "53724 50 \n", "53725 4 \n", "53726 36 \n", "53727 35 \n", "\n", "[53728 rows x 5 columns]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Covid_Visits = pd.read_csv(\"attributes/Covid_Visits.csv\", dtype={'geoid':str})\n", "Covid_Visits = Covid_Visits.rename(columns={'geoid': 'geoid'})\n", "Covid_Visits" ] }, { "cell_type": "code", "execution_count": 11, "id": "e95cff58", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidnameregionLONLATISO3ISO3_1Shape_LengShape_Areageometry
012660Baraboo, WIWI-89.95043.43012660None2.3223640.244303POLYGON ((-90.31241 43.64100, -90.29665 43.641...
138300Pittsburgh, PAPA-79.83040.44038300None7.1376981.468706POLYGON ((-80.51922 39.96243, -80.51921 39.963...
217460Cleveland-Elyria, OHOH-81.68041.38017460None4.2105840.562277POLYGON ((-82.34808 41.42840, -82.34412 41.429...
338920Port Lavaca, TXTX-96.64028.50038920None3.9012070.136378MULTIPOLYGON (((-96.38985 28.38963, -96.38527 ...
448660Wichita Falls, TXTX-98.49033.77048660None3.9375400.674297POLYGON ((-98.95383 33.49638, -98.95378 33.531...
.................................
1166238Saint Barthelemy, NORTH AMERICANORTH AMERICA-63.06218.047BLMNone0.3094640.004696POLYGON ((-63.02834 18.01555, -63.03334 18.015...
1167239Guernsey, EURPOEEURPOE-2.57649.459GGYNone0.4252550.009359POLYGON ((-2.59083 49.42249, -2.59722 49.42249...
1168240Jersey, EURPOEEURPOE-2.12949.219JEYNone0.5791270.015408POLYGON ((-2.01500 49.21417, -2.02111 49.17722...
1169241South Georgia South Sandwich Islands, ANTARCTICAANTARCTICA-35.928-54.658SGSNone9.3640810.542074MULTIPOLYGON (((-27.32584 -59.42722, -27.29806...
1170242Taiwan, ASIAASIA120.94623.754TWNNone10.4195183.221167MULTIPOLYGON (((121.57639 22.00139, 121.57027 ...
\n", "

1171 rows × 10 columns

\n", "
" ], "text/plain": [ " geoid name region \\\n", "0 12660 Baraboo, WI WI \n", "1 38300 Pittsburgh, PA PA \n", "2 17460 Cleveland-Elyria, OH OH \n", "3 38920 Port Lavaca, TX TX \n", "4 48660 Wichita Falls, TX TX \n", "... ... ... ... \n", "1166 238 Saint Barthelemy, NORTH AMERICA NORTH AMERICA \n", "1167 239 Guernsey, EURPOE EURPOE \n", "1168 240 Jersey, EURPOE EURPOE \n", "1169 241 South Georgia South Sandwich Islands, ANTARCTICA ANTARCTICA \n", "1170 242 Taiwan, ASIA ASIA \n", "\n", " LON LAT ISO3 ISO3_1 Shape_Leng Shape_Area \\\n", "0 -89.950 43.430 12660 None 2.322364 0.244303 \n", "1 -79.830 40.440 38300 None 7.137698 1.468706 \n", "2 -81.680 41.380 17460 None 4.210584 0.562277 \n", "3 -96.640 28.500 38920 None 3.901207 0.136378 \n", "4 -98.490 33.770 48660 None 3.937540 0.674297 \n", "... ... ... ... ... ... ... \n", "1166 -63.062 18.047 BLM None 0.309464 0.004696 \n", "1167 -2.576 49.459 GGY None 0.425255 0.009359 \n", "1168 -2.129 49.219 JEY None 0.579127 0.015408 \n", "1169 -35.928 -54.658 SGS None 9.364081 0.542074 \n", "1170 120.946 23.754 TWN None 10.419518 3.221167 \n", "\n", " geometry \n", "0 POLYGON ((-90.31241 43.64100, -90.29665 43.641... \n", "1 POLYGON ((-80.51922 39.96243, -80.51921 39.963... \n", "2 POLYGON ((-82.34808 41.42840, -82.34412 41.429... \n", "3 MULTIPOLYGON (((-96.38985 28.38963, -96.38527 ... \n", "4 POLYGON ((-98.95383 33.49638, -98.95378 33.531... \n", "... ... \n", "1166 POLYGON ((-63.02834 18.01555, -63.03334 18.015... \n", "1167 POLYGON ((-2.59083 49.42249, -2.59722 49.42249... \n", "1168 POLYGON ((-2.01500 49.21417, -2.02111 49.17722... \n", "1169 MULTIPOLYGON (((-27.32584 -59.42722, -27.29806... \n", "1170 MULTIPOLYGON (((121.57639 22.00139, 121.57027 ... \n", "\n", "[1171 rows x 10 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shapefile_MSA = gpd.read_file(\"shp/MSA_country/msa_country.shp\", dtype={'GEOID':str})\n", "shapefile_MSA = shapefile_MSA.rename(columns={'GEOID': 'geoid', 'NAME_1':'name'})\n", "shapefile_MSA" ] }, { "cell_type": "markdown", "id": "e83cad34-a056-4055-8281-4382fbb23092", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Multiple Line Chart (MLC)" ] }, { "cell_type": "code", "execution_count": 12, "id": "5f037329", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/cvmfs/cybergis.illinois.edu/software/conda/cybergisx/python3-0.9.0/lib/python3.8/site-packages/pandas/core/dtypes/cast.py:1990: 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.\n", " result[:] = values\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_COVID_MLC\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_COVID_MLC/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_COVID_MLC/data/CONFIG_COVID_MLC.js\n" ] } ], "source": [ "param_MLC_COVID = {\n", " 'title': \"Covid-19 Risk Assessment using Twitter, Metropolitan Statistical Areas, USA\",\n", " 'Subject': \"Temporal Patterns of COVID-19 Risk Factors\",\n", " 'filename_suffix': \"COVID_MLC\", # max 30 character \n", " 'inputCSV': Covid_Visits, \n", " 'shapefile': shapefile_MSA, \n", " 'periods': \"All\",\n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"Confirmed Rate\",\n", " \"Death Rate\",\n", " \"The Number of Visits from Outside to Inside of the selected MSA\"\n", " ],\n", " 'NumOfMaps':2,\n", " 'InitialLayers':[\"2020-03-15_Confirmed Rate\" , \"2020-12-27_Confirmed Rate\"],\n", " 'Initial_map_center':[37, -97],\n", " 'Initial_map_zoom_level':4, \n", " 'Map_width':\"650px\",\n", " 'Map_height':\"400px\", \n", " 'Top10_Chart': True, \n", " 'Multiple_Line_Chart': True,\n", " 'NumOfMLC':3,\n", " '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\"],\n", " 'DefaultRegion_MLC':\"35620\" \n", "}\n", "Adaptive_Choropleth_Mapper_viz(param_MLC_COVID)\n", "Adaptive_Choropleth_Mapper_log(param_MLC_COVID)" ] }, { "cell_type": "markdown", "id": "603f3711", "metadata": {}, "source": [ "### Adaptive Choropleth Mapper with Comparison Line Chart (CLC)" ] }, { "cell_type": "code", "execution_count": 13, "id": "37955e39", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_COVID_CLC\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_COVID_CLC/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_COVID_CLC/data/CONFIG_COVID_CLC.js\n" ] } ], "source": [ "param_CLC_COVID = {\n", " 'title': \"Comparison of COVID-19 Confirmed Rate between Metropolitan Statistical Areas, USA\",\n", " 'Subject': \"Temporal Patterns of COVID-19 Confirmed Rate\",\n", " 'filename_suffix': \"COVID_CLC\", # max 30 character \n", " 'inputCSV': Covid_Visits, \n", " 'shapefile': shapefile_MSA, \n", " 'periods': \"All\",\n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"Confirmed Rate\"\n", " ],\n", " 'NumOfMaps':2,\n", " 'InitialLayers':[\"2020-04-19_Confirmed Rate\" , \"2020-11-01_Confirmed Rate\"],\n", " 'Initial_map_center':[37, -97],\n", " 'Initial_map_zoom_level':4, \n", " 'Map_width':\"650px\",\n", " 'Map_height':\"400px\", \n", " 'Top10_Chart': True, \n", " 'Comparision_Chart': True,\n", " 'NumOfCLC': 46,\n", " 'DefaultRegion_CLC': [\"35620\", \"16980\"] \n", "}\n", "Adaptive_Choropleth_Mapper_viz(param_CLC_COVID)\n", "Adaptive_Choropleth_Mapper_log(param_CLC_COVID) " ] }, { "cell_type": "markdown", "id": "8be9fd23", "metadata": {}, "source": [ "## More Examples" ] }, { "cell_type": "markdown", "id": "7ea41489-cc21-4449-831d-b04d76a02166", "metadata": {}, "source": [ "### Set input data: HIV data" ] }, { "cell_type": "code", "execution_count": 14, "id": "d33a90e5-79ae-4b24-9c03-c8a42a21ecaa", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidperiodHealth Care Center (/100k pop)HIV
0100120123.79615315.50
1100320122.5079157.50
2100520126.64199014.71
3100720124.20731117.70
4100920122.6300776.92
...............
219545603720184.4745909.15
219555603920180.26528817.17
219565604120184.6032470.00
219575604320187.1809560.00
219585604520180.2652880.00
\n", "

21959 rows × 4 columns

\n", "
" ], "text/plain": [ " geoid period Health Care Center (/100k pop) HIV\n", "0 1001 2012 3.796153 15.50\n", "1 1003 2012 2.507915 7.50\n", "2 1005 2012 6.641990 14.71\n", "3 1007 2012 4.207311 17.70\n", "4 1009 2012 2.630077 6.92\n", "... ... ... ... ...\n", "21954 56037 2018 4.474590 9.15\n", "21955 56039 2018 0.265288 17.17\n", "21956 56041 2018 4.603247 0.00\n", "21957 56043 2018 7.180956 0.00\n", "21958 56045 2018 0.265288 0.00\n", "\n", "[21959 rows x 4 columns]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "input_attributes_hiv = pd.read_csv(\"attributes/HIV_US_multiple_long.csv\", dtype={'geoid':str})\n", "input_attributes_hiv = input_attributes_hiv.rename(columns={'geoid': 'geoid'})\n", "input_attributes_hiv" ] }, { "cell_type": "code", "execution_count": 15, "id": "657e6d1d-c788-4fbd-9b51-ce23a2b1b294", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
geoidnamegeometry
02013Aleutians East,AKMULTIPOLYGON (((-162.63769 54.80112, -162.6440...
12016Aleutians West,AKMULTIPOLYGON (((177.44593 52.11133, 177.44302 ...
228107Panola,MSPOLYGON ((-90.19854 34.51109, -90.19863 34.554...
328101Newton,MSPOLYGON ((-88.91452 32.57695, -88.91559 32.558...
428027Coahoma,MSPOLYGON ((-90.65700 33.98759, -90.66036 33.987...
............
321627057Hubbard,MNPOLYGON ((-95.16917 47.15252, -95.16909 47.182...
321727169Winona,MNPOLYGON ((-92.07949 44.10699, -92.07921 44.117...
32182270NonePOLYGON ((-160.85114 63.01269, -160.85156 62.9...
321951515NonePOLYGON ((-79.54339 37.32615, -79.54230 37.334...
322046113NonePOLYGON ((-102.79211 42.99998, -102.86790 42.9...
\n", "

3221 rows × 3 columns

\n", "
" ], "text/plain": [ " geoid name \\\n", "0 2013 Aleutians East,AK \n", "1 2016 Aleutians West,AK \n", "2 28107 Panola,MS \n", "3 28101 Newton,MS \n", "4 28027 Coahoma,MS \n", "... ... ... \n", "3216 27057 Hubbard,MN \n", "3217 27169 Winona,MN \n", "3218 2270 None \n", "3219 51515 None \n", "3220 46113 None \n", "\n", " geometry \n", "0 MULTIPOLYGON (((-162.63769 54.80112, -162.6440... \n", "1 MULTIPOLYGON (((177.44593 52.11133, 177.44302 ... \n", "2 POLYGON ((-90.19854 34.51109, -90.19863 34.554... \n", "3 POLYGON ((-88.91452 32.57695, -88.91559 32.558... \n", "4 POLYGON ((-90.65700 33.98759, -90.66036 33.987... \n", "... ... \n", "3216 POLYGON ((-95.16917 47.15252, -95.16909 47.182... \n", "3217 POLYGON ((-92.07949 44.10699, -92.07921 44.117... \n", "3218 POLYGON ((-160.85114 63.01269, -160.85156 62.9... \n", "3219 POLYGON ((-79.54339 37.32615, -79.54230 37.334... \n", "3220 POLYGON ((-102.79211 42.99998, -102.86790 42.9... \n", "\n", "[3221 rows x 3 columns]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shapefile_us = gpd.read_file(\"shp/US/counties.shp\")\n", "shapefile_us" ] }, { "cell_type": "markdown", "id": "0c5fa09f", "metadata": { "tags": [] }, "source": [ "### Adaptive Choropleth Mapper with Parallel Coordinate Plot (PCP) for Time Series Visualization" ] }, { "cell_type": "code", "execution_count": 16, "id": "9425d37b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/cvmfs/cybergis.illinois.edu/software/conda/cybergisx/python3-0.9.0/lib/python3.8/site-packages/pandas/core/dtypes/cast.py:1990: 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.\n", " result[:] = values\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "output directory : ACM_HIV_PCP\n", "To see your visualization, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis/ACM_HIV_PCP/index.html\n", "To access all visualizations that you have created, click the URL below (or locate the files):\n", "https://cybergisx.cigi.illinois.edu/user/suhan2/view/CyberGIS-Vis/Quantitative_Data_Vis//ACM_log.html\n", "Advanced options are available in \n", "https://cybergisx.cigi.illinois.edu/user/suhan2/edit/CyberGIS-Vis/Quantitative_Data_Vis/ACM_HIV_PCP/data/CONFIG_HIV_PCP.js\n" ] } ], "source": [ "param_PCP_hiv = {\n", " 'title': \"Adaptive Choropleth Mapper with Paralle Coordinate Plot\",\n", " 'filename_suffix': \"HIV_PCP\", # max 30 character \n", " 'inputCSV': input_attributes_hiv, \n", " 'shapefile': shapefile_us, \n", " 'periods': [2012, 2013, 2014, 2015, 2016, 2017, 2018],\n", " 'variables': [ #enter variable names of the column you entered above.\n", " \"HIV\",\n", " #\"Health Care Center (/100k pop)\"\n", " ],\n", " 'NumOfMaps':2,\n", " 'Initial_map_center':[37, -97],\n", " 'Initial_map_zoom_level':4, \n", " 'Map_width':\"650px\",\n", " 'Map_height':\"410px\", \n", " 'Top10_Chart': True, \n", " 'Parallel_Coordinates_Plot': True,\n", " 'NumOfPCP':7,\n", "}\n", "Adaptive_Choropleth_Mapper_viz(param_PCP_hiv)\n", "Adaptive_Choropleth_Mapper_log(param_PCP_hiv) " ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.12" } }, "nbformat": 4, "nbformat_minor": 5 }