{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "27c415bc-19bd-4ab4-80c9-efdb5d33c03a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "a048d094-8294-47ac-98d4-920c2c441f64", "metadata": {}, "outputs": [], "source": [ "np.random.seed(0) \n", "N = 200\n", "noise = dict(\n", " x = np.random.uniform(0, 200, N),\n", " y = np.random.uniform(100, 400, N),\n", " size = np.random.uniform(0.1, 2, N) \n", ")\n", "backdrop = geom_point(aes(\"x\", \"y\", size=\"size\"), data=noise, tooltips='none') " ] }, { "cell_type": "code", "execution_count": 3, "id": "87412abd-01b8-4295-969d-cf967fbbc5fb", "metadata": {}, "outputs": [], "source": [ "items = [\n", " dict (\n", " name = \"Lets-Plot\\nMultiplatform\",\n", " documentationUrl = \"https://lets-plot.org\",\n", " sourcesUrl = \"https://github.com/JetBrains/lets-plot\",\n", " x = 0, y = 0, size = 14, shape = 16, angle = 0\n", " ),\n", " dict (\n", " name = \"Lets-Plot\\nfor Python\",\n", " documentationUrl = \"https://lets-plot.org/kotlin/get-started.html\",\n", " sourcesUrl = \"https://github.com/JetBrains/lets-plot-kotlin\",\n", " x = 130, y = 150, size = 9, shape = 15, angle = 15\n", " ),\n", " dict (\n", " name = \"Lets-Plot\\nfor Kotlin\",\n", " documentationUrl = \"https://lets-plot.org/kotlin/get-started.html\",\n", " sourcesUrl = \"https://github.com/JetBrains/lets-plot-kotlin\",\n", " x = 200, y = 200, size = 7, shape = 15, angle = -15\n", " ),\n", " dict (\n", " name = \"Lets-Plot\\nCompose Multiplatform\",\n", " documentationUrl = \"https://github.com/JetBrains/lets-plot-skia\",\n", " sourcesUrl = \"https://github.com/JetBrains/lets-plot-skia\",\n", " x = 80, y = 250, size = 7, shape = 15, angle = 30\n", " ),\n", " dict (\n", " name = \"Geocoding\",\n", " documentationUrl = \"https://lets-plot.org/python/pages/geocoding.html\",\n", " sourcesUrl = \"https://github.com/JetBrains/lets-plot\",\n", " x = 70, y = 320, size = 7, shape = 17, angle = 0\n", " ),\n", "]" ] }, { "cell_type": "code", "execution_count": 4, "id": "4310428d-8bd9-4b6d-982e-a0b76ea49189", "metadata": {}, "outputs": [], "source": [ "data = {\n", " \"name\": [],\n", " \"documentationUrl\": [],\n", " \"sourcesUrl\": [],\n", " \"x\": [],\n", " \"y\": [],\n", " \"size\": [],\n", " \"shape\": [],\n", " \"angle\": [],\n", "}\n", "\n", "for item in items:\n", " for key in data:\n", " data[key].append(item[key])\n" ] }, { "cell_type": "code", "execution_count": 5, "id": "abc5e82f-06f0-4fa0-9dfb-f244e1d8e45b", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "