Skip to content

Commit 9368a6a

Browse files
committed
Update demo notebooks: snake_case -> camelCase, update binder url to match repo tag v2.0.1demos1
1 parent 74dd476 commit 9368a6a

19 files changed

+918
-1213
lines changed

docs/examples/jupyter-notebooks/contours.ipynb

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<em><sub>This page is available as an executable or viewable <strong>Jupyter Notebook</strong>:</sub></em>\n",
88
"<br/><br/>\n",
9-
"<a href=\"https://mybinder.org/v2/gh/JetBrains/lets-plot-kotlin/v1.3.0demos1?filepath=docs%2Fexamples%2Fjupyter-notebooks%2Fcontours.ipynb\"\n",
9+
"<a href=\"https://mybinder.org/v2/gh/JetBrains/lets-plot-kotlin/v2.0.1demos1?filepath=docs%2Fexamples%2Fjupyter-notebooks%2Fcontours.ipynb\"\n",
1010
" target=\"_parent\"> \n",
1111
" <img align=\"left\" \n",
1212
" src=\"https://mybinder.org/badge_logo.svg\">\n",
@@ -29,7 +29,7 @@
2929
{
3030
"data": {
3131
"text/html": [
32-
" <div id=\"zX50nn\"></div>\n",
32+
" <div id=\"3lc3W4\"></div>\n",
3333
" <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
3434
" if(!window.letsPlotCallQueue) {\n",
3535
" window.letsPlotCallQueue = [];\n",
@@ -40,7 +40,7 @@
4040
" (function() {\n",
4141
" var script = document.createElement(\"script\");\n",
4242
" script.type = \"text/javascript\";\n",
43-
" script.src = \"https://dl.bintray.com/jetbrains/lets-plot/lets-plot-2.0.1.min.js\";\n",
43+
" script.src = \"https://cdnjs.cloudflare.com/ajax/libs/lets-plot/2.0.2/lets-plot.min.js\";\n",
4444
" script.onload = function() {\n",
4545
" window.letsPlotCall = function(f) {f();};\n",
4646
" window.letsPlotCallQueue.forEach(function(f) {f();});\n",
@@ -54,9 +54,9 @@
5454
" var div = document.createElement(\"div\");\n",
5555
" div.style.color = 'darkred';\n",
5656
" div.textContent = 'Error loading Lets-Plot JS';\n",
57-
" document.getElementById(\"zX50nn\").appendChild(div);\n",
57+
" document.getElementById(\"3lc3W4\").appendChild(div);\n",
5858
" };\n",
59-
" var e = document.getElementById(\"zX50nn\");\n",
59+
" var e = document.getElementById(\"3lc3W4\");\n",
6060
" e.appendChild(script);\n",
6161
" })();\n",
6262
" </script>"
@@ -115,7 +115,7 @@
115115
{
116116
"data": {
117117
"text/html": [
118-
" <div id=\"WiT6eY\"></div>\n",
118+
" <div id=\"JqGZq8\"></div>\n",
119119
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
120120
" (function() {\n",
121121
" var plotSpec={\n",
@@ -144,7 +144,7 @@
144144
"'geom':\"tile\"\n",
145145
"}]\n",
146146
"};\n",
147-
" var plotContainer = document.getElementById(\"WiT6eY\");\n",
147+
" var plotContainer = document.getElementById(\"JqGZq8\");\n",
148148
" window.letsPlotCall(function() {{\n",
149149
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
150150
" }});\n",
@@ -153,15 +153,13 @@
153153
]
154154
},
155155
"execution_count": 4,
156-
"metadata": {
157-
"new_classpath": []
158-
},
156+
"metadata": {},
159157
"output_type": "execute_result"
160158
}
161159
],
162160
"source": [
163-
"val p = lets_plot {x=X; y=Y; fill=Z}\n",
164-
"p + geom_tile() + scale_fill_hue()"
161+
"val p = letsPlot {x=X; y=Y; fill=Z}\n",
162+
"p + geomTile() + scaleFillHue()"
165163
]
166164
},
167165
{
@@ -172,7 +170,7 @@
172170
{
173171
"data": {
174172
"text/html": [
175-
" <div id=\"7TmPRG\"></div>\n",
173+
" <div id=\"xdYlOd\"></div>\n",
176174
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
177175
" (function() {\n",
178176
" var plotSpec={\n",
@@ -205,7 +203,7 @@
205203
"'geom':\"tile\"\n",
206204
"}]\n",
207205
"};\n",
208-
" var plotContainer = document.getElementById(\"7TmPRG\");\n",
206+
" var plotContainer = document.getElementById(\"xdYlOd\");\n",
209207
" window.letsPlotCall(function() {{\n",
210208
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
211209
" }});\n",
@@ -214,15 +212,13 @@
214212
]
215213
},
216214
"execution_count": 5,
217-
"metadata": {
218-
"new_classpath": []
219-
},
215+
"metadata": {},
220216
"output_type": "execute_result"
221217
}
222218
],
223219
"source": [
224220
"// Lets use greyscale and also remove colorbar.\n",
225-
"val p1 = p + geom_tile(alpha=.5) + scale_fill_grey(1, .2, guide=\"none\")\n",
221+
"val p1 = p + geomTile(alpha=.5) + scaleFillGrey(1, .2, guide=\"none\")\n",
226222
"p1"
227223
]
228224
},
@@ -234,7 +230,7 @@
234230
{
235231
"data": {
236232
"text/html": [
237-
" <div id=\"mrgV8c\"></div>\n",
233+
" <div id=\"qK5tKx\"></div>\n",
238234
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
239235
" (function() {\n",
240236
" var plotSpec={\n",
@@ -280,7 +276,7 @@
280276
"'geom':\"contour\"\n",
281277
"}]\n",
282278
"};\n",
283-
" var plotContainer = document.getElementById(\"mrgV8c\");\n",
279+
" var plotContainer = document.getElementById(\"qK5tKx\");\n",
284280
" window.letsPlotCall(function() {{\n",
285281
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
286282
" }});\n",
@@ -289,15 +285,13 @@
289285
]
290286
},
291287
"execution_count": 6,
292-
"metadata": {
293-
"new_classpath": []
294-
},
288+
"metadata": {},
295289
"output_type": "execute_result"
296290
}
297291
],
298292
"source": [
299293
"// Add contours\n",
300-
"p1 + geom_contour(color=\"red\") {z=Z}"
294+
"p1 + geomContour(color=\"red\") {z=Z}"
301295
]
302296
},
303297
{
@@ -308,7 +302,7 @@
308302
{
309303
"data": {
310304
"text/html": [
311-
" <div id=\"i4ft6j\"></div>\n",
305+
" <div id=\"phhnHc\"></div>\n",
312306
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
313307
" (function() {\n",
314308
" var plotSpec={\n",
@@ -360,7 +354,7 @@
360354
"'geom':\"contour\"\n",
361355
"}]\n",
362356
"};\n",
363-
" var plotContainer = document.getElementById(\"i4ft6j\");\n",
357+
" var plotContainer = document.getElementById(\"phhnHc\");\n",
364358
" window.letsPlotCall(function() {{\n",
365359
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
366360
" }});\n",
@@ -369,15 +363,13 @@
369363
]
370364
},
371365
"execution_count": 7,
372-
"metadata": {
373-
"new_classpath": []
374-
},
366+
"metadata": {},
375367
"output_type": "execute_result"
376368
}
377369
],
378370
"source": [
379371
"// Set contour color by level\n",
380-
"p1 + geom_contour {z=Z; color=\"..level..\"} + scale_color_gradient(low=\"dark_green\", high=\"yellow\")"
372+
"p1 + geomContour {z=Z; color=\"..level..\"} + scaleColorGradient(low=\"dark_green\", high=\"yellow\")"
381373
]
382374
},
383375
{
@@ -395,7 +387,7 @@
395387
{
396388
"data": {
397389
"text/html": [
398-
" <div id=\"E3zxnv\"></div>\n",
390+
" <div id=\"JaIwM8\"></div>\n",
399391
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
400392
" (function() {\n",
401393
" var plotSpec={\n",
@@ -423,7 +415,7 @@
423415
"'geom':\"polygon\"\n",
424416
"}]\n",
425417
"};\n",
426-
" var plotContainer = document.getElementById(\"E3zxnv\");\n",
418+
" var plotContainer = document.getElementById(\"JaIwM8\");\n",
427419
" window.letsPlotCall(function() {{\n",
428420
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
429421
" }});\n",
@@ -432,17 +424,15 @@
432424
]
433425
},
434426
"execution_count": 8,
435-
"metadata": {
436-
"new_classpath": []
437-
},
427+
"metadata": {},
438428
"output_type": "execute_result"
439429
}
440430
],
441431
"source": [
442-
"val p2 = ggplot {x=X; y=Y}\n",
432+
"val p2 = letsPlot {x=X; y=Y}\n",
443433
"\n",
444434
"// Filled polygons are not working very well in this case\n",
445-
"p2 + geom_polygon(stat=Stat.contour {z=Z}) {fill=\"..level..\"}"
435+
"p2 + geomPolygon(stat=Stat.contour {z=Z}) {fill=\"..level..\"}"
446436
]
447437
},
448438
{
@@ -453,7 +443,7 @@
453443
{
454444
"data": {
455445
"text/html": [
456-
" <div id=\"g44PRA\"></div>\n",
446+
" <div id=\"fqzB2C\"></div>\n",
457447
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
458448
" (function() {\n",
459449
" var plotSpec={\n",
@@ -481,7 +471,7 @@
481471
"'geom':\"contourf\"\n",
482472
"}]\n",
483473
"};\n",
484-
" var plotContainer = document.getElementById(\"g44PRA\");\n",
474+
" var plotContainer = document.getElementById(\"fqzB2C\");\n",
485475
" window.letsPlotCall(function() {{\n",
486476
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
487477
" }});\n",
@@ -490,15 +480,13 @@
490480
]
491481
},
492482
"execution_count": 9,
493-
"metadata": {
494-
"new_classpath": []
495-
},
483+
"metadata": {},
496484
"output_type": "execute_result"
497485
}
498486
],
499487
"source": [
500488
"// 'contourf' geom works a lot better:\n",
501-
"p2 + geom_contourf {z=Z; fill=\"..level..\"}"
489+
"p2 + geomContourFilled {z=Z; fill=\"..level..\"}"
502490
]
503491
}
504492
],
@@ -513,8 +501,9 @@
513501
"file_extension": ".kt",
514502
"mimetype": "text/x-kotlin",
515503
"name": "kotlin",
504+
"nbconvert_exporter": "",
516505
"pygments_lexer": "kotlin",
517-
"version": "1.5.0-dev-1206"
506+
"version": "1.5.20-dev-4184"
518507
},
519508
"pycharm": {
520509
"stem_cell": {

0 commit comments

Comments
 (0)