{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from cartoframes.auth import set_default_credentials\n", "from cartoframes.viz import Map, Layer, Legend, Widget, basemaps\n", "\n", "set_default_credentials('cartovl')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", " None\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " Issued: 7/17/19 | Source: NOAA Weather Predicition Center\n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", "\n", " \n", " There is a \n", " from the CARTO VL library:\n", " \n", " :\n", " \n", " \n", " \n", " \n", " \n", "\n", " \n", " StackTrace\n", " \n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\">\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Map ([\n", " Layer(\n", " 'maxhi_20190717_72',\n", " '''\n", " color: ramp(linear($value,globalMIN($value),globalMAX($value)),[turquoise, yellow, red])\n", " filter: animation(linear($value,globalMIN($value),globalMAX($value)), 20, fade(0.1, hold))\n", " strokeWidth: 0\n", " width: 4\n", " ''',\n", " legend={\n", " 'type':'color-continuous-polygon',\n", " 'title': 'Max Heat Index for July 20, 2019',\n", " 'description': 'Degrees (°F)',\n", " 'footer': 'Issued: 7/17/19 | Source: NOAA Weather Predicition Center'\n", " },\n", " widgets=[\n", " Widget(\n", " 'formula',\n", " value='viewportMAX($value)',\n", " title='Max Degrees (°F)',\n", " ),\n", " Widget('time-series', value='value', title='Animation by Temperature'),\n", " \n", " ],\n", " ),\n", " Layer(\n", " 'state_bounds',\n", " 'color: rgba(200,200,200,0.8)',\n", " 'width: 2'\n", " ),\n", " ],\n", " basemap=basemaps.darkmatter,\n", " show_info=True,\n", " viewport={'zoom': 2.5, 'lat': 37.572586, 'lng': -110.638529},\n", ")" ] } ], "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.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }
There is a \n", " from the CARTO VL library: