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
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
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
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
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
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
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 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
{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
Python-Text-editor: a simple text editor on Python and Tkinter

Python-Text-editor This is a simple text editor on Python and Tkinter. The proje

Innokentie 1 Jan 03, 2022
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
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
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
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
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
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