-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to a lab-based app for the Voila frontend (#846)
* Switch to a lab-based app for the Voila frontend Co-authored-by: martinRenou <[email protected]> * Remove `"private": true` in `voila/package.json` * Minor updates * Convert `index.js` into typescript * Pass "this" to the WidgetRenderer We need to cast "as any" until this is merged and released: jupyter-widgets/ipywidgets#3625 * Remove install --pre ipywidgets * Update snapshots * Remove ipyvolume ui-test Co-authored-by: martinRenou <[email protected]> Co-authored-by: Duc Trung LE <[email protected]>
- Loading branch information
1 parent
86d64bd
commit 20caacc
Showing
58 changed files
with
3,585 additions
and
4,364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,5 @@ dependencies: | |
- bqplot | ||
- scipy | ||
- ipympl | ||
- ipympl | ||
- xleaflet=0.16.0 | ||
- xeus-cling=0.13.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ node_modules | |
coverage | ||
*.map.js | ||
*.bundle.js | ||
*.voila.js | ||
|
||
# jetbrains IDE stuff | ||
.idea/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ node_modules | |
build | ||
notebooks/ | ||
.vscode/ | ||
.pytest_cache | ||
|
||
ui-tests/playwright-report | ||
ui-tests/playwright-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# JSON" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from ipywidgets import Button, Output\n", | ||
"from IPython import display\n", | ||
"\n", | ||
"button = Button(description='Output JSON')\n", | ||
"output = Output()\n", | ||
"obj = {\n", | ||
" \"abcde\": 1234,\n", | ||
" \"nested\": list(range(10))\n", | ||
"}\n", | ||
"\n", | ||
"@output.capture()\n", | ||
"def on_click(change):\n", | ||
" display.display(display.JSON(obj))\n", | ||
" \n", | ||
" \n", | ||
"button.on_click(on_click)\n", | ||
"display.display(button)\n", | ||
"output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"display.JSON(obj)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Fasta" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fasta_button = Button(description='Output FASTA')\n", | ||
"fasta_output = Output()\n", | ||
"\n", | ||
"\n", | ||
"def Fasta(data=''):\n", | ||
" bundle = {}\n", | ||
" bundle['application/vnd.fasta.fasta'] = data\n", | ||
" bundle['text/plain'] = data\n", | ||
" display.display(bundle, raw=True)\n", | ||
" \n", | ||
" \n", | ||
"@fasta_output.capture()\n", | ||
"def on_click(change):\n", | ||
" Fasta(\"\"\">SEQUENCE_1\n", | ||
"MTEITAAMVKELRESTGAGMMDCKNALSETNGDFDKAVQLLREKGLGKAAKKADRLAAEG\n", | ||
"LVSVKVSDDFTIAAMRPSYLSYEDLDMTFVENEYKALVAELEKENEERRRLKDPNKPEHK\n", | ||
"IPQFASRKQLSDAILKEAEEKIKEELKAQGKPEKIWDNIIPGKMNSFIADNSQLDSKLTL\n", | ||
"MGQFYVMDDKKTVEQVIAEKEKEFGGKIKIVEFICFEVGEGLEKKTEDFAAEVAAQL\n", | ||
">SEQUENCE_2\n", | ||
"SATVSEINSETDFVAKNDQFIALTKDTTAHIQSNSLQSVEELHSSTINGVKFEEYLKSQI\n", | ||
"ATIGENLVVRRFATLKAGANGVVNGYIHTNGRVGVVIAAACDSAEVASKSRDLLRQICMH\"\"\")\n", | ||
"\n", | ||
"\n", | ||
"fasta_button.on_click(on_click)\n", | ||
"display.display(fasta_button)\n", | ||
"fasta_output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# GeoJSON" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from IPython.display import GeoJSON\n", | ||
"\n", | ||
"\n", | ||
"geojson_button = Button(description='Output GeoJSON')\n", | ||
"geojson_output = Output()\n", | ||
"\n", | ||
" \n", | ||
"@geojson_output.capture()\n", | ||
"def on_click(change):\n", | ||
" obj = GeoJSON({\n", | ||
" \"type\": \"Feature\",\n", | ||
" \"geometry\": {\n", | ||
" \"type\": \"Point\",\n", | ||
" \"coordinates\": [-118.4563712, 34.0163116]\n", | ||
" }\n", | ||
" })\n", | ||
" display.display(obj)\n", | ||
" \n", | ||
"\n", | ||
"geojson_button.on_click(on_click)\n", | ||
"display.display(geojson_button)\n", | ||
"geojson_output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.1" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
// We dynamically set the webpack public path based on the page config | ||
// settings from the JupyterLab app. We copy some of the pageconfig parsing | ||
// logic in @jupyterlab/coreutils below, since this must run before any other | ||
// files are loaded (including @jupyterlab/coreutils). | ||
|
||
/** | ||
* Get global configuration data for the Jupyter application. | ||
* | ||
* @param name - The name of the configuration option. | ||
* | ||
* @returns The config value or an empty string if not found. | ||
* | ||
* #### Notes | ||
* All values are treated as strings. | ||
* For browser based applications, it is assumed that the page HTML | ||
* includes a script tag with the id `jupyter-config-data` containing the | ||
* configuration as valid JSON. In order to support the classic Notebook, | ||
* we fall back on checking for `body` data of the given `name`. | ||
*/ | ||
function getOption(name) { | ||
let configData = Object.create(null); | ||
// Use script tag if available. | ||
if (typeof document !== 'undefined' && document) { | ||
const el = document.getElementById('jupyter-config-data'); | ||
|
||
if (el) { | ||
configData = JSON.parse(el.textContent || '{}'); | ||
} | ||
} | ||
return configData[name] || ''; | ||
} | ||
|
||
// eslint-disable-next-line no-undef | ||
__webpack_public_path__ = getOption('fullStaticUrl') + '/'; |
Oops, something went wrong.