A WYSIWYG layout editor for Jupyter widgets

Overview

ipyflex

Binder Documentation Status GitHub license PyPI version

A WYSIWYG layout editor for Jupyter widgets

Based on the React library FlexLayout, ipyflex allows you to compose the sophisticated dashboard layouts from existing Jupyter widgets without coding. It supports multiple tabs, resizable cards, drag-and-drop layout, save dashboard template to disk, and many more.

Example

Dynamic layout

Dynamic layout

Stock indexes dashboard

Stock indexes

Documentation

You can read the documentation following this link: https://ipyflex.readthedocs.io

Installation

You can install using pip:

pip install ipyflex

Or using conda:

conda install -c conda-forge  ipyflex

And if you use jupyterlab <= 2:

mamba install -c conda-forge yarn
jupyter labextension install @jupyter-widgets/jupyterlab-manager ipyflex

Development Installation

Create a dev environment:

conda create -n ipyflex-dev -c conda-forge nodejs yarn python jupyterlab
conda activate ipyflex-dev

Install the python. This will also build the TS package.

pip install -e ".[test, examples]"

When developing your extensions, you need to manually enable your extensions with the notebook / lab frontend. For lab, this is done by the command:

jupyter labextension develop --overwrite .
yarn run build

For classic notebook, you need to run:

jupyter nbextension install --sys-prefix --symlink --overwrite --py ipyflex
jupyter nbextension enable --sys-prefix --py ipyflex

Note that the --symlink flag doesn't work on Windows, so you will here have to run the install command every time that you rebuild your extension. For certain installations you might also need another flag instead of --sys-prefix, but we won't cover the meaning of those flags here.

How to see your changes

Typescript:

If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the widget.

# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
# Run JupyterLab in another terminal
jupyter lab

After a change wait for the build to finish and then refresh your browser and the changes should take effect.

Python:

If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.

Comments
  • Create widget from factory

    Create widget from factory

    In the case of using existing widgets in FlexLayout dashboard, users can create multiple views of a widget, so all tabs are linked.

    If users want to have the independent widget in each tab, FlexLayout allows users to define the factories to create widgets from the interface.

    def slider_factory(label: 'Label of slider', value: 'Initial value'):
        return ipywidgets.FloatSlider(value=float(value), description=label )
    
    factories = {"Slider factory": slider_factory}
    
    dashboard = FlexLayout(factories=factories)
    

    factory_widget

    • If the factory function needs parameters, FlexLayout will build an input form to get parameters from the interface. Users can define annotations to have the label of the input form.

    • FlexLayout will pass all parameters as string, users need to convert the inputs to their appropriate type in the factory function.

    Close #17

    enhancement UI 
    opened by trungleduc 3
  • FlexLayout widget fails to render in voila v0.4 and ipywidgets v8

    FlexLayout widget fails to render in voila v0.4 and ipywidgets v8

    In voila v0.4, I get the following Javascript error:

    Model class 'FlexLayoutModel' from module 'ipyflex' is loaded but can not be instantiated
    TypeError: this.widget_manager.display_model is not a function
        at d.initialize (https://cdn.jsdelivr.net/npm/ipyflex@%5E0.2.2/dist/index.js:75:782852)
        at new t.Model (http://localhost:8888/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:61:579272)
        at new T (http://localhost:8888/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:23:17621)
        at new S (http://localhost:8888/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:23:23418)
        at new d (https://cdn.jsdelivr.net/npm/ipyflex@%5E0.2.2/dist/index.js:75:782350)
        at tn._make_model (http://localhost:8888/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:112234)
    

    In Jupyterlab, the FlexLayout widget renders fine, however.

    bug 
    opened by nunupeke 2
  • configuring the layout / flex functionality?

    configuring the layout / flex functionality?

    hi there,

    excited to use this!

    I'm considering a use case for ipyflex as a UI for creating an A4 format output pdf report.

    To do so i'd like to use the widget factory, allowing users to add items to the report, and specify that items must be vertically stacked, i.e.: image

    ideally the user would be able to drag the boxes up and down to change order but wouldn't be able to do anything else...

    is this possible?

    many thanks

    opened by jgunstone 2
  • Ipyflex with Jupyterlite

    Ipyflex with Jupyterlite

    Hi, Ipyflex is a great library. Thanks for sharing!

    I couldn't get Ipyflex to display in Jupyterlite. If possible, please could you show an example of Ipyflex working in Jupyterlite.

    Here is the sample code I used that didn't work.

    import micropip
    await micropip.install("ipyflex")
    import ipyflex
    
    ipyflex.FlexLayout(
        header={"title": "Test", "style": {"backgroundColor": "rgb(53 53 53)"}}, # , "buttons":["export","import"]
    )
    

    The widget doesn't display. I just get the "Loading widget..." text under the cell.

    opened by DougRzz 2
  • ipyvuetify examples

    ipyvuetify examples

    This notebook uses upyvuetify objects inside the flex components. It shows that ipyflex is also compatible with the super powerful library ipyvuetify.

    documentation 
    opened by joseberlines 2
  • Saving of template doesn't work outside of notebook

    Saving of template doesn't work outside of notebook

    Thanks for this great package! I noticed that FlexLayout() can be rendered statically, but in that case, the template saving doesn't work (it'd be awesome if it did)

    from ipyflex import FlexLayout
    import ipywidgets as ipw
    
    widgets = {
        "Widget 1": ipw.HTML("<h1>Widget 1</h1>"),
        "Widget 2": ipw.HTML("<h1>Widget 2</h1>"),
        "Widget 3": ipw.HTML("<h1>Widget 3</h1>"),
        "Widget 4": ipw.HTML("<h1>Widget 4</h1>"),
    }
    w = FlexLayout(widgets, style={"height": "400px"})
    
    from ipywidgets.embed import embed_minimal_html
    embed_minimal_html("index.html", views=[w])
    
    enhancement 
    opened by cpsievert 2
  • Automated Changelog Entry for 0.2.6 on master

    Automated Changelog Entry for 0.2.6 on master

    Automated Changelog Entry for 0.2.6 on master

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | trungleduc/ipyflex | | Branch | master | | Version Spec | 0.2.6 | | Since | v0.2.5 |

    documentation 
    opened by trungleduc 1
  • Automated Changelog Entry for 0.2.5 on master

    Automated Changelog Entry for 0.2.5 on master

    Automated Changelog Entry for 0.2.5 on master

    Python version: 0.2.5
    npm version: ipyflex: 0.2.4
    

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | trungleduc/ipyflex | | Branch | master | | Version Spec | 0.2.5 | | Since | v0.2.4 |

    documentation 
    opened by trungleduc 1
  • Automated Changelog Entry for 0.3.0 on master

    Automated Changelog Entry for 0.3.0 on master

    Automated Changelog Entry for 0.3.0 on master

    Python version: 0.3.0
    npm version: ipyflex: 0.2.4
    

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | trungleduc/ipyflex | | Branch | master | | Version Spec | 0.3.0 | | Since | v0.2.4 |

    documentation 
    opened by trungleduc 1
  • Automated Changelog Entry for 0.2.4 on master

    Automated Changelog Entry for 0.2.4 on master

    Automated Changelog Entry for 0.2.4 on master

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | trungleduc/ipyflex | | Branch | master | | Version Spec | 0.2.4 | | Since | v0.2.3 |

    documentation 
    opened by trungleduc 1
  • Automated Changelog Entry for 0.2.3 on master

    Automated Changelog Entry for 0.2.3 on master

    Automated Changelog Entry for 0.2.3 on master

    Python version: 0.2.3
    npm version: ipyflex: 0.2.2
    

    After merging this PR run the "Full Release" Workflow on your fork of jupyter_releaser with the following inputs | Input | Value | | ------------- | ------------- | | Target | trungleduc/ipyflex | | Branch | master | | Version Spec | 0.2.3 | | Since | v0.2.2 |

    documentation 
    opened by trungleduc 1
  • Tab bar hides upon FlexLayout.load_template

    Tab bar hides upon FlexLayout.load_template

    We use ipyflex to let our users build their own dashboard. This works great, but at some moments the tab bar, with the '+' button, becomes hidden without any user interaction requesting this behavior. One of such moment is upon FlexLayout.load_template.

    Unfortunately, I cannot share the full code we are using. But if needed I can try to create a MWE. Note that just disabling the whole 'hide tab bar' feature would already be a big help.

    opened by margrietpalm 3
Releases(v0.2.6)
Owner
Duc Trung LE
Scientific Software Engineer at @QuantStack
Duc Trung LE
Using the jedi autocompletion library for VIM.

jedi-vim - awesome Python autocompletion with VIM jedi-vim is a VIM binding to the autocompletion library Jedi. Here are some pictures: Completion for

Dave Halter 5.1k Dec 31, 2022
A simple Notepad-like editor written in Python

monkepad A simple Notepad-like editor written in Python Since MonkePad is written in one file, all your customization can be done without much trouble

5 Dec 28, 2021
A gui-script-editor(Based on pyqt5, pyautogui) to writing your gui script.

gui-script-editor A gui-script-editor(Based on pyqt5, pyautogui) to writing your gui script. ##更新说明 版本号:1.0.0 版本说明:实现了脚本编辑器雏形,未实现执行报告,自动化脚本管理(只支持单个脚本运

2 Dec 22, 2021
openBrowsser is a Sublime Text plug-in, which allows you to add a keyboard shortcut, to directly access a website from a selection.

openBrowsser is a Sublime Text plug-in, which allows you to add a keyboard shortcut, to directly access a website from a selection. Instal

Florian COLLIN 1 Dec 14, 2021
Frappe tinymce - Frappe app to replace default text editor with tinymce

Frappe tinyMCE tinyMCE Text Editor for frappe apps Replace frappe's Quill Text E

Shridhar Patil 23 Nov 16, 2022
Python IDE for beginners

Thonny Thonny is a Python IDE meant for learning programming. End users See https://thonny.org and wiki for more info. Contributors Contributions are

Thonny, Python IDE for beginners 2.1k Jan 02, 2023
A free Python source code editor and Notepad replacement for Windows

Website Download Features Toolbar Wide array of view options Syntax highlighting support for Python Usable accelerator keys for each function (Ctrl+N,

Mohamed Ahmed 7 Feb 16, 2022
Python Tools for Visual Studio

Python tools for Visual Studio Python support for Visual Studio is developed and managed here. Visit our product overview and downloads page, read our

Microsoft 2.4k Dec 30, 2022
Jupyter Interactive Notebook

Jupyter Notebook The Jupyter notebook is a web-based notebook environment for interactive computing. Notice Please note that this repository is curren

Project Jupyter 9.7k Jan 02, 2023
Write maintainable, production-ready pipelines using Jupyter or your favorite text editor. Develop locally, deploy to the cloud. ☁️

Write maintainable, production-ready pipelines using Jupyter or your favorite text editor. Develop locally, deploy to the cloud. ☁️

Ploomber 2.9k Jan 06, 2023
Cameray is a lens editor and simulator for fun.

Cameray is a lens editor and simulator for fun. It's could be used for studying an optics system of DSLR in an interactive way. But the project is in a very early version. The program is still crash-

Shuoliu Yang 59 Dec 10, 2022
Encriptificator is a text editor app developed by me as a personal project.

Encriptificator is a text editor app developed by me as a personal project. It provides all basic features of a text editor with the additional feature of encrypting your files. To know more about ho

1 May 09, 2022
Emacs Python Development Environment

Elpy, the Emacs Python IDE Elpy is an Emacs package to bring powerful Python editing to Emacs. It combines and configures a number of other packages,

Jorgen Schäfer 1.8k Jan 02, 2023
A WYSIWYG layout editor for Jupyter widgets

Based on the React library FlexLayout, ipyflex allows you to compose the sophisticated dashboard layouts from existing Jupyter widgets without coding. It supports multiple tabs, resizable cards, drag

Duc Trung LE 93 Nov 24, 2022
Leo is an Outliner, Editor, IDE and PIM written in 100% Python.

Leo 6.3, http://leoeditor.com, is now available on GitHub. Leo is an IDE, outliner and PIM. The highlights of Leo 6.3 leoAst.py: The unification of Py

Leo Editor 1.4k Dec 27, 2022
A small, simple editor for beginner Python programmers. Written in Python and Qt5.

Mu - A Simple Python Code Editor Mu is a simple code editor for beginner programmers based on extensive feedback from teachers and learners. Having sa

Mu 1.2k Jan 03, 2023
JupyterLite is a JupyterLab distribution that runs entirely in the browser power by wasm

JupyterLite is a JupyterLab distribution that runs entirely in the browser built from the ground-up using JupyterLab components and extensions.

Jeremy Tuloup 76 Dec 13, 2022
PlugNik is a simple implementation of plugin repository for JetBrains Application.

PlugNik is a simple implementation of plugin repository for JetBrains Application.

roy reznik 11 Jun 30, 2022
cross-editor syntax highlighter for Lua, showing some merit of Typed BNF

Cross-editor contextual syntax highlighter via Typed BNF Do you like "one grammar, syntax highlighters everywhere?" 喜欢我一个文法,到处高亮吗? PS: NOTE that paren

Taine Zhao 14 Feb 09, 2022
Vim python-mode. PyLint, Rope, Pydoc, breakpoints from box.

Python-mode, a Python IDE for Vim This project needs contributors. Documentation: :help pymode https://github.com/python-mode/python-mode/wiki Importa

The Python-Mode 5.4k Jan 01, 2023