{ "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/su-gis/CyberGIS-Vis" ] }, { "cell_type": "markdown", "id": "f785cd5e-96f8-4e27-a38e-1175c0a08d93", "metadata": {}, "source": [ "## Adaptive Choropleth Mapper with Multiple Line Chart (MLC): Temporal Patterns of Covid-19 Crude Rate and Death Rate in US Counties" ] }, { "cell_type": "markdown", "id": "c7da3cb3-793c-4da9-b295-3edd7842fcc9", "metadata": {}, "source": [ "## Setup environment" ] }, { "cell_type": "code", "execution_count": 1, "id": "f2fea90f-ace0-49a7-ba55-832f941eb6c4", "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": "efe245d9-5079-4a31-b131-86415f77e723", "metadata": {}, "source": [ "### Set input Data" ] }, { "cell_type": "markdown", "id": "e18f631a-5f9c-4178-a8c5-d367a5d345fd", "metadata": {}, "source": [ "1. Load U.S. counties from the Shapefile. Note: New York is an exception, represented by New York City with the city ID 777777, instead of county names and IDs.\n", "- Read the Shapefile \"County_NY_TIMES.shp\" into a GeoDataFrame\n", "- The Shapefile is located in the \"shp/US/\" directory\n", "- The 'geoid' column is explicitly set to be read as a string (str)" ] }, { "cell_type": "code", "execution_count": 2, "id": "2c3b778c-7391-4288-b198-097f7059b763", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | geoid | \n", "name | \n", "Shape_Leng | \n", "Shape_Area | \n", "geometry | \n", "
---|---|---|---|---|---|
0 | \n", "10001 | \n", "Kent,DE | \n", "2.029682 | \n", "0.215240 | \n", "POLYGON ((-75.74776 39.14334, -75.75600 39.246... | \n", "
1 | \n", "10003 | \n", "New Castle,DE | \n", "1.798779 | \n", "0.134081 | \n", "POLYGON ((-75.78860 39.72220, -75.77379 39.722... | \n", "
2 | \n", "10005 | \n", "Sussex,DE | \n", "2.369084 | \n", "0.320841 | \n", "POLYGON ((-75.70157 38.56074, -75.70744 38.635... | \n", "
3 | \n", "1001 | \n", "Autauga,AL | \n", "1.994948 | \n", "0.150242 | \n", "POLYGON ((-86.41312 32.70739, -86.41279 32.625... | \n", "
4 | \n", "1003 | \n", "Baldwin,AL | \n", "3.977560 | \n", "0.494110 | \n", "POLYGON ((-87.59883 30.99745, -87.59650 30.987... | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
3212 | \n", "9007 | \n", "Middlesex,CT | \n", "1.878172 | \n", "0.122471 | \n", "POLYGON ((-72.75218 41.57889, -72.75294 41.592... | \n", "
3213 | \n", "9009 | \n", "New Haven,CT | \n", "2.629868 | \n", "0.240237 | \n", "POLYGON ((-73.31047 41.46881, -73.32091 41.477... | \n", "
3214 | \n", "9011 | \n", "New London,CT | \n", "2.390277 | \n", "0.215441 | \n", "POLYGON ((-72.46673 41.58390, -72.41723 41.590... | \n", "
3215 | \n", "9013 | \n", "Tolland,CT | \n", "1.812081 | \n", "0.117074 | \n", "POLYGON ((-72.13572 42.03025, -72.10217 42.028... | \n", "
3216 | \n", "9015 | \n", "Windham,CT | \n", "1.754612 | \n", "0.146376 | \n", "POLYGON ((-71.78970 41.72456, -71.78725 41.656... | \n", "
3217 rows × 5 columns
\n", "\n", " | geoid | \n", "period | \n", "confirmed_cases_total | \n", "death_total | \n", "cases | \n", "death | \n", "pop | \n", "confirmed_rate_total | \n", "death_rate_tatal | \n", "confirmed_rate | \n", "death_rate | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "25021 | \n", "2020-03-02 | \n", "1 | \n", "0 | \n", "1 | \n", "0 | \n", "131 | \n", "76.34 | \n", "0.000000 | \n", "76.34 | \n", "0.000000 | \n", "
1 | \n", "17031 | \n", "2020-03-02 | \n", "7 | \n", "0 | \n", "1 | \n", "0 | \n", "37172 | \n", "1.88 | \n", "0.000000 | \n", "0.27 | \n", "0.000000 | \n", "
2 | \n", "6095 | \n", "2020-03-02 | \n", "24 | \n", "0 | \n", "1 | \n", "0 | \n", "80680 | \n", "2.97 | \n", "0.000000 | \n", "0.12 | \n", "0.000000 | \n", "
3 | \n", "6075 | \n", "2020-03-02 | \n", "6 | \n", "0 | \n", "0 | \n", "0 | \n", "17376 | \n", "3.45 | \n", "0.000000 | \n", "0.00 | \n", "0.000000 | \n", "
4 | \n", "12057 | \n", "2020-03-02 | \n", "2 | \n", "0 | \n", "1 | \n", "0 | \n", "1396 | \n", "14.33 | \n", "0.000000 | \n", "7.16 | \n", "0.000000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
276123 | \n", "42109 | \n", "2021-11-22 | \n", "20504 | \n", "432 | \n", "93 | \n", "0 | \n", "3556 | \n", "57660.29 | \n", "1214.848144 | \n", "261.53 | \n", "0.000000 | \n", "
276124 | \n", "42107 | \n", "2021-11-22 | \n", "84114 | \n", "1951 | \n", "491 | \n", "8 | \n", "36624 | \n", "22966.91 | \n", "532.710791 | \n", "134.07 | \n", "2.180000 | \n", "
276125 | \n", "27139 | \n", "2021-11-22 | \n", "97191 | \n", "694 | \n", "853 | \n", "7 | \n", "112464 | \n", "8641.97 | \n", "61.708636 | \n", "75.85 | \n", "0.622421 | \n", "
276126 | \n", "42121 | \n", "2021-11-22 | \n", "29499 | \n", "625 | \n", "310 | \n", "7 | \n", "1988 | \n", "148385.31 | \n", "3143.863179 | \n", "1559.36 | \n", "35.210000 | \n", "
276127 | \n", "9015 | \n", "2021-11-22 | \n", "56217 | \n", "891 | \n", "206 | \n", "1 | \n", "81092 | \n", "6932.50 | \n", "109.875203 | \n", "25.40 | \n", "0.120000 | \n", "
276128 rows × 11 columns
\n", "