Skip to main content

einteract

[!WARNING] This package has been deprecated and is no longer actively maintained. For improved interactive dashboards within Jupyter and to access future developments, we recommend migrating to DashLab.

Binder PyPI version Downloads

An enhanced interactive widget that lets you observe any trait of widgets, observe multiple functions and build beautiful dashboards which can be turned into full screen. This is a wrapper library around interact functionality in ipyslides which also provides rich content representations.

Installation

You can install einteract using pip:

pip install einteract

Or if you prefer to install from source, clone the repository and in its top folder, run:

pip install -e .

Interactive Playground

✨ Try it in your browser ✨

Jupyter Lab Notebook Binder
Binder

Features

  • InteractBase: Create interactive dashboard applications with minimal code by extending the InteractBase class and defining methods with the @callback decorator.
  • Custom Widgets:
    • Included custom built widgets for enhanced interaction.
    • Pass any DOMWidget as a parameter to interact/interactive functions unlike default ipywidgets.interactive behavior.
    • Observe any trait of the widget by 'widget_name.trait_name' where 'widget_name' is assigned to a widget/fixed(widget) in control parameters, OR '.trait_name' if trait_name exists on instance of interactive.
    • You can use '.fullscreen' to detect fullscreen change and do actions based on that.
    • Add ipywidgets.Button to hold callbacks which use it as paramter for a click
  • Plotly Integration: Modified plotly support with additional traits like selected and clicked
  • HTML support:
    • Any (supported) python object can be converted to html using hstack and vstack function.
  • JupyTimer: A non-blocking widget timer for Jupyter Notebooks without threading/asyncio.
  • Event Callbacks: Easy widget event handling with the @callback decorator inside the subclass of InteractBase or multiple functions in interact/interactive functions.
  • Full Screen Mode: Transform your dashboards into full-screen applications by added button.

Usage Example

import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as ipw
import pandas as pd
import plotly.graph_objects as go
import einteract as ei

dash = ei.Dashboard(
    fig = ei.patched_plotly(go.FigureWidget()), 
    html = ipw.HTML('**Select Box/Lesso on figure traces**'),
    A = (1,10), omega = (0,20), phi = (0,10),
    sdata = 'fig.selected', cdata = 'fig.clicked', fs = '.isfullscreen',
)
@dash.callback('out-click', throttle = 200) # limit click rate by 200 ms
def on_click(cdata,html):
    display(pd.DataFrame(cdata or {}))

@dash.callback('out-select')
def on_select(sdata, html):
    plt.scatter(sdata.get('xs',[]),sdata.get('ys',[]))
    plt.show()

@dash.callback('out-fs')
def detect_fs(fig, fs):
    print("isfullscreen = ",fs)
    fig.layout.autosize = False # double trigger
    fig.layout.autosize = True

@dash.callback
def plot(fig:go.FigureWidget, A, omega,phi): # adding type hint allows auto-completion inside function
    fig.data = []
    x = np.linspace(0,10,100)
    fig.add_trace(go.Scatter(x=x, y=A*np.sin(omega*x + phi), mode='lines+markers'))

dash.set_css({
    '.left-sidebar':{'background':'whitesmoke'},
    ':fullscreen': {'height': '100vh'}}
)
dash.set_layout(
    left_sidebar=['A','omega','phi','html','out-main'], 
    center=['fig','out-click'], 
    pane_widths=[3,7,0],
)

dash

einteract.gif

Comprehensive Examples

Metadata

Release files for einteract 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for einteract 1.4.3
File Size Uploaded
einteract-1.4.3.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for einteract 1.4.3
File Interpreter ABI Platform
einteract-1.4.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 11.4 kB

Release files / einteract-1.4.3.tar.gz

Download URL einteract-1.4.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
abead4fd52df86e0bd2418d2c1b488a3a6f5c2b10430cfb5c7211becfd0fec6a
BLAKE2b-256 checksum
How to use checksums
cc01ca48f1d339b9287bcbe044044b402598fa9c8a97df618e775792d0d82a81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release files / einteract-1.4.3-py2.py3-none-any.whl

Download URL einteract-1.4.3-py2.py3-none-any.whl
Size 5.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0dc7edba244bd8768e96dafdc595004658b4371fd73e17db3dccf33ea6b91354
BLAKE2b-256 checksum
How to use checksums
9d8f91d3172b820d1a232a2acc1659d109cbf6bb2192a556abd8234668375bfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.4.3 This release

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.9

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

1 release file

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page