{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pydeck as pdk\n",
    "print(pdk.__version__)\n",
    "\n",
    "# 2014 locations of car accidents in the UK\n",
    "UK_ACCIDENTS_DATA = ('https://raw.githubusercontent.com/uber-common/'\n",
    "                     'deck.gl-data/master/examples/3d-heatmap/heatmap-data.csv')\n",
    "\n",
    "# Define a layer to display on a map\n",
    "layer = pdk.Layer(\n",
    "    'HexagonLayer',\n",
    "    UK_ACCIDENTS_DATA,\n",
    "    get_position=['lng', 'lat'],\n",
    "    auto_highlight=True,\n",
    "    elevation_scale=50,\n",
    "    pickable=True,\n",
    "    elevation_range=[0, 3000],\n",
    "    extruded=True,                 \n",
    "    coverage=1)\n",
    "\n",
    "# Set the viewport location\n",
    "view_state = pdk.ViewState(\n",
    "    longitude=-1.415,\n",
    "    latitude=52.2323,\n",
    "    zoom=6,\n",
    "    min_zoom=5,\n",
    "    max_zoom=15,\n",
    "    pitch=40.5,\n",
    "    bearing=-27.36)\n",
    "\n",
    "# Render\n",
    "r = pdk.Deck(layers=[layer], initial_view_state=view_state)\n",
    "r.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
