1650240000
ipywidgets: Interactive HTML Widgets
Purpose | Badges |
---|---|
Latest (master: future 8.0) | |
Stable | |
Communication | |
ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel.
Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.
Learning becomes an immersive, fun experience. Researchers can easily see how changing inputs to a model impact the results. We hope you will add ipywidgets to your notebooks, and we're here to help you get started.
The fundamental widgets provided by this library are called core interactive widgets. A demonstration notebook provides an overview of the core interactive widgets, including:
Besides the widgets already provided with the library, the framework can be extended with the development of custom widget libraries. For detailed information, please refer to the ipywidgets documentation.
A template project for building custom widgets is available as a cookiecutter. This cookiecutter project helps custom widget authors get started with the packaging and the distribution of their custom Jupyter interactive widgets. The cookiecutter produces a project for a Jupyter interactive widget library following the current best practices for using interactive widgets. An implementation for a placeholder "Hello World" widget is provided as an example.
Popular widget libraries such as bqplot, pythreejs and ipyleaflet follow exactly the same template and directory structure. They serve as more advanced examples of usage of the Jupyter widget infrastructure.
Examples of custom widget libraries built upon ipywidgets are
The stable version of ipywidgets can be installed with pip or conda.
With pip:
pip install ipywidgets
With conda:
conda install -c conda-forge ipywidgets
Installing from source is more complicated and requires a developer install, see the detailed developer install instructions.
If you want to install ipywidgets from source, you will need the yarn package manager version 1.2.1 or later. To install the latest master version from the root directory of the source code, run dev-install.sh
. To only build the Python package enter pip install -e .
.
See the examples section of the documentation. The widgets are being used in a variety of ways; some uses can be seen in these notebooks: Demo notebook of interactive widgets
Refer to change log for more detail.
ipywidgets | JupyterLab | Classic Notebook | nbclassic |
---|---|---|---|
master | - | TBD | |
7.6.3 | 0.2.6 | ||
Legacy | |||
6.x | - | ||
5.x | 4.2 | - | |
4.1.x | 4.1 | - | |
4.0.x | 4.0 | - |
Author: jupyter-widgets
Source Code: https://github.com/jupyter-widgets/ipywidgets
License: BSD-3-Clause License
1672238100
ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel.
Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.
Learning becomes an immersive, fun experience. Researchers can easily see how changing inputs to a model impact the results. We hope you will add ipywidgets to your notebooks, and we're here to help you get started.
The fundamental widgets provided by this library are called core interactive widgets. A demonstration notebook provides an overview of the core interactive widgets, including:
Besides the widgets already provided with the library, the framework can be extended with the development of custom widget libraries. For detailed information, please refer to the ipywidgets documentation.
A template project for building custom widgets is available as a cookiecutter. This cookiecutter project helps custom widget authors get started with the packaging and the distribution of their custom Jupyter interactive widgets. The cookiecutter produces a project for a Jupyter interactive widget library following the current best practices for using interactive widgets. An implementation for a placeholder "Hello World" widget is provided as an example.
Popular widget libraries such as bqplot, pythreejs and ipyleaflet follow exactly the same template and directory structure. They serve as more advanced examples of usage of the Jupyter widget infrastructure.
Examples of custom widget libraries built upon ipywidgets are
The stable version of ipywidgets can be installed with pip or conda.
With pip:
pip install ipywidgets
With conda:
conda install -c conda-forge ipywidgets
Installing from source is more complicated and requires a developer install, see the detailed developer install instructions.
If you want to install ipywidgets from source, you will need the yarn package manager version 1.2.1 or later. To install the latest master version from the root directory of the source code, run dev-install.sh
. To only build the Python package enter pip install -e .
.
See the examples section of the documentation. The widgets are being used in a variety of ways; some uses can be seen in these notebooks: Demo notebook of interactive widgets
Refer to change log for more detail.
ipywidgets | JupyterLab | Classic Notebook | nbclassic |
---|---|---|---|
master | - | TBD | |
7.6.3 | 0.2.6 | ||
Legacy | |||
6.x | - | ||
5.x | 4.2 | - | |
4.1.x | 4.1 | - | |
4.0.x | 4.0 | - |
Developer Meetings take place on zoom, on Tuesdays at 9:30AM Pacific Time (your time).
Minutes are taken at Hackmd.io.
Author: jupyter-widgets
Source Code: https://github.com/jupyter-widgets/ipywidgets
License: BSD-3-Clause license
1591267200
Nosso convidado de hoje é diretor técnico na Work & Co, PhD em Ciências da Computação, já contribuiu com inúmeros projetos open source em Python, ajudou a fundar a Associação Python Brasil e já foi premiado com o Prêmio Dorneles Tremea por contribuições para a comunidade Python Brasil.
#alexandre oliva #anaconda #apache zeppelin #associação python brasil #azure notebooks #beakerx #binder #c++ #closure #colaboratory #donald knuth #fernando pérez #fortran #graphql #guido van rossum #ipython #java #javascript #json #jupyter kenels #jupyter notebooks #jupyterhub #jupyterlab #latex #lisp #literate programming #lua #matlab #perl #cinerdia #prêmio dorneles tremea #python #r #rodrigo senra #scala #spark notebook #tcl #typescript #zope
1672193648
The Jupyter notebook is a web-based notebook environment for interactive computing.
We maintain the two most recently released major versions of Jupyter Notebook, Notebook v5 and Classic Notebook v6. After Notebook v7.0 is released, we will no longer maintain Notebook v5. All Notebook v5 users are strongly advised to upgrade to Classic Notebook v6 as soon as possible.
The Jupyter Notebook project is currently undertaking a transition to a more modern code base built from the ground-up using JupyterLab components and extensions.
There is new stream of work which was submitted and then accepted as a Jupyter Enhancement Proposal (JEP) as part of the next version (v7): https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
There is also a plan to continue maintaining Notebook v6 with bug and security fixes only, to ease the transition to Notebook v7: https://github.com/jupyter/notebook-team-compass/issues/5#issuecomment-1085254000
The next major version of Notebook will be based on:
This represents a significant change to the jupyter/notebook
code base.
To learn more about Notebook v7: https://jupyter.org/enhancement-proposals/79-notebook-v7/notebook-v7.html
Maintainance and security-related issues are now being addressed in the 6.4.x
branch.
A 6.5.x
branch will be soon created and will depend on nbclassic
for the HTML/JavaScript/CSS assets.
New features and continuous improvement is now focused on Notebook v7 (see section above).
If you have an open pull request with a new feature or if you were planning to open one, we encourage switching over to the Jupyter Server and JupyterLab architecture, and distribute it as a server extension and / or JupyterLab prebuilt extension. That way your new feature will also be compatible with the new Notebook v7.
Jupyter notebook is a language-agnostic HTML notebook application for Project Jupyter. In 2015, Jupyter notebook was released as a part of The Big Split™ of the IPython codebase. IPython 3 was the last major monolithic release containing both language-agnostic code, such as the IPython notebook, and language specific code, such as the IPython kernel for Python. As computing spans across many languages, Project Jupyter will continue to develop the language-agnostic Jupyter notebook in this repo and with the help of the community develop language specific kernels which are found in their own discrete repos.
You can find the installation documentation for the Jupyter platform, on ReadTheDocs. The documentation for advanced usage of Jupyter notebook can be found here.
For a local installation, make sure you have pip installed and run:
pip install notebook
Launch with:
jupyter notebook
You need some configuration before starting Jupyter notebook remotely. See Running a notebook server.
See CONTRIBUTING.md
for how to set up a local development installation.
If you are interested in contributing to the project, see CONTRIBUTING.md
.
This repository is a Jupyter project and follows the Jupyter Community Guides and Code of Conduct.
Author: Jupyter
Source Code: https://github.com/jupyter/notebook
License: View license
1650240000
ipywidgets: Interactive HTML Widgets
Purpose | Badges |
---|---|
Latest (master: future 8.0) | |
Stable | |
Communication | |
ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel.
Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data.
Learning becomes an immersive, fun experience. Researchers can easily see how changing inputs to a model impact the results. We hope you will add ipywidgets to your notebooks, and we're here to help you get started.
The fundamental widgets provided by this library are called core interactive widgets. A demonstration notebook provides an overview of the core interactive widgets, including:
Besides the widgets already provided with the library, the framework can be extended with the development of custom widget libraries. For detailed information, please refer to the ipywidgets documentation.
A template project for building custom widgets is available as a cookiecutter. This cookiecutter project helps custom widget authors get started with the packaging and the distribution of their custom Jupyter interactive widgets. The cookiecutter produces a project for a Jupyter interactive widget library following the current best practices for using interactive widgets. An implementation for a placeholder "Hello World" widget is provided as an example.
Popular widget libraries such as bqplot, pythreejs and ipyleaflet follow exactly the same template and directory structure. They serve as more advanced examples of usage of the Jupyter widget infrastructure.
Examples of custom widget libraries built upon ipywidgets are
The stable version of ipywidgets can be installed with pip or conda.
With pip:
pip install ipywidgets
With conda:
conda install -c conda-forge ipywidgets
Installing from source is more complicated and requires a developer install, see the detailed developer install instructions.
If you want to install ipywidgets from source, you will need the yarn package manager version 1.2.1 or later. To install the latest master version from the root directory of the source code, run dev-install.sh
. To only build the Python package enter pip install -e .
.
See the examples section of the documentation. The widgets are being used in a variety of ways; some uses can be seen in these notebooks: Demo notebook of interactive widgets
Refer to change log for more detail.
ipywidgets | JupyterLab | Classic Notebook | nbclassic |
---|---|---|---|
master | - | TBD | |
7.6.3 | 0.2.6 | ||
Legacy | |||
6.x | - | ||
5.x | 4.2 | - | |
4.1.x | 4.1 | - | |
4.0.x | 4.0 | - |
Author: jupyter-widgets
Source Code: https://github.com/jupyter-widgets/ipywidgets
License: BSD-3-Clause License
1672266120
An IPython/Jupyter widget to interactively view molecular structures and trajectories. Utilizes the embeddable NGL Viewer for rendering. Support for showing data from the file-system, RCSB PDB, simpletraj and from objects of analysis libraries mdtraj, pytraj, mdanalysis, ParmEd, rdkit, ase, HTMD, biopython, cctbx, pyrosetta, schrodinger's Structure
Should work with Python 3. If you experience problems, please file an issue.
Ask question about usage? Please post here
Installation
Available on conda-forge
channel
conda install nglview -c conda-forge
# might need: jupyter-nbextension enable nglview --py --sys-prefix
# if you already installed nglview, you can `upgrade`
conda upgrade nglview --force
# might need: jupyter-nbextension enable nglview --py --sys-prefix
Available on PyPI
pip install nglview
# might need: jupyter-nbextension enable nglview --py --sys-prefix
Jupyterlab: nglview
works best with jupyterlab >= 3.0 and no further steps needed.
If you are using notebook
v5.0, you need to increase the iopub_data_rate_limit
to visualize big structure (e.g: solvated system)
jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000
Requirement: ipywidgets >= 7.0,<8
, notebook >= 4.2
The development version can be installed directly from github:
git clone https://github.com/arose/nglview
cd nglview
python setup.py install
# if you edit files in ./js folder, make sure to rebuild the code
cd js
npm install
# probably need to activate widgetsnbextension
# python -m ipykernel install --sys-prefix
# jupyter nbextension enable --py --sys-prefix widgetsnbextension
# jupyter nbextension enable --py --sys-prefix nglview
# tested with ipywidgets 5.2.2, notebook 4.2.1
Example
Showcase from users
Usage
Open a notebook
jupyter notebook
and issue
import nglview
view = nglview.show_pdbid("3pqr") # load "3pqr" from RCSB PDB and display viewer widget
view
A number of convenience functions are available to quickly display data from the file-system, RCSB PDB, simpletraj and from objects of analysis libraries mdtraj, pytraj, mdanalysis, ParmEd, rdkit, HTMD, biopython.
Function | Description |
---|---|
show_file(path) | Shows any NGL supported file formats (pdb, gro, mol2, sdf, dx, ..) in path |
show_pdbid(pdbid) | Shows pdbid fetched from RCSB PDB |
show_simpletraj(struc_path, traj_path) | Shows structure & trajectory loaded with simpletraj |
show_mdtraj(traj) | Shows MDTraj trajectory traj |
show_pytraj(traj) | Shows PyTraj trajectory traj |
show_parmed(structure) | Shows ParmEd structure |
show_mdanalysis(univ) | Shows MDAnalysis Universe or AtomGroup univ |
show_rdkit(mol) | Shows rdkit rdkit.Chem.rdchem.Mol |
show_ase(atoms) | Shows ase Atoms |
show_asetraj(traj) | Shows ase trajectory traj |
show_pymatgen(struct) | Shows pymatgen Structure |
show_htmd(mol) | Shows HTMD Molecules |
show_biopython(mol) | Shows Biopython structural entities |
show_iotbx(mol) | Shows cctbx's iotbx structure |
show_rosetta(pose) | Shows pyrosetta's Pose |
show_iodata(obj) | Shows iodata's IOData |
show_psi4(obj) | Shows psi4's Molecule |
show_qcelemental | Shows QCelementary's Molecule |
show_openbabel | Shows openbabel's OMol |
show_prody | Shows prody's Ensemble or AtomGroup |
API
view.add_representation('cartoon', selection='protein')
# or shorter
view.add_cartoon(selection="protein")
view.add_surface(selection="protein", opacity=0.3)
# specify color
view.add_cartoon(selection="protein", color='blue')
# specify residue
view.add_licorice('ALA, GLU')
# clear representations
view.clear_representations()
# update parameters for ALL cartoons of component 0 (default)
view.update_cartoon(opacity=0.4, component=0)
# remove ALL cartoons of component 0 (default)
view.remove_cartoon(opacity=0.4, component=0)
# Not using default representation
view = nv.show_file('your.pdb', default=False)
view.center()
view.add_rope()
Representations can also be changed by overwriting the representations
property of the widget instance view
. The available type
and params
are described in the NGL Viewer documentation.
view.representations = [
{"type": "cartoon", "params": {
"sele": "protein", "color": "residueindex"
}},
{"type": "ball+stick", "params": {
"sele": "hetero"
}}
]
The widget constructor also accepts a representation
argument:
initial_repr = [
{"type": "cartoon", "params": {
"sele": "protein", "color": "sstruc"
}}
]
view = nglview.NGLWidget(struc, representation=initial_repr)
view
# set the frame number
view.frame = 100
# parameters for the NGL stage object
view.stage.set_parameters(**{
# "percentages, "dist" is distance too camera in Angstrom
"clipNear": 0, "clipFar": 100, "clipDist": 10,
# percentages, start of fog and where on full effect
"fogNear": 0, "fogFar": 100,
# background color
"backgroundColor": "black",
})
# note: NGLView accepts both origin camel NGL keywords (e.g. "clipNear")
# and snake keywords (e.g "clip_near")
# parameters to control the `delay` between snapshots
# change `step` to play forward (positive value) or backward (negative value)
# note: experimental code
view.player.parameters = dict(delay=0.04, step=-1)
# update camera type
view.camera = 'orthographic'
# change background color
view.background = 'black'
# adding new trajectory
view.add_trajectory(traj)
# traj could be a `pytraj.Trajectory`, `mdtraj.Trajectory`, `MDAnalysis.Universe`,
# `parmed.Structure`, `htmd.Molecule` or derived class of `nglview.Trajectory`
# change representation
view[0].add_cartoon(...) # equal to view.add_cartoon(component=0)
view[1].add_licorice(...) # equal to view.add_licorice(component=1)
# Density volumes (MRC/MAP/CCP4, DX/DXBIN, CUBE)
# Or adding derived class of `nglview.Structure`
view.add_component('my.ccp4')
# add component from url
view.add_component('rcsb://1tsu.pdb')
# NOTE: Trajectory is a special case of component.
# coot mouse style (https://en.wikipedia.org/wiki/Coot_(software))
view.stage.set_parameters(mouse_preset='coot')
Require: moviepy (pip install moviepy
)
from nglview.contrib.movie import MovieMaker
movie = MovieMaker(view, output='my.gif', in_memory=True)
movie.make()
API doc
Command line
# open a notebook and import nglview
nglview
# Require installing pytraj (PR for other backends is welcome)
# open notebook, load `my.pdb` to pytraj's trajectory then display `view`
nglview my.pdb
# load density data
nglview my.ccp4
# open notebook, create trajectory with given topology `my.parm7` and trajecotry file `traj.nc`,
# then display `view`
nglview my.parm7 -c traj.nc
# load all trajectories with filename ending with 'nc'
# make sure to use quote " "
nglview my.parm7 -c "*.nc"
# open notebook, copy content from `myscript.py`
nglview myscript.py
# create a remote notebook
# just follow its instruction
nglview my.pdb --remote
nglview my.parm7 -c traj.nc --remote
nglview mynotebook.ipynb --remote
# demo (don't need pytraj)
nglview demo
# specify web browser
nglview my.pdb --browser=google-chrome
FAQ
Website
Talks
Contributing
Projects integrating NGLView
(Feel free to make a PR to add/remove your project here. Thanks.)
Acknowledgment
nglview
contributorsoceans16
themeCite
If you would like to acknowledge our work, feel free to cite:
Hai Nguyen, David A Case, Alexander S Rose; NGLview - Interactive molecular graphics for Jupyter notebooks, Bioinformatics, , btx789, https://doi.org/10.1093/bioinformatics/btx789
Author: nglviewer
Source Code: https://github.com/nglviewer/nglview
License: View license