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
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
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
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 3, 2023
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
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
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

null 5 Dec 28, 2021
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
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-prone and also lack of many realistic camera features now.

Shuoliu Yang 59 Dec 10, 2022
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 1, 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 how to use the encryption features , please read the readme file.

null 1 May 9, 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 版本说明:实现了脚本编辑器雏形,未实现执行报告,自动化脚本管理(只支持单个脚本运

null 2 Dec 22, 2021
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 9, 2022
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
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 2, 2023
Layout Analysis Evaluator for the ICDAR 2017 competition on Layout Analysis for Challenging Medieval Manuscripts

LayoutAnalysisEvaluator Layout Analysis Evaluator for: ICDAR 2019 Historical Document Reading Challenge on Large Structured Chinese Family Records ICD

null 17 Dec 8, 2022
layout-parser 3.4k Dec 30, 2022
split-manga-pages: a command line utility written in Python that converts your double-page layout manga to single-page layout.

split-manga-pages split-manga-pages is a command line utility written in Python that converts your double-page layout manga (or any images in double p

Christoffer Aakre 3 May 24, 2022
I3-master-layout - Simple master and stack layout script

Simple master and stack layout script | ------ | ----- | | | | | Ma

Tobias S 18 Dec 5, 2022
OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality v

OpenShot Studios, LLC 3.1k Jan 1, 2023