{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Structured data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "_beakerx.set(\"seq\", Seq(1))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "_beakerx.set(\"map\", Map(\"1\" -> 2))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%javascript\n", "alert(JSON.stringify(beakerx.seq))\n", "alert(JSON.stringify(beakerx.map))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "_beakerx.get(\"map\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "_beakerx.set(\"int\", 11)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%javascript\n", "alert(JSON.stringify(beakerx.int))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import collection.JavaConverters._\n", "\n", "_beakerx.set(\"map\", Map(\"1\" -> 2).asJava)\n", "_beakerx.set(\"seq\", Seq(1).asJava)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%javascript\n", "\n", "alert(JSON.stringify(beakerx.seq))\n", "alert(JSON.stringify(beakerx.map))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Scala", "language": "scala", "name": "scala" }, "language_info": { "codemirror_mode": "text/x-scala", "file_extension": ".scala", "mimetype": "", "name": "Scala", "nbconverter_exporter": "", "version": "2.11.12" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": false, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": false, "toc_window_display": false }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "47aec6d4-e0fa-44ae-bd17-cf171beac794": { "model_module": "beakerx", "model_module_version": "*", "model_name": "TableDisplayModel", "state": { "model": { "alignmentForColumn": {}, "alignmentForType": {}, "cellHighlighters": [], "columnNames": [ "Key", "Value" ], "columnOrder": [], "columnsFrozen": {}, "columnsFrozenRight": {}, "columnsVisible": {}, "contextMenuItems": [], "contextMenuTags": {}, "dataFontSize": null, "doubleClickTag": null, "fontColor": [], "hasDoubleClickAction": false, "hasIndex": null, "headerFontSize": null, "headersVertical": false, "rendererForColumn": {}, "rendererForType": {}, "stringFormatForColumn": {}, "stringFormatForTimes": null, "stringFormatForType": {}, "subtype": "Dictionary", "timeZone": null, "tooManyRows": false, "tooltips": [], "type": "TableDisplay", "types": [], "values": [ [ "1", 2 ] ] } } }, "aed45398-26c4-48cd-992f-584f7b358e6c": { "model_module": "beakerx", "model_module_version": "*", "model_name": "TableDisplayModel", "state": { "model": { "alignmentForColumn": {}, "alignmentForType": {}, "cellHighlighters": [], "columnNames": [ "Key", "Value" ], "columnOrder": [], "columnsFrozen": {}, "columnsFrozenRight": {}, "columnsVisible": {}, "contextMenuItems": [], "contextMenuTags": {}, "dataFontSize": null, "doubleClickTag": null, "fontColor": [], "hasDoubleClickAction": false, "hasIndex": null, "headerFontSize": null, "headersVertical": false, "rendererForColumn": {}, "rendererForType": {}, "stringFormatForColumn": {}, "stringFormatForTimes": null, "stringFormatForType": {}, "subtype": "Dictionary", "timeZone": null, "tooManyRows": false, "tooltips": [], "type": "TableDisplay", "types": [], "values": [ [ "1", 2 ] ] } } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 2 }