|
18 | 18 | "source": [
|
19 | 19 | "*[Optional Table of Contents]*\n",
|
20 | 20 | "\n",
|
21 |
| - "1. [Default Presentation](#1.-Default-Presentation)\n", |
22 |
| - "2. [Options](#2.-Options) \n", |
23 |
| - "\n", |
24 |
| - " 2.1 [Shape](#2.1-Shape)\n", |
25 |
| - " \n" |
| 21 | + "1. [`color` and `size`](#color)\n", |
| 22 | + "2. [`shape`](#shape) \n", |
| 23 | + " 2.1 [Switching to Hollow Shapes](#hollow-shape)\n", |
| 24 | + " \n", |
| 25 | + "3. [Usage with GeoTools](#geotools)\n", |
| 26 | + "\n" |
26 | 27 | ]
|
27 | 28 | },
|
28 | 29 | {
|
|
34 | 35 | {
|
35 | 36 | "data": {
|
36 | 37 | "text/html": [
|
37 |
| - " <div id=\"YkpSSc\"></div>\n", |
| 38 | + " <div id=\"eXnylm\"></div>\n", |
38 | 39 | " <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
|
39 | 40 | " if(!window.letsPlotCallQueue) {\n",
|
40 | 41 | " window.letsPlotCallQueue = [];\n",
|
|
45 | 46 | " (function() {\n",
|
46 | 47 | " var script = document.createElement(\"script\");\n",
|
47 | 48 | " script.type = \"text/javascript\";\n",
|
48 |
| - " script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v3.1.0/js-package/distr/lets-plot.min.js\";\n", |
| 49 | + " script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v3.2.0/js-package/distr/lets-plot.min.js\";\n", |
49 | 50 | " script.onload = function() {\n",
|
50 | 51 | " window.letsPlotCall = function(f) {f();};\n",
|
51 | 52 | " window.letsPlotCallQueue.forEach(function(f) {f();});\n",
|
|
59 | 60 | " var div = document.createElement(\"div\");\n",
|
60 | 61 | " div.style.color = 'darkred';\n",
|
61 | 62 | " div.textContent = 'Error loading Lets-Plot JS';\n",
|
62 |
| - " document.getElementById(\"YkpSSc\").appendChild(div);\n", |
| 63 | + " document.getElementById(\"eXnylm\").appendChild(div);\n", |
63 | 64 | " };\n",
|
64 |
| - " var e = document.getElementById(\"YkpSSc\");\n", |
| 65 | + " var e = document.getElementById(\"eXnylm\");\n", |
65 | 66 | " e.appendChild(script);\n",
|
66 | 67 | " })();\n",
|
67 | 68 | " </script>"
|
|
85 | 86 | {
|
86 | 87 | "data": {
|
87 | 88 | "text/plain": [
|
88 |
| - "Lets-Plot Kotlin API v.4.3.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.1.0." |
| 89 | + "Lets-Plot Kotlin API v.4.4.1. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.2.0." |
89 | 90 | ]
|
90 | 91 | },
|
91 | 92 | "execution_count": 2,
|
|
102 | 103 | "id": "heavy-vienna",
|
103 | 104 | "metadata": {},
|
104 | 105 | "source": [
|
105 |
| - "*For demo, if possible, use standard data from [lets-plot-docs](https://github.com/JetBrains/lets-plot-docs/tree/master/data) repository.*\n", |
106 |
| - "\n", |
107 |
| - "*For example:*" |
| 106 | + "> *For demo, if possible, use standard data from [lets-plot-docs](https://github.com/JetBrains/lets-plot-docs/tree/master/data) repository.*\n", |
| 107 | + ">\n", |
| 108 | + "> *For example:*" |
108 | 109 | ]
|
109 | 110 | },
|
110 | 111 | {
|
|
334 | 335 | "outputs": [
|
335 | 336 | {
|
336 | 337 | "data": {
|
| 338 | + "application/kotlindataframe+json": "{\"nrow\":3,\"ncol\":12,\"columns\":[\"untitled\",\"manufacturer\",\"model\",\"displ\",\"year\",\"cyl\",\"trans\",\"drv\",\"cty\",\"hwy\",\"fl\",\"class\"],\"kotlin_dataframe\":[{\"untitled\":1,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":1.8,\"year\":1999,\"cyl\":4,\"trans\":\"auto(l5)\",\"drv\":\"f\",\"cty\":18,\"hwy\":29,\"fl\":\"p\",\"class\":\"compact\"},{\"untitled\":2,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":1.8,\"year\":1999,\"cyl\":4,\"trans\":\"manual(m5)\",\"drv\":\"f\",\"cty\":21,\"hwy\":29,\"fl\":\"p\",\"class\":\"compact\"},{\"untitled\":3,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":2.0,\"year\":2008,\"cyl\":4,\"trans\":\"manual(m6)\",\"drv\":\"f\",\"cty\":20,\"hwy\":31,\"fl\":\"p\",\"class\":\"compact\"}]}", |
337 | 339 | "text/html": [
|
338 | 340 | " <html>\n",
|
339 | 341 | " <head>\n",
|
|
495 | 497 | " </head>\n",
|
496 | 498 | " <body>\n",
|
497 | 499 | " \n",
|
498 |
| - "<table class=\"dataframe\" id=\"df_-1962934272\"></table>\n", |
| 500 | + "<table class=\"dataframe\" id=\"df_1728053248\"></table>\n", |
499 | 501 | "\n",
|
500 | 502 | "<p class=\"dataframe_description\">DataFrame: rowsCount = 3, columnsCount = 12</p>\n",
|
501 | 503 | " </body>\n",
|
|
514 | 516 | "{ name: \"<span title=\\\"hwy: Int\\\">hwy</span>\", children: [], rightAlign: true, values: [\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">29</span></span>\",\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">29</span></span>\",\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">31</span></span>\"] }, \n",
|
515 | 517 | "{ name: \"<span title=\\\"fl: String\\\">fl</span>\", children: [], rightAlign: false, values: [\"p\",\"p\",\"p\"] }, \n",
|
516 | 518 | "{ name: \"<span title=\\\"class: String\\\">class</span>\", children: [], rightAlign: false, values: [\"compact\",\"compact\",\"compact\"] }, \n",
|
517 |
| - "], id: -1962934272, rootId: -1962934272, totalRows: 3 } ) });\n", |
| 519 | + "], id: 1728053248, rootId: 1728053248, totalRows: 3 } ) });\n", |
518 | 520 | "/*-->*/\n",
|
519 | 521 | "\n",
|
520 |
| - "call_DataFrame(function() { DataFrame.renderTable(-1962934272) });\n", |
| 522 | + "call_DataFrame(function() { DataFrame.renderTable(1728053248) });\n", |
521 | 523 | "\n",
|
522 | 524 | "\n",
|
523 | 525 | " </script>\n",
|
|
539 | 541 | "id": "substantial-violence",
|
540 | 542 | "metadata": {},
|
541 | 543 | "source": [
|
542 |
| - "#### 1. Default Presentation" |
| 544 | + "> *The 1-st figure is usually built with a minimal set of required parameters.*\n", |
| 545 | + ">\n", |
| 546 | + "> *In many cases chapter header is not necessary.*" |
543 | 547 | ]
|
544 | 548 | },
|
545 | 549 | {
|
|
551 | 555 | {
|
552 | 556 | "data": {
|
553 | 557 | "text/html": [
|
554 |
| - " <div id=\"XMU9cd\"></div>\n", |
| 558 | + " <div id=\"MZdgax\"></div>\n", |
555 | 559 | " <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
|
556 | 560 | " (function() {\n",
|
557 | 561 | " var plotSpec={\n",
|
|
575 | 579 | "}\n",
|
576 | 580 | "}]\n",
|
577 | 581 | "};\n",
|
578 |
| - " var plotContainer = document.getElementById(\"XMU9cd\");\n", |
| 582 | + " var plotContainer = document.getElementById(\"MZdgax\");\n", |
579 | 583 | " window.letsPlotCall(function() {{\n",
|
580 | 584 | " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
|
581 | 585 | " }});\n",
|
|
600 | 604 | "id": "unauthorized-surname",
|
601 | 605 | "metadata": {},
|
602 | 606 | "source": [
|
603 |
| - "#### 2. Options" |
| 607 | + "<a id=\"color\"></a>\n", |
| 608 | + "#### 1. `color` and `size`" |
| 609 | + ] |
| 610 | + }, |
| 611 | + { |
| 612 | + "cell_type": "code", |
| 613 | + "execution_count": 6, |
| 614 | + "id": "grateful-emerald", |
| 615 | + "metadata": {}, |
| 616 | + "outputs": [ |
| 617 | + { |
| 618 | + "data": { |
| 619 | + "text/html": [ |
| 620 | + " <div id=\"k3UZWX\"></div>\n", |
| 621 | + " <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n", |
| 622 | + " (function() {\n", |
| 623 | + " var plotSpec={\n", |
| 624 | + "\"mapping\":{\n", |
| 625 | + "},\n", |
| 626 | + "\"data\":{\n", |
| 627 | + "\"displ\":[1.8,1.8,2.0,2.0,2.8,2.8,3.1,1.8,1.8,2.0,2.0,2.8,2.8,3.1,3.1,2.8,3.1,4.2,5.3,5.3,5.3,5.7,6.0,5.7,5.7,6.2,6.2,7.0,5.3,5.3,5.7,6.5,2.4,2.4,3.1,3.5,3.6,2.4,3.0,3.3,3.3,3.3,3.3,3.3,3.8,3.8,3.8,4.0,3.7,3.7,3.9,3.9,4.7,4.7,4.7,5.2,5.2,3.9,4.7,4.7,4.7,5.2,5.7,5.9,4.7,4.7,4.7,4.7,4.7,4.7,5.2,5.2,5.7,5.9,4.6,5.4,5.4,4.0,4.0,4.0,4.0,4.6,5.0,4.2,4.2,4.6,4.6,4.6,5.4,5.4,3.8,3.8,4.0,4.0,4.6,4.6,4.6,4.6,5.4,1.6,1.6,1.6,1.6,1.6,1.8,1.8,1.8,2.0,2.4,2.4,2.4,2.4,2.5,2.5,3.3,2.0,2.0,2.0,2.0,2.7,2.7,2.7,3.0,3.7,4.0,4.7,4.7,4.7,5.7,6.1,4.0,4.2,4.4,4.6,5.4,5.4,5.4,4.0,4.0,4.6,5.0,2.4,2.4,2.5,2.5,3.5,3.5,3.0,3.0,3.5,3.3,3.3,4.0,5.6,3.1,3.8,3.8,3.8,5.3,2.5,2.5,2.5,2.5,2.5,2.5,2.2,2.2,2.5,2.5,2.5,2.5,2.5,2.5,2.7,2.7,3.4,3.4,4.0,4.7,2.2,2.2,2.4,2.4,3.0,3.0,3.5,2.2,2.2,2.4,2.4,3.0,3.0,3.3,1.8,1.8,1.8,1.8,1.8,4.7,5.7,2.7,2.7,2.7,3.4,3.4,4.0,4.0,2.0,2.0,2.0,2.0,2.8,1.9,2.0,2.0,2.0,2.0,2.5,2.5,2.8,2.8,1.9,1.9,2.0,2.0,2.5,2.5,1.8,1.8,2.0,2.0,2.8,2.8,3.6],\n", |
| 628 | + "\"drv\":[\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\"],\n", |
| 629 | + "\"hwy\":[29.0,29.0,31.0,30.0,26.0,26.0,27.0,26.0,25.0,28.0,27.0,25.0,25.0,25.0,25.0,24.0,25.0,23.0,20.0,15.0,20.0,17.0,17.0,26.0,23.0,26.0,25.0,24.0,19.0,14.0,15.0,17.0,27.0,30.0,26.0,29.0,26.0,24.0,24.0,22.0,22.0,24.0,24.0,17.0,22.0,21.0,23.0,23.0,19.0,18.0,17.0,17.0,19.0,19.0,12.0,17.0,15.0,17.0,17.0,12.0,17.0,16.0,18.0,15.0,16.0,12.0,17.0,17.0,16.0,12.0,15.0,16.0,17.0,15.0,17.0,17.0,18.0,17.0,19.0,17.0,19.0,19.0,17.0,17.0,17.0,16.0,16.0,17.0,15.0,17.0,26.0,25.0,26.0,24.0,21.0,22.0,23.0,22.0,20.0,33.0,32.0,32.0,29.0,32.0,34.0,36.0,36.0,29.0,26.0,27.0,30.0,31.0,26.0,26.0,28.0,26.0,29.0,28.0,27.0,24.0,24.0,24.0,22.0,19.0,20.0,17.0,12.0,19.0,18.0,14.0,15.0,18.0,18.0,15.0,17.0,16.0,18.0,17.0,19.0,19.0,17.0,29.0,27.0,31.0,32.0,27.0,26.0,26.0,25.0,25.0,17.0,17.0,20.0,18.0,26.0,26.0,27.0,28.0,25.0,25.0,24.0,27.0,25.0,26.0,23.0,26.0,26.0,26.0,26.0,25.0,27.0,25.0,27.0,20.0,20.0,19.0,17.0,20.0,17.0,29.0,27.0,31.0,31.0,26.0,26.0,28.0,27.0,29.0,31.0,31.0,26.0,26.0,27.0,30.0,33.0,35.0,37.0,35.0,15.0,18.0,20.0,20.0,22.0,17.0,19.0,18.0,20.0,29.0,26.0,29.0,29.0,24.0,44.0,29.0,26.0,29.0,29.0,29.0,29.0,23.0,24.0,44.0,41.0,29.0,26.0,28.0,29.0,29.0,29.0,28.0,29.0,26.0,26.0,26.0]\n", |
| 630 | + "},\n", |
| 631 | + "\"kind\":\"plot\",\n", |
| 632 | + "\"scales\":[],\n", |
| 633 | + "\"layers\":[{\n", |
| 634 | + "\"mapping\":{\n", |
| 635 | + "\"x\":\"displ\",\n", |
| 636 | + "\"y\":\"hwy\",\n", |
| 637 | + "\"color\":\"drv\",\n", |
| 638 | + "\"size\":\"displ\"\n", |
| 639 | + "},\n", |
| 640 | + "\"stat\":\"identity\",\n", |
| 641 | + "\"position\":\"identity\",\n", |
| 642 | + "\"geom\":\"point\",\n", |
| 643 | + "\"data\":{\n", |
| 644 | + "}\n", |
| 645 | + "}]\n", |
| 646 | + "};\n", |
| 647 | + " var plotContainer = document.getElementById(\"k3UZWX\");\n", |
| 648 | + " window.letsPlotCall(function() {{\n", |
| 649 | + " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", |
| 650 | + " }});\n", |
| 651 | + " })(); \n", |
| 652 | + " </script>" |
| 653 | + ] |
| 654 | + }, |
| 655 | + "execution_count": 6, |
| 656 | + "metadata": {}, |
| 657 | + "output_type": "execute_result" |
| 658 | + } |
| 659 | + ], |
| 660 | + "source": [ |
| 661 | + "letsPlot(df.toMap()) + geomPoint {\n", |
| 662 | + " x = \"displ\"\n", |
| 663 | + " y = \"hwy\"\n", |
| 664 | + " color = \"drv\"\n", |
| 665 | + " size = \"displ\"\n", |
| 666 | + "}" |
604 | 667 | ]
|
605 | 668 | },
|
606 | 669 | {
|
607 | 670 | "cell_type": "markdown",
|
608 | 671 | "id": "headed-cliff",
|
609 | 672 | "metadata": {},
|
610 | 673 | "source": [
|
611 |
| - "##### 2.1 Shape\n", |
612 |
| - "\n" |
| 674 | + "<a id=\"shape\"></a>\n", |
| 675 | + "#### 2. `shape`" |
613 | 676 | ]
|
614 | 677 | },
|
615 | 678 | {
|
616 | 679 | "cell_type": "code",
|
617 |
| - "execution_count": 6, |
| 680 | + "execution_count": 7, |
| 681 | + "id": "enhanced-presentation", |
| 682 | + "metadata": {}, |
| 683 | + "outputs": [ |
| 684 | + { |
| 685 | + "data": { |
| 686 | + "text/html": [ |
| 687 | + " <div id=\"H5t0xy\"></div>\n", |
| 688 | + " <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n", |
| 689 | + " (function() {\n", |
| 690 | + " var plotSpec={\n", |
| 691 | + "\"mapping\":{\n", |
| 692 | + "},\n", |
| 693 | + "\"data\":{\n", |
| 694 | + "\"displ\":[1.8,1.8,2.0,2.0,2.8,2.8,3.1,1.8,1.8,2.0,2.0,2.8,2.8,3.1,3.1,2.8,3.1,4.2,5.3,5.3,5.3,5.7,6.0,5.7,5.7,6.2,6.2,7.0,5.3,5.3,5.7,6.5,2.4,2.4,3.1,3.5,3.6,2.4,3.0,3.3,3.3,3.3,3.3,3.3,3.8,3.8,3.8,4.0,3.7,3.7,3.9,3.9,4.7,4.7,4.7,5.2,5.2,3.9,4.7,4.7,4.7,5.2,5.7,5.9,4.7,4.7,4.7,4.7,4.7,4.7,5.2,5.2,5.7,5.9,4.6,5.4,5.4,4.0,4.0,4.0,4.0,4.6,5.0,4.2,4.2,4.6,4.6,4.6,5.4,5.4,3.8,3.8,4.0,4.0,4.6,4.6,4.6,4.6,5.4,1.6,1.6,1.6,1.6,1.6,1.8,1.8,1.8,2.0,2.4,2.4,2.4,2.4,2.5,2.5,3.3,2.0,2.0,2.0,2.0,2.7,2.7,2.7,3.0,3.7,4.0,4.7,4.7,4.7,5.7,6.1,4.0,4.2,4.4,4.6,5.4,5.4,5.4,4.0,4.0,4.6,5.0,2.4,2.4,2.5,2.5,3.5,3.5,3.0,3.0,3.5,3.3,3.3,4.0,5.6,3.1,3.8,3.8,3.8,5.3,2.5,2.5,2.5,2.5,2.5,2.5,2.2,2.2,2.5,2.5,2.5,2.5,2.5,2.5,2.7,2.7,3.4,3.4,4.0,4.7,2.2,2.2,2.4,2.4,3.0,3.0,3.5,2.2,2.2,2.4,2.4,3.0,3.0,3.3,1.8,1.8,1.8,1.8,1.8,4.7,5.7,2.7,2.7,2.7,3.4,3.4,4.0,4.0,2.0,2.0,2.0,2.0,2.8,1.9,2.0,2.0,2.0,2.0,2.5,2.5,2.8,2.8,1.9,1.9,2.0,2.0,2.5,2.5,1.8,1.8,2.0,2.0,2.8,2.8,3.6],\n", |
| 695 | + "\"drv\":[\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\"],\n", |
| 696 | + "\"hwy\":[29.0,29.0,31.0,30.0,26.0,26.0,27.0,26.0,25.0,28.0,27.0,25.0,25.0,25.0,25.0,24.0,25.0,23.0,20.0,15.0,20.0,17.0,17.0,26.0,23.0,26.0,25.0,24.0,19.0,14.0,15.0,17.0,27.0,30.0,26.0,29.0,26.0,24.0,24.0,22.0,22.0,24.0,24.0,17.0,22.0,21.0,23.0,23.0,19.0,18.0,17.0,17.0,19.0,19.0,12.0,17.0,15.0,17.0,17.0,12.0,17.0,16.0,18.0,15.0,16.0,12.0,17.0,17.0,16.0,12.0,15.0,16.0,17.0,15.0,17.0,17.0,18.0,17.0,19.0,17.0,19.0,19.0,17.0,17.0,17.0,16.0,16.0,17.0,15.0,17.0,26.0,25.0,26.0,24.0,21.0,22.0,23.0,22.0,20.0,33.0,32.0,32.0,29.0,32.0,34.0,36.0,36.0,29.0,26.0,27.0,30.0,31.0,26.0,26.0,28.0,26.0,29.0,28.0,27.0,24.0,24.0,24.0,22.0,19.0,20.0,17.0,12.0,19.0,18.0,14.0,15.0,18.0,18.0,15.0,17.0,16.0,18.0,17.0,19.0,19.0,17.0,29.0,27.0,31.0,32.0,27.0,26.0,26.0,25.0,25.0,17.0,17.0,20.0,18.0,26.0,26.0,27.0,28.0,25.0,25.0,24.0,27.0,25.0,26.0,23.0,26.0,26.0,26.0,26.0,25.0,27.0,25.0,27.0,20.0,20.0,19.0,17.0,20.0,17.0,29.0,27.0,31.0,31.0,26.0,26.0,28.0,27.0,29.0,31.0,31.0,26.0,26.0,27.0,30.0,33.0,35.0,37.0,35.0,15.0,18.0,20.0,20.0,22.0,17.0,19.0,18.0,20.0,29.0,26.0,29.0,29.0,24.0,44.0,29.0,26.0,29.0,29.0,29.0,29.0,23.0,24.0,44.0,41.0,29.0,26.0,28.0,29.0,29.0,29.0,28.0,29.0,26.0,26.0,26.0]\n", |
| 697 | + "},\n", |
| 698 | + "\"kind\":\"plot\",\n", |
| 699 | + "\"scales\":[],\n", |
| 700 | + "\"layers\":[{\n", |
| 701 | + "\"mapping\":{\n", |
| 702 | + "\"x\":\"displ\",\n", |
| 703 | + "\"y\":\"hwy\",\n", |
| 704 | + "\"shape\":\"drv\"\n", |
| 705 | + "},\n", |
| 706 | + "\"stat\":\"identity\",\n", |
| 707 | + "\"size\":8.0,\n", |
| 708 | + "\"position\":\"identity\",\n", |
| 709 | + "\"geom\":\"point\",\n", |
| 710 | + "\"data\":{\n", |
| 711 | + "}\n", |
| 712 | + "}]\n", |
| 713 | + "};\n", |
| 714 | + " var plotContainer = document.getElementById(\"H5t0xy\");\n", |
| 715 | + " window.letsPlotCall(function() {{\n", |
| 716 | + " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", |
| 717 | + " }});\n", |
| 718 | + " })(); \n", |
| 719 | + " </script>" |
| 720 | + ] |
| 721 | + }, |
| 722 | + "execution_count": 7, |
| 723 | + "metadata": {}, |
| 724 | + "output_type": "execute_result" |
| 725 | + } |
| 726 | + ], |
| 727 | + "source": [ |
| 728 | + "letsPlot(df.toMap()) + geomPoint(size = 8) {\n", |
| 729 | + " x = \"displ\"\n", |
| 730 | + " y = \"hwy\"\n", |
| 731 | + " shape = \"drv\"\n", |
| 732 | + "}" |
| 733 | + ] |
| 734 | + }, |
| 735 | + { |
| 736 | + "cell_type": "markdown", |
| 737 | + "id": "vulnerable-romantic", |
| 738 | + "metadata": {}, |
| 739 | + "source": [ |
| 740 | + "<a id=\"hollow-shape\"></a>\n", |
| 741 | + "##### 2.1 Switching to Hollow Shapes " |
| 742 | + ] |
| 743 | + }, |
| 744 | + { |
| 745 | + "cell_type": "code", |
| 746 | + "execution_count": 8, |
618 | 747 | "id": "certified-grass",
|
619 | 748 | "metadata": {},
|
620 | 749 | "outputs": [
|
621 | 750 | {
|
622 | 751 | "data": {
|
623 | 752 | "text/html": [
|
624 |
| - " <div id=\"rsGKxL\"></div>\n", |
| 753 | + " <div id=\"pvTc2u\"></div>\n", |
625 | 754 | " <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
|
626 | 755 | " (function() {\n",
|
627 | 756 | " var plotSpec={\n",
|
|
644 | 773 | "\"shape\":\"drv\"\n",
|
645 | 774 | "},\n",
|
646 | 775 | "\"stat\":\"identity\",\n",
|
647 |
| - "\"color\":\"black\",\n", |
648 | 776 | "\"size\":8.0,\n",
|
649 |
| - "\"alpha\":0.5,\n", |
650 | 777 | "\"position\":\"identity\",\n",
|
651 | 778 | "\"geom\":\"point\",\n",
|
652 | 779 | "\"data\":{\n",
|
653 | 780 | "}\n",
|
654 | 781 | "}]\n",
|
655 | 782 | "};\n",
|
656 |
| - " var plotContainer = document.getElementById(\"rsGKxL\");\n", |
| 783 | + " var plotContainer = document.getElementById(\"pvTc2u\");\n", |
657 | 784 | " window.letsPlotCall(function() {{\n",
|
658 | 785 | " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
|
659 | 786 | " }});\n",
|
660 | 787 | " })(); \n",
|
661 | 788 | " </script>"
|
662 | 789 | ]
|
663 | 790 | },
|
664 |
| - "execution_count": 6, |
| 791 | + "execution_count": 8, |
665 | 792 | "metadata": {},
|
666 | 793 | "output_type": "execute_result"
|
667 | 794 | }
|
668 | 795 | ],
|
669 | 796 | "source": [
|
670 |
| - "letsPlot(df.toMap()) + geomPoint(size = 8, color = \"black\", alpha = 0.5) {\n", |
| 797 | + "letsPlot(df.toMap()) + geomPoint(size = 8) {\n", |
671 | 798 | " x = \"displ\"\n",
|
672 | 799 | " y = \"hwy\"\n",
|
673 | 800 | " shape = \"drv\"\n",
|
674 | 801 | "} + scaleShape(\n",
|
675 | 802 | " solid = false\n",
|
676 | 803 | " )"
|
677 | 804 | ]
|
| 805 | + }, |
| 806 | + { |
| 807 | + "cell_type": "markdown", |
| 808 | + "id": "plastic-afternoon", |
| 809 | + "metadata": {}, |
| 810 | + "source": [ |
| 811 | + "<a id=\"geotools\"></a>\n", |
| 812 | + "#### 3. Usage with GeoTools\n", |
| 813 | + "`geomPoint()` can be used to draw markers on map." |
| 814 | + ] |
| 815 | + }, |
| 816 | + { |
| 817 | + "cell_type": "code", |
| 818 | + "execution_count": null, |
| 819 | + "id": "micro-dairy", |
| 820 | + "metadata": {}, |
| 821 | + "outputs": [], |
| 822 | + "source": [] |
678 | 823 | }
|
679 | 824 | ],
|
680 | 825 | "metadata": {
|
|
690 | 835 | "name": "kotlin",
|
691 | 836 | "nbconvert_exporter": "",
|
692 | 837 | "pygments_lexer": "kotlin",
|
693 |
| - "version": "1.8.20-Beta" |
| 838 | + "version": "1.8.20" |
694 | 839 | }
|
695 | 840 | },
|
696 | 841 | "nbformat": 4,
|
|
0 commit comments