From fce598049caaf3ad2b2a330ccfd0cafbd51b22bd Mon Sep 17 00:00:00 2001 From: yostane <1958676+yostane@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:45:21 +0200 Subject: [PATCH] Update notebooks --- .../result-explorer/demo00.ipynb | 5 +- .../result-explorer/demo01.ipynb | 1708 ++++++++++++----- .../result-explorer/demo02.ipynb | 942 +++------ 3 files changed, 1485 insertions(+), 1170 deletions(-) diff --git a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb index eae59509..8c132a78 100644 --- a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb +++ b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb @@ -11,12 +11,13 @@ } }, "source": [ - "# Hello Jupyter Kotlin" + "# Hello Jupyter Kotlin\n", + "This is markdown cell. You can write markdown in Jupyter notebook. You can also write code in Kotlin. Let's write a simple code in Kotlin." ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { diff --git a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb index a03a46e5..b1d2ee28 100644 --- a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb +++ b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb @@ -9,20 +9,27 @@ }, { "cell_type": "code", - "execution_count": 29, "metadata": { "ExecuteTime": { - "end_time": "2024-08-24T11:14:19.583192900Z", - "start_time": "2024-08-24T11:14:12.242893300Z" + "start_time": "2024-08-29T07:34:03.349088700Z" } }, - "outputs": [], "source": [ "// Without specifying %useLatestDescriptors, the version included in the Kotlin Jupyter kernel will be used.\n", "%useLatestDescriptors\n", "%use kandy\n", "%use dataframe" - ] + ], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "The execution was interrupted" + ] + } + ], + "execution_count": null }, { "cell_type": "markdown", @@ -33,65 +40,26 @@ }, { "cell_type": "code", - "execution_count": 30, "metadata": { - "ExecuteTime": { - "end_time": "2024-08-24T11:14:19.925191Z", - "start_time": "2024-08-24T11:14:19.603194600Z" - }, "notebookRunGroups": { "groupValue": "1" + }, + "ExecuteTime": { + "end_time": "2024-08-29T07:34:11.912960400Z", + "start_time": "2024-08-29T07:31:04.404062800Z" } }, + "source": [ + "val df = DataFrame.read(\"http://localhost:8080/responses\")\n", + "df" + ], "outputs": [ { "data": { - "application/kotlindataframe+json": { - "columns": [ - "What is the primary goal of Kotlin Multiplatform?", - "How does Kotlin Multiplatform facilitate code sharing between platforms?", - "Which platforms does Kotlin Multiplatform support?", - "What is a common use case for Kotlin Multiplatform?", - "What is a shared code module in Kotlin Multiplatform called?", - "How does Kotlin Multiplatform handle platform-specific implementations?", - "What languages can be interoperable with Kotlin Multiplatform?", - "What tooling supports Kotlin Multiplatform development?", - "What is the benefit of using Kotlin Multiplatform for mobile development?", - "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?" - ], - "kotlin_dataframe": [ - { - "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?": "None", - "How does Kotlin Multiplatform facilitate code sharing between platforms?": "By sharing business logic and adapting UI", - "How does Kotlin Multiplatform handle platform-specific implementations?": "actual", - "What is a common use case for Kotlin Multiplatform?": "Developing a cross-platform app", - "What is a shared code module in Kotlin Multiplatform called?": "Shared module", - "What is the benefit of using Kotlin Multiplatform for mobile development?": "and sharing", - "What is the primary goal of Kotlin Multiplatform?": "To share", - "What languages can be interoperable with Kotlin Multiplatform?": "Java, Swift", - "What tooling supports Kotlin Multiplatform development?": "IntelliJ IDEA", - "Which platforms does Kotlin Multiplatform support?": "Android, iOS, and web" - }, - { - "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?": "Kotlin Multiplatform allows sharing code between different platforms using common modules.", - "How does Kotlin Multiplatform facilitate code sharing between platforms?": "By sharing business logic and adapting UI", - "How does Kotlin Multiplatform handle platform-specific implementations?": "Through expect and actual declarations", - "What is a common use case for Kotlin Multiplatform?": "Developing a cross-platform app", - "What is a shared code module in Kotlin Multiplatform called?": "Shared module", - "What is the benefit of using Kotlin Multiplatform for mobile development?": "Code reuse and sharing", - "What is the primary goal of Kotlin Multiplatform?": "To share code between multiple platforms", - "What languages can be interoperable with Kotlin Multiplatform?": "Java, JavaScript, Swift", - "What tooling supports Kotlin Multiplatform development?": "IntelliJ IDEA, Android Studio", - "Which platforms does Kotlin Multiplatform support?": "Android, iOS, and web" - } - ], - "ncol": 10, - "nrow": 2 - }, "text/html": [ - " \n", - " \n", - " \n", " \n", " \n", - "
\n", - "\n", - "

DataFrame: rowsCount = 2, columnsCount = 10

\n", - "
What is the primary goal of Kotlin Multiplatform?How does Kotlin Multiplatform facilitate code sharing between platforms?Which platforms does Kotlin Multiplatform support?What is a common use case for Kotlin Multiplatform?What is a shared code module in Kotlin Multiplatform called?How does Kotlin Multiplatform handle platform-specific implementations?What languages can be interoperable with Kotlin Multiplatform?What tooling supports Kotlin Multiplatform development?What is the benefit of using Kotlin Multiplatform for mobile development?How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?
To shareBy sharing business logic and adaptin...Android, iOS, and webDeveloping a cross-platform appShared moduleactualJava, SwiftIntelliJ IDEAand sharingNone
To share code between multiple platformsBy sharing business logic and adaptin...Android, iOS, and webDeveloping a cross-platform appShared moduleThrough expect and actual declarationsJava, JavaScript, SwiftIntelliJ IDEA, Android StudioCode reuse and sharingKotlin Multiplatform allows sharing c...
\n", + "
Which platforms does Kotlin Multiplatform support?Which naming of KMP is deprecated?At which Google I/O, Google announced first-class support for Kotlin on Android?What is the name of the Kotlin mascot?The international yearly Kotlin conference is called...Where will be located the next international yearly Kotlin conference?
Android, iOS, desktop and webHadi Multiplatform2014KotlineeKotlinConfTokyo, Japan
\n", " \n", " \n", " " - ] + ], + "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"Which platforms does Kotlin Multiplatform support?\",\"Which naming of KMP is deprecated?\",\"At which Google I/O, Google announced first-class support for Kotlin on Android?\",\"What is the name of the Kotlin mascot?\",\"The international yearly Kotlin conference is called...\",\"Where will be located the next international yearly Kotlin conference?\"],\"nrow\":1,\"ncol\":6},\"kotlin_dataframe\":[{\"Which platforms does Kotlin Multiplatform support?\":\"Android, iOS, desktop and web\",\"Which naming of KMP is deprecated?\":\"Hadi Multiplatform\",\"At which Google I/O, Google announced first-class support for Kotlin on Android?\":\"2014\",\"What is the name of the Kotlin mascot?\":\"Kotlinee\",\"The international yearly Kotlin conference is called...\":\"KotlinConf\",\"Where will be located the next international yearly Kotlin conference?\":\"Tokyo, Japan\"}]}" }, - "execution_count": 30, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], - "source": [ - "val df = DataFrame.read(\"http://localhost:8080/responses\")\n", - "df" - ] + "execution_count": 9 }, { "cell_type": "markdown", @@ -443,16 +722,19 @@ }, { "cell_type": "code", - "execution_count": 31, "metadata": { - "ExecuteTime": { - "end_time": "2024-08-24T11:14:20.162191700Z", - "start_time": "2024-08-24T11:14:19.946198800Z" - }, "notebookRunGroups": { "groupValue": "2" + }, + "ExecuteTime": { + "end_time": "2024-08-29T07:34:11.915959400Z", + "start_time": "2024-08-29T07:31:04.694061Z" } }, + "source": [ + "val correctDF = DataFrame.read(\"http://localhost:8080/correct-stats\")\n", + "correctDF.schema()" + ], "outputs": [ { "data": { @@ -461,93 +743,36 @@ "correct: Int" ] }, - "execution_count": 31, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], - "source": [ - "val correctDF = DataFrame.read(\"http://localhost:8080/correct-stats\")\n", - "correctDF.schema()" - ] + "execution_count": 10 }, { "cell_type": "code", - "execution_count": 32, "metadata": { "ExecuteTime": { - "end_time": "2024-08-24T11:14:20.619193Z", - "start_time": "2024-08-24T11:14:20.287192300Z" + "end_time": "2024-08-29T07:34:11.916958Z", + "start_time": "2024-08-29T07:31:05.379688600Z" } }, + "source": [ + "val correctDF2 = correctDF.add(\"tq\") {\n", + " question.take(3) +\n", + " Typography.ellipsis.toString() +\n", + " question.takeLast(25)\n", + "}\n", + "correctDF2" + ], "outputs": [ { "data": { - "application/kotlindataframe+json": { - "columns": [ - "question", - "correct", - "tq" - ], - "kotlin_dataframe": [ - { - "correct": 0, - "question": "What is the primary goal of Kotlin Multiplatform?", - "tq": "Wha… of Kotlin Multiplatform?" - }, - { - "correct": 1, - "question": "How does Kotlin Multiplatform facilitate code sharing between platforms?", - "tq": "How…haring between platforms?" - }, - { - "correct": 1, - "question": "Which platforms does Kotlin Multiplatform support?", - "tq": "Whi…in Multiplatform support?" - }, - { - "correct": 0, - "question": "What is a common use case for Kotlin Multiplatform?", - "tq": "Wha…for Kotlin Multiplatform?" - }, - { - "correct": 0, - "question": "What is a shared code module in Kotlin Multiplatform called?", - "tq": "Wha…lin Multiplatform called?" - }, - { - "correct": 1, - "question": "How does Kotlin Multiplatform handle platform-specific implementations?", - "tq": "How…specific implementations?" - }, - { - "correct": 1, - "question": "What languages can be interoperable with Kotlin Multiplatform?", - "tq": "Wha…ith Kotlin Multiplatform?" - }, - { - "correct": 0, - "question": "What tooling supports Kotlin Multiplatform development?", - "tq": "Wha…ultiplatform development?" - }, - { - "correct": 0, - "question": "What is the benefit of using Kotlin Multiplatform for mobile development?", - "tq": "Wha…m for mobile development?" - }, - { - "correct": 0, - "question": "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?", - "tq": "How…lin Native and Kotlin/JS?" - } - ], - "ncol": 3, - "nrow": 10 - }, "text/html": [ - " \n", - " \n", - " \n", " \n", " \n", - "
\n", - "\n", - "

DataFrame: rowsCount = 10, columnsCount = 3

\n", - "
questioncorrecttq
What is the primary goal of Kotlin Mu...0Wha… of Kotlin Multiplatform?
How does Kotlin Multiplatform facilit...1How…haring between platforms?
Which platforms does Kotlin Multiplat...1Whi…in Multiplatform support?
What is a common use case for Kotlin ...0Wha…for Kotlin Multiplatform?
What is a shared code module in Kotli...0Wha…lin Multiplatform called?
How does Kotlin Multiplatform handle ...1How…specific implementations?
What languages can be interoperable w...1Wha…ith Kotlin Multiplatform?
What tooling supports Kotlin Multipla...0Wha…ultiplatform development?
What is the benefit of using Kotlin M...0Wha…m for mobile development?
How does Kotlin Multiplatform differ ...0How…lin Native and Kotlin/JS?
\n", + "
questioncorrecttq
Which plat...m support?1Whi…Which plat...m support?
Which nami...eprecated?0Whi…Which nami...eprecated?
At which G...n Android?0At …At which G...n Android?
What is th...in mascot?0Wha…What is th...in mascot?
The intern... called...1The…The intern... called...
Where will...onference?0Whe…Where will...onference?
\n", " \n", " \n", " " - ] + ], + "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"question\",\"correct\",\"tq\"],\"nrow\":6,\"ncol\":3},\"kotlin_dataframe\":[{\"question\":\"Which plat...m support?\",\"correct\":1,\"tq\":\"Whi\\u2026Which plat...m support?\"},{\"question\":\"Which nami...eprecated?\",\"correct\":0,\"tq\":\"Whi\\u2026Which nami...eprecated?\"},{\"question\":\"At which G...n Android?\",\"correct\":0,\"tq\":\"At \\u2026At which G...n Android?\"},{\"question\":\"What is th...in mascot?\",\"correct\":0,\"tq\":\"Wha\\u2026What is th...in mascot?\"},{\"question\":\"The intern... called...\",\"correct\":1,\"tq\":\"The\\u2026The intern... called...\"},{\"question\":\"Where will...onference?\",\"correct\":0,\"tq\":\"Whe\\u2026Where will...onference?\"}]}" }, - "execution_count": 32, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], - "source": [ - "val correctDF2 = correctDF.add(\"tq\") { question.take(3) + Typography.ellipsis.toString() + question.takeLast(25) }\n", - "correctDF2" - ] + "execution_count": 11 }, { "cell_type": "code", - "execution_count": 33, "metadata": { - "ExecuteTime": { - "end_time": "2024-08-24T11:14:20.800192Z", - "start_time": "2024-08-24T11:14:20.651193800Z" - }, "notebookRunGroups": { "groupValue": "1" + }, + "ExecuteTime": { + "end_time": "2024-08-29T07:34:11.917960100Z", + "start_time": "2024-08-29T07:31:06.033760500Z" } }, + "source": [ + "correctDF2.plot {\n", + " bars {\n", + " y(tq) {\n", + " axis.name = \"Question\"\n", + " }\n", + " x(correct)\n", + " }\n", + "}" + ], "outputs": [ { "data": { - "application/plot+json": { - "apply_color_scheme": true, - "output": { - "data": { - "correct": [ - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0 - ], - "tq": [ - "Wha… of Kotlin Multiplatform?", - "How…haring between platforms?", - "Whi…in Multiplatform support?", - "Wha…for Kotlin Multiplatform?", - "Wha…lin Multiplatform called?", - "How…specific implementations?", - "Wha…ith Kotlin Multiplatform?", - "Wha…ultiplatform development?", - "Wha…m for mobile development?", - "How…lin Native and Kotlin/JS?" - ] - }, - "kind": "plot", - "layers": [ - { - "geom": "bar", - "mapping": { - "x": "correct", - "y": "tq" - }, - "position": "dodge", - "sampling": "none", - "stat": "identity" - } - ], - "mapping": {}, - "scales": [ - { - "aesthetic": "y", - "discrete": true, - "name": "Question" - }, - { - "aesthetic": "x", - "limits": [ - null, - null - ] - } - ] - }, - "output_type": "lets_plot_spec", - "swing_enabled": true - }, "text/html": [ " \n", + "</html>\"> \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", - " \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", @@ -1220,7 +1692,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1229,7 +1701,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1238,7 +1710,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1247,7 +1719,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1256,7 +1728,7 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1265,77 +1737,49 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " Wha… of Kotlin Multiplatform?\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " How…haring between platforms?\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Whi…in Multiplatform support?\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " Wha…for Kotlin Multiplatform?\n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " Wha…lin Multiplatform called?\n", + " Whi…Which plat...m support?\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " How…specific implementations?\n", + " Whi…Which nami...eprecated?\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " Wha…ith Kotlin Multiplatform?\n", + " At …At which G...n Android?\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " Wha…ultiplatform development?\n", + " Wha…What is th...in mascot?\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " Wha…m for mobile development?\n", + " The…The intern... called...\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " How…lin Native and Kotlin/JS?\n", + " Whe…Where will...onference?\n", " \n", " \n", " \n", @@ -1347,7 +1791,7 @@ " Question\n", " \n", " \n", - " \n", + " \n", " \n", " correct\n", " \n", @@ -1355,104 +1799,91 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " - ] + " " + ], + "application/plot+json": { + "output_type": "lets_plot_spec", + "output": { + "mapping": {}, + "data": { + "correct": [ + 1.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0 + ], + "tq": [ + "Whi…Which plat...m support?", + "Whi…Which nami...eprecated?", + "At …At which G...n Android?", + "Wha…What is th...in mascot?", + "The…The intern... called...", + "Whe…Where will...onference?" + ] + }, + "kind": "plot", + "scales": [ + { + "aesthetic": "y", + "discrete": true, + "name": "Question" + }, + { + "aesthetic": "x", + "limits": [ + null, + null + ] + } + ], + "layers": [ + { + "mapping": { + "y": "tq", + "x": "correct" + }, + "stat": "identity", + "sampling": "none", + "position": "dodge", + "geom": "bar" + } + ] + }, + "apply_color_scheme": true, + "swing_enabled": true + } }, - "execution_count": 33, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], - "source": [ - "correctDF2.plot {\n", - " bars {\n", - " y(tq) {\n", - " axis.name = \"Question\"\n", - " }\n", - " x(correct)\n", - " }\n", - "}" - ] + "execution_count": 12 }, { "cell_type": "code", - "execution_count": 34, "metadata": { "ExecuteTime": { - "end_time": "2024-08-24T11:14:21.188191800Z", - "start_time": "2024-08-24T11:14:20.934195Z" + "end_time": "2024-08-29T07:34:11.944956900Z", + "start_time": "2024-08-29T07:31:06.784340500Z" } }, + "source": [ + "val table = DataFrame.readJson(\"http://localhost:8080/table\")\n", + "table" + ], "outputs": [ { "data": { - "application/kotlindataframe+json": { - "columns": [ - "What is the primary goal of Kotlin Multiplatform?", - "How does Kotlin Multiplatform facilitate code sharing between platforms?", - "Which platforms does Kotlin Multiplatform support?", - "What is a common use case for Kotlin Multiplatform?", - "What is a shared code module in Kotlin Multiplatform called?", - "How does Kotlin Multiplatform handle platform-specific implementations?", - "What languages can be interoperable with Kotlin Multiplatform?", - "What tooling supports Kotlin Multiplatform development?", - "What is the benefit of using Kotlin Multiplatform for mobile development?", - "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?" - ], - "kotlin_dataframe": [ - { - "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?": [ - "None", - "Kotlin Multiplatform allows sharing code between different platforms using common modules." - ], - "How does Kotlin Multiplatform facilitate code sharing between platforms?": [ - "By sharing business logic and adapting UI", - "By sharing business logic and adapting UI" - ], - "How does Kotlin Multiplatform handle platform-specific implementations?": [ - "actual", - "Through expect and actual declarations" - ], - "What is a common use case for Kotlin Multiplatform?": [ - "Developing a cross-platform app", - "Developing a cross-platform app" - ], - "What is a shared code module in Kotlin Multiplatform called?": [ - "Shared module", - "Shared module" - ], - "What is the benefit of using Kotlin Multiplatform for mobile development?": [ - "and sharing", - "Code reuse and sharing" - ], - "What is the primary goal of Kotlin Multiplatform?": [ - "To share", - "To share code between multiple platforms" - ], - "What languages can be interoperable with Kotlin Multiplatform?": [ - "Java, Swift", - "Java, JavaScript, Swift" - ], - "What tooling supports Kotlin Multiplatform development?": [ - "IntelliJ IDEA", - "IntelliJ IDEA, Android Studio" - ], - "Which platforms does Kotlin Multiplatform support?": [ - "Android, iOS, and web", - "Android, iOS, and web" - ] - } - ], - "ncol": 10, - "nrow": 1 - }, "text/html": [ - " \n", - " \n", - " \n", " \n", " \n", - "
\n", - "\n", - "

DataFrame: rowsCount = 1, columnsCount = 10

\n", - "
What is the primary goal of Kotlin Multiplatform?How does Kotlin Multiplatform facilitate code sharing between platforms?Which platforms does Kotlin Multiplatform support?What is a common use case for Kotlin Multiplatform?What is a shared code module in Kotlin Multiplatform called?How does Kotlin Multiplatform handle platform-specific implementations?What languages can be interoperable with Kotlin Multiplatform?What tooling supports Kotlin Multiplatform development?What is the benefit of using Kotlin Multiplatform for mobile development?How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?
[To share, To share code between mult...[By sharing business logic and adapti...[Android, iOS, and web, Android, iOS,...[Developing a cross-platform app, Dev...[Shared module, Shared module][actual, Through expect and actual de...[Java, Swift, Java, JavaScript, Swift][IntelliJ IDEA, IntelliJ IDEA, Androi...[and sharing, Code reuse and sharing][None, Kotlin Multiplatform allows sh...
\n", + "
Which platforms does Kotlin Multiplatform support?Which naming of KMP is deprecated?At which Google I/O, Google announced first-class support for Kotlin on Android?What is the name of the Kotlin mascot?The international yearly Kotlin conference is called...Where will be located the next international yearly Kotlin conference?
[Android, iOS, desktop and web][Hadi Multiplatform][2014][Kotlinee][KotlinConf][Tokyo, Japan]
\n", " \n", " \n", " " - ] + ], + "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"Which platforms does Kotlin Multiplatform support?\",\"Which naming of KMP is deprecated?\",\"At which Google I/O, Google announced first-class support for Kotlin on Android?\",\"What is the name of the Kotlin mascot?\",\"The international yearly Kotlin conference is called...\",\"Where will be located the next international yearly Kotlin conference?\"],\"nrow\":1,\"ncol\":6},\"kotlin_dataframe\":[{\"Which platforms does Kotlin Multiplatform support?\":[\"Android, iOS, desktop and web\"],\"Which naming of KMP is deprecated?\":[\"Hadi Multiplatform\"],\"At which Google I/O, Google announced first-class support for Kotlin on Android?\":[\"2014\"],\"What is the name of the Kotlin mascot?\":[\"Kotlinee\"],\"The international yearly Kotlin conference is called...\":[\"KotlinConf\"],\"Where will be located the next international yearly Kotlin conference?\":[\"Tokyo, Japan\"]}]}" }, - "execution_count": 34, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], - "source": [ - "val table = DataFrame.readJson(\"http://localhost:8080/table\")\n", - "table" - ] + "execution_count": 13 } ], "metadata": { diff --git a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo02.ipynb b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo02.ipynb index 2d6261fb..285430eb 100644 --- a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo02.ipynb +++ b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo02.ipynb @@ -1,122 +1,150 @@ { "cells": [ { - "metadata": {}, "cell_type": "markdown", - "source": "# ktor client demo" + "metadata": {}, + "source": "# Ktor client demo" }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:42:05.958527500Z", - "start_time": "2024-08-27T20:41:54.957867400Z" + "end_time": "2024-08-29T07:44:39.062466200Z", + "start_time": "2024-08-29T07:44:09.370362800Z" } }, - "cell_type": "code", "source": [ "%useLatestDescriptors\n", "%use serialization\n", "%use ktor-client\n", "%use kandy\n", + "%use dataframe\n", "val host = \"http://localhost:8080\"" ], "outputs": [], - "execution_count": 102 + "execution_count": 62 }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:42:06.128537300Z", - "start_time": "2024-08-27T20:42:05.985532600Z" + "end_time": "2024-08-29T07:44:39.398466300Z", + "start_time": "2024-08-29T07:44:39.067469200Z" } }, - "cell_type": "code", "source": [ "import io.ktor.client.request.*\n", "import io.ktor.http.*\n", "\n", + "http.get(\"$host/reset\")\n", "val jsonBody = \"\"\"\n", "{\n", - " \"score\": 0,\n", - " \"nickname\": \"user-${(1..10000).random()}\",\n", " \"responses\": [\n", " {\n", - " \"question\": \"What is the primary goal of Kotlin Multiplatform?\",\n", - " \"answer\": \"To build only Android applications\",\n", + " \"question\": \"Which platforms does Kotlin Multiplatform support?\",\n", + " \"answer\": \"Android, iOS, desktop and web\",\n", " \"answerId\": 1,\n", " \"id\": 1,\n", - " \"correctAnswerId\": 4\n", + " \"correctAnswerId\": 1\n", " },\n", " {\n", - " \"question\": \"How does Kotlin Multiplatform facilitate code sharing between platforms?\",\n", - " \"answer\": \"By using only Java libraries\",\n", + " \"question\": \"Which naming of KMP is deprecated?\",\n", + " \"answer\": \"Hadi Multiplatform\",\n", " \"answerId\": 1,\n", " \"id\": 2,\n", " \"correctAnswerId\": 4\n", " },\n", " {\n", - " \"question\": \"Which platforms does Kotlin Multiplatform support?\",\n", - " \"answer\": \"Only iOS\",\n", + " \"question\": \"At which Google I/O, Google announced first-class support for Kotlin on Android?\",\n", + " \"answer\": \"2014\",\n", " \"answerId\": 1,\n", " \"id\": 3,\n", - " \"correctAnswerId\": 4\n", + " \"correctAnswerId\": 2\n", " },\n", " {\n", - " \"question\": \"What is a common use case for Kotlin Multiplatform?\",\n", - " \"answer\": \"Creating a server-side application\",\n", + " \"question\": \"What is the name of the Kotlin mascot?\",\n", + " \"answer\": \"Kotlinee\",\n", " \"answerId\": 1,\n", " \"id\": 4,\n", " \"correctAnswerId\": 4\n", " },\n", " {\n", - " \"question\": \"Which naming of KMP is deprecated?\",\n", - " \"answer\": \"Kodee multiplatform\",\n", + " \"question\": \"The international yearly Kotlin conference is called...\",\n", + " \"answer\": \"KotlinConf\",\n", " \"answerId\": 1,\n", " \"id\": 5,\n", - " \"correctAnswerId\": 3\n", + " \"correctAnswerId\": 1\n", " },\n", " {\n", - " \"question\": \"How does Kotlin Multiplatform handle platform-specific implementations?\",\n", - " \"answer\": \"By excluding platform-specific features\",\n", + " \"question\": \"Where will be located the next international yearly Kotlin conference?\",\n", + " \"answer\": \"Tokyo, Japan\",\n", " \"answerId\": 1,\n", " \"id\": 6,\n", + " \"correctAnswerId\": 4\n", + " }\n", + " ],\n", + " \"score\": 2,\n", + " \"nickname\": \"Yami-937\"\n", + "}\n", + "\"\"\"\n", + "http.post(\"$host/respond\") {\n", + " contentType(ContentType.Application.Json)\n", + " setBody(jsonBody)\n", + "}\n", + "val jsonBody2 = \"\"\"\n", + "{\n", + " \"responses\": [\n", + " {\n", + " \"question\": \"Which platforms does Kotlin Multiplatform support?\",\n", + " \"answer\": \"Android, iOS, desktop and web\",\n", + " \"answerId\": 4,\n", + " \"id\": 1,\n", + " \"correctAnswerId\": 4\n", + " },\n", + " {\n", + " \"question\": \"Which naming of KMP is deprecated?\",\n", + " \"answer\": \"Kotlin Multiplatform Mobile (KMM)\",\n", + " \"answerId\": 2,\n", + " \"id\": 2,\n", " \"correctAnswerId\": 2\n", " },\n", " {\n", " \"question\": \"At which Google I/O, Google announced first-class support for Kotlin on Android?\",\n", - " \"answer\": \"2020\",\n", - " \"answerId\": 1,\n", - " \"id\": 7,\n", - " \"correctAnswerId\": 3\n", + " \"answer\": \"2017\",\n", + " \"answerId\": 4,\n", + " \"id\": 3,\n", + " \"correctAnswerId\": 4\n", " },\n", " {\n", " \"question\": \"What is the name of the Kotlin mascot?\",\n", - " \"answer\": \"Kotlinee\",\n", - " \"answerId\": 1,\n", - " \"id\": 8,\n", - " \"correctAnswerId\": 3\n", + " \"answer\": \"Kodee\",\n", + " \"answerId\": 2,\n", + " \"id\": 4,\n", + " \"correctAnswerId\": 2\n", " },\n", " {\n", " \"question\": \"The international yearly Kotlin conference is called...\",\n", - " \"answer\": \"KotlinKonf\",\n", + " \"answer\": \"KotlinConf\",\n", " \"answerId\": 1,\n", - " \"id\": 9,\n", - " \"correctAnswerId\": 2\n", + " \"id\": 5,\n", + " \"correctAnswerId\": 1\n", " },\n", " {\n", " \"question\": \"Where will be located the next international yearly Kotlin conference?\",\n", - " \"answer\": \"Amsterdam, Netherlands\",\n", - " \"answerId\": 1,\n", - " \"id\": 10,\n", - " \"correctAnswerId\": 4\n", + " \"answer\": \"Copenhagen, Denmark\",\n", + " \"answerId\": 3,\n", + " \"id\": 6,\n", + " \"correctAnswerId\": 3\n", " }\n", - " ]\n", + " ],\n", + " \"score\": 6,\n", + " \"nickname\": \"Charmy-782\"\n", "}\n", "\"\"\"\n", "http.post(\"$host/respond\") {\n", " contentType(ContentType.Application.Json)\n", - " setBody(jsonBody)\n", - "}" + " setBody(jsonBody2)\n", + "}\n" ], "outputs": [ { @@ -125,21 +153,21 @@ "HttpResponse[http://localhost:8080/respond, 200 OK]" ] }, - "execution_count": 103, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 103 + "execution_count": 63 }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:42:06.890529600Z", - "start_time": "2024-08-27T20:42:06.160529Z" + "end_time": "2024-08-29T07:44:40.152054800Z", + "start_time": "2024-08-29T07:44:39.435469400Z" } }, - "cell_type": "code", "source": [ "val response = http.get(\"$host/raw-responses\")\n", "println(response)\n", @@ -153,41 +181,43 @@ "output_type": "stream", "text": [ "HttpResponse[http://localhost:8080/raw-responses, 200 OK]\r\n", - "[{\"score\":0,\"nickname\":\"user1\",\"responses\":[{\"question\":\"What is the primary goal of Kotlin Multipla\r\n" + "[{\"score\":2,\"nickname\":\"Yami-937\",\"responses\":[{\"question\":\"Which platforms does Kotlin Multiplatfor\r\n" ] }, { "data": { "text/plain": [ - "[{\"score\":0,\"nickname\":\"user1\",\"responses\":[{\"question\":\"What is the primary goal of Kotlin Multipla" + "[{\"score\":2,\"nickname\":\"Yami-937\",\"responses\":[{\"question\":\"Which platforms does Kotlin Multiplatfor" ] }, - "execution_count": 104, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 104 + "execution_count": 64 }, { - "metadata": {}, "cell_type": "markdown", - "source": "`deserializeJson` generates fields on the next block" + "metadata": {}, + "source": [ + "`deserializeJson` generates fields on the next block" + ] }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:42:07.371527500Z", - "start_time": "2024-08-27T20:42:06.987529900Z" + "end_time": "2024-08-29T07:44:40.707052300Z", + "start_time": "2024-08-29T07:44:40.169053Z" } }, - "cell_type": "code", "source": [ "println(deserialized.count())\n", "println(\"number of correct replies for each nickname\")\n", "val userScores = mapOf>(\"user\" to deserialized.map { it.nickname },\n", " \"score\" to deserialized.map { it.responses.count { r -> r.answerId == r.correctAnswerId } })\n", - "val rowCount = deserialized.count()\n", + "val rowCount = deserialized[0].responses.count()\n", "println(userScores)" ], "outputs": [ @@ -195,29 +225,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "6\r\n", + "2\r\n", "number of correct replies for each nickname\r\n", - "{user=[user1, user2, user4, user3, user-2628, user-1339], score=[2, 2, 4, 0, 0, 0]}\r\n" + "{user=[Yami-937, Charmy-782], score=[2, 6]}\r\n" ] } ], - "execution_count": 105 + "execution_count": 65 }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:42:07.925526200Z", - "start_time": "2024-08-27T20:42:07.495530900Z" + "end_time": "2024-08-29T07:45:01.025052Z", + "start_time": "2024-08-29T07:45:00.776046600Z" } }, - "cell_type": "code", "source": [ "plot(userScores) {\n", " x(\"user\")\n", " bars {\n", " y.constant(rowCount)\n", " width = 0.5\n", - " fillColor = Color.GREY\n", + " fillColor = Color.GREEN\n", " alpha = 0.3\n", " }\n", " bars {\n", @@ -225,9 +255,6 @@ " scale = continuous(0..rowCount)\n", " }\n", " x(\"user\")\n", - " fillColor(\"user\") {\n", - " scale = categoricalColorHue()\n", - " }\n", " }\n", "}" ], @@ -242,14 +269,14 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="6im9Qy"></div>\n", + " <div id="GmVv79"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " var plotSpec={\n", ""mapping":{\n", "},\n", ""data":{\n", - ""score":[2.0,2.0,4.0,0.0,0.0,0.0],\n", - ""user":["user1","user2","user4","user3","user-2628","user-1339"]\n", + ""score":[2.0,6.0],\n", + ""user":["Yami-937","Charmy-782"]\n", "},\n", ""kind":"plot",\n", ""scales":[{\n", @@ -259,20 +286,11 @@ ""aesthetic":"x",\n", ""discrete":true\n", "},{\n", - ""aesthetic":"y",\n", - ""limits":[null,null]\n", - "},{\n", - ""aesthetic":"x",\n", - ""discrete":true\n", - "},{\n", ""aesthetic":"x",\n", ""discrete":true\n", "},{\n", ""aesthetic":"y",\n", ""limits":[0.0,6.0]\n", - "},{\n", - ""aesthetic":"fill",\n", - ""scale_mapper_kind":"color_hue"\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -280,30 +298,18 @@ "},\n", ""stat":"identity",\n", ""sampling":"none",\n", - ""y":6.0,\n", - ""position":"identity",\n", - ""geom":"line",\n", - ""data":{\n", - "}\n", - "},{\n", - ""mapping":{\n", - ""x":"user"\n", - "},\n", - ""stat":"identity",\n", - ""sampling":"none",\n", ""alpha":0.3,\n", ""width":0.5,\n", ""y":6.0,\n", ""position":"dodge",\n", ""geom":"bar",\n", - ""fill":"#a39999",\n", + ""fill":"#3ba272",\n", ""data":{\n", "}\n", "},{\n", ""mapping":{\n", ""x":"user",\n", - ""y":"score",\n", - ""fill":"user"\n", + ""y":"score"\n", "},\n", ""stat":"identity",\n", ""sampling":"none",\n", @@ -313,11 +319,11 @@ "}\n", "}]\n", "};\n", - " var plotContainer = document.getElementById("6im9Qy");\n", + " var plotContainer = document.getElementById("GmVv79");\n", " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \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", " \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", - " user1\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user2\n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " user4\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user3\n", + " Yami-937\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " user-2628\n", + " Charmy-782\n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-1339\n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 0\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 1\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 2\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 3\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 4\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 5\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 6\n", @@ -653,150 +587,23 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " score\n", " \n", " \n", - " \n", + " \n", " \n", " user\n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user1\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user2\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user4\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user3\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-2628\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-1339\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -805,34 +612,15 @@ "data": { "score": [ 2.0, - 2.0, - 4.0, - 0.0, - 0.0, - 0.0 + 6.0 ], "user": [ - "user1", - "user2", - "user4", - "user3", - "user-2628", - "user-1339" + "Yami-937", + "Charmy-782" ] }, "kind": "plot", "scales": [ - { - "aesthetic": "y", - "limits": [ - null, - null - ] - }, - { - "aesthetic": "x", - "discrete": true - }, { "aesthetic": "y", "limits": [ @@ -854,23 +642,9 @@ 0.0, 6.0 ] - }, - { - "aesthetic": "fill", - "scale_mapper_kind": "color_hue" } ], "layers": [ - { - "mapping": { - "x": "user" - }, - "stat": "identity", - "sampling": "none", - "y": 6.0, - "position": "identity", - "geom": "line" - }, { "mapping": { "x": "user" @@ -882,13 +656,12 @@ "y": 6.0, "position": "dodge", "geom": "bar", - "fill": "#a39999" + "fill": "#3ba272" }, { "mapping": { "x": "user", - "y": "score", - "fill": "user" + "y": "score" }, "stat": "identity", "sampling": "none", @@ -901,30 +674,30 @@ "swing_enabled": true } }, - "execution_count": 106, + "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 106 + "execution_count": 69 }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:52:15.077479Z", - "start_time": "2024-08-27T20:52:14.817478900Z" + "end_time": "2024-08-29T07:44:41.582694100Z", + "start_time": "2024-08-29T07:44:41.169134700Z" } }, - "cell_type": "code", "source": [ - "val df = userScores.toDataFrame().sortByDesc(\"score\")\n", + "val df = userScores.toDataFrame().sortBy(\"score\")\n", "df.head()" ], "outputs": [ { "data": { "text/html": [ - " \n", " \n", - "
userscore
user44
user12
user22
user30
user-26280
\n", + "
userscore
Yami-9372
Charmy-7826
\n", " \n", " \n", " " ], - "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"user\",\"score\"],\"nrow\":5,\"ncol\":2},\"kotlin_dataframe\":[{\"user\":\"user4\",\"score\":4},{\"user\":\"user1\",\"score\":2},{\"user\":\"user2\",\"score\":2},{\"user\":\"user3\",\"score\":0},{\"user\":\"user-2628\",\"score\":0}]}" + "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"user\",\"score\"],\"nrow\":2,\"ncol\":2},\"kotlin_dataframe\":[{\"user\":\"Yami-937\",\"score\":2},{\"user\":\"Charmy-782\",\"score\":6}]}" }, - "execution_count": 112, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 112 + "execution_count": 67 }, { + "cell_type": "code", "metadata": { "ExecuteTime": { - "end_time": "2024-08-27T20:52:42.693386100Z", - "start_time": "2024-08-27T20:52:42.473386400Z" + "end_time": "2024-08-29T07:44:42.079695800Z", + "start_time": "2024-08-29T07:44:41.705697Z" } }, - "cell_type": "code", "source": [ "plot(df) {\n", " x(\"user\")\n", @@ -1598,9 +1371,6 @@ " scale = continuous(0..rowCount)\n", " }\n", " x(\"user\")\n", - " fillColor(\"user\") {\n", - " scale = categoricalColorHue()\n", - " }\n", " }\n", "}" ], @@ -1615,14 +1385,14 @@ " <script type="text/javascript" data-lets-plot-script="library" src="https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v4.3.3/js-package/distr/lets-plot.min.js"></script>\n", " </head>\n", " <body>\n", - " <div id="A4wJS4"></div>\n", + " <div id="BoKpEe"></div>\n", " <script type="text/javascript" data-lets-plot-script="plot">\n", " var plotSpec={\n", ""mapping":{\n", "},\n", ""data":{\n", - ""score":[4.0,2.0,2.0,0.0,0.0,0.0],\n", - ""user":["user4","user1","user2","user3","user-2628","user-1339"]\n", + ""score":[2.0,6.0],\n", + ""user":["Yami-937","Charmy-782"]\n", "},\n", ""kind":"plot",\n", ""scales":[{\n", @@ -1637,9 +1407,6 @@ "},{\n", ""aesthetic":"y",\n", ""limits":[0.0,6.0]\n", - "},{\n", - ""aesthetic":"fill",\n", - ""scale_mapper_kind":"color_hue"\n", "}],\n", ""layers":[{\n", ""mapping":{\n", @@ -1658,8 +1425,7 @@ "},{\n", ""mapping":{\n", ""x":"user",\n", - ""y":"score",\n", - ""fill":"user"\n", + ""y":"score"\n", "},\n", ""stat":"identity",\n", ""sampling":"none",\n", @@ -1669,11 +1435,11 @@ "}\n", "}]\n", "};\n", - " var plotContainer = document.getElementById("A4wJS4");\n", + " var plotContainer = document.getElementById("BoKpEe");\n", " LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n", " </script>\n", " </body>\n", - "</html>\"> \n", + "</html>\"> \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", + " \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", - " user4\n", + " Yami-937\n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user1\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user2\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user3\n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", - " user-2628\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-1339\n", + " Charmy-782\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 0\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 1\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 2\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 3\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 4\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 5\n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " 6\n", @@ -1997,150 +1703,23 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " score\n", " \n", " \n", - " \n", + " \n", " \n", " user\n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user4\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user1\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user2\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user3\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-2628\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " user-1339\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", "\n", - " " + " " ], "application/plot+json": { "output_type": "lets_plot_spec", @@ -2148,20 +1727,12 @@ "mapping": {}, "data": { "score": [ - 4.0, 2.0, - 2.0, - 0.0, - 0.0, - 0.0 + 6.0 ], "user": [ - "user4", - "user1", - "user2", - "user3", - "user-2628", - "user-1339" + "Yami-937", + "Charmy-782" ] }, "kind": "plot", @@ -2187,10 +1758,6 @@ 0.0, 6.0 ] - }, - { - "aesthetic": "fill", - "scale_mapper_kind": "color_hue" } ], "layers": [ @@ -2210,8 +1777,7 @@ { "mapping": { "x": "user", - "y": "score", - "fill": "user" + "y": "score" }, "stat": "identity", "sampling": "none", @@ -2224,12 +1790,12 @@ "swing_enabled": true } }, - "execution_count": 114, + "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 114 + "execution_count": 68 } ], "metadata": { @@ -2239,7 +1805,13 @@ "name": "kotlin" }, "language_info": { - "name": "kotlin" + "codemirror_mode": "text/x-kotlin", + "file_extension": ".kt", + "mimetype": "text/x-kotlin", + "name": "kotlin", + "nbconvert_exporter": "", + "pygments_lexer": "kotlin", + "version": "1.9.23" } }, "nbformat": 4,