-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses @powsybl/diagram-viewer to build jupyter notebook widgets (#4)
* adds a SvgSldView widget based on the single-line-diagram-viewer * recreated build template from the latest widget-ts-cookiecutter; updates build dependencies to python 3.11, node 18 and jupyter-lab 3.6 * adds a first, basic explorer widget (composition of existing widgets and the SVG viewer) * aligns code to the latest version of diagram-viewer * aligns dependencies to the latest widget-ts-cookiecutter's, to make it work with python 3.12 and jupyterlab >= 4 * adds to the SLD explorer the ability to toggle a switch. * updates the diagram-viewer dependency * moves diagrams' border declaration style to the .css and applies it consistently to the widgets * reduces cell flickering with the SLD explorer * improves readability: splits widgets code in multiple files (one per widget), renames files and references, accordingly Signed-off-by: Christian Biasuzzi <[email protected]>
- Loading branch information
Showing
38 changed files
with
9,713 additions
and
27,015 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
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 @@ | ||
nodeLinker: node-modules |
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,4 @@ | ||
.svg-sld-viewer-widget { | ||
border: 2px solid lightgrey; | ||
display: inline-block; | ||
} |
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,4 @@ | ||
.svg-viewer-widget { | ||
border: 2px solid lightgrey; | ||
display: inline-block; | ||
} |
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b6d17e9b-2a42-481b-903c-a8761f1fe829", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from pypowsybl_jupyter import display_svg\n", | ||
"import pypowsybl.network as pn" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a41c8d0d-1340-400b-ab05-5e33657c4bf0", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"network = pn.create_ieee9()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4aeb5de0-94a1-464e-b561-fe0a90fc27f4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#display an SVG (e.g., a single-line-diagram svg), with pan and zoom\n", | ||
"display_svg(network.get_single_line_diagram(network.get_voltage_levels().index[1]))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.11.6" | ||
} | ||
}, | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b6d17e9b-2a42-481b-903c-a8761f1fe829", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from pypowsybl_jupyter import network_explorer\n", | ||
"import pypowsybl.network as pn" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a41c8d0d-1340-400b-ab05-5e33657c4bf0", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"network = pn.create_ieee9()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4aeb5de0-94a1-464e-b561-fe0a90fc27f4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Display a simple explorer widget for the network\n", | ||
"#built by assembling the SvgView SVG viewer and other basic ipywidgets.\n", | ||
"#Start typing some prefix characters for the ID in the text box (e.g., VL)\n", | ||
"#then select one from the list of filtered VLs and click the button to update the diagram.\n", | ||
"network_explorer(network)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.11.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.