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
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
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
A basic Python IDE made by Anh Đức

Python IDE by Anh Đức A basic Python IDE made with python module tkinter. Hope you enjoy this IDE! V 1.3 "Open Terminal from IDE" feature V 1.2 Now yo

1 May 30, 2022
Official repository for Spyder - The Scientific Python Development Environment

Copyright © 2009–2021 Spyder Project Contributors Some source files and icons may be under other authorship/licenses; see NOTICE.txt. Project status B

Spyder IDE 7.3k Dec 31, 2022
Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.

Komodo Edit This readme explains how to get started building, using and developing with the Komodo Edit source base. Whilst the main Komodo Edit sourc

ActiveState Komodo 2k Dec 28, 2022
A powerful text editor for MATE

Pluma - The MATE text editor General Information Pluma (pluma) is a small and lightweight UTF-8 text editor for the MATE environment. It started as a

MATE Desktop 134 Dec 31, 2022
Vim plugin for executing Python's optional static type checker MyPy

Vim plugin for executing Python's optional static type checker MyPy

Mark McDonnell 91 Dec 04, 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
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
{Ninja-IDE Is Not Just Another IDE}

Ninja-IDE Is Not Just Another IDE Ninja-IDE is a cross-platform integrated development environment (IDE) that allows developers to create applications

ninja-ide 919 Dec 14, 2022
ReText: Simple but powerful editor for Markdown and reStructuredText

Welcome to ReText! ReText is a simple but powerful editor for Markdown and reStructuredText markup languages. One can also add support for custom mark

ReText 1.6k Dec 23, 2022
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
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 very simple Editor.js parser written in pure Python

pyEditor.js A very simple Editor.js parser written in pure Python. Soon-to-be published on PyPI. Features: Automatically convert Editor.js's JSON outp

Kevo 7 Nov 01, 2022
A code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim NOTE: Minimum Requirements Have Changed Our policy is to support the Vim version that's in the latest

24.5k Dec 30, 2022
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
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
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
An experimental code editor for writing algorithms

Algojammer Algojammer is an experimental, proof-of-concept code editor for writing algorithms in Python. It was mainly written to assist with solving

Chris Knott 2.9k Dec 27, 2022
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