Skip to main content

Wrapper around the LineUp.js library for multi attribute rankings

Project description

LineUp.js as Jupyter Widget

License: MIT CircleCI CircleCI

LineUp is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes. This is a Jupyter Widget wrapper around the JavaScript library LineUp.js. Details about the LineUp visualization technique can be found at http://lineup.caleydo.org.

Installation

  1. install Jupyter Widgets

    pip install ipywidgets
    jupyter nbextension enable --py widgetsnbextension
    
  2. install library

    pip install lineup_widget
    jupyter nbextension enable --py --sys-prefix lineup_widget
    
  3. OR directly via repository (requires node and npm to be installed):

    pip install -e git+https://github.com/lineupjs/lineup_widget.git#egg=lineup_widget
    jupyter nbextension enable --py --sys-prefix lineup_widget
    
  4. Jupyterlab

    jupyter labextension install @jupyter-widgets/jupyterlab-manager
    jupyter labextension install lineup_widget
    jupyter lab
    

Examples

Launch Binder

import lineup_widget
import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))

w = lineup_widget.LineUpWidget(df)
w.on_selection_changed(lambda selection: print(selection))
w

simple usage

from __future__ import print_function
from ipywidgets import interact, interactive, interact_manual

def selection_changed(selection):
    return df.iloc[selection]

interact(selection_changed, selection=lineup_widget.LineUpWidget(df));

interact example

Hint:

In case you see scrollbars in each cell it is because of the font the cells are too narrow, you can specify a larger row height using

w = lineup_widget.LineUpWidget(df, options=dict(rowHeight=20))

Release Package

  1. JavaScript NPM

    cd js
    npm install
    npm publish
    
  2. Python PyPi

    pip install -U twine setuptools
    
    python setup.py clean sdist bdist_wheel
    twine upload dist/*
    
  3. Git

    git tag v<version>
    git push --follow-tags
    
  4. update versions edit the version in

    • js/package.json
    • js/lib/version.ts
    • lineup_widget/_version.py

Authors

  • Samuel Gratzl (@sgratzl)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lineup_widget-4.0.0.tar.gz (848.2 kB view details)

Uploaded Source

Built Distribution

lineup_widget-4.0.0-py2.py3-none-any.whl (1.7 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file lineup_widget-4.0.0.tar.gz.

File metadata

  • Download URL: lineup_widget-4.0.0.tar.gz
  • Upload date:
  • Size: 848.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.1

File hashes

Hashes for lineup_widget-4.0.0.tar.gz
Algorithm Hash digest
SHA256 41a0a2054903c626d1c31da94096784001d9474bcca17c193a7d9978c87e23ec
MD5 c6a0e2d4b3225801040195c6f07a2354
BLAKE2b-256 a2ba13d9218135646704d31f952f5a2bca838b691a074a0e112780693d4c25b0

See more details on using hashes here.

File details

Details for the file lineup_widget-4.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: lineup_widget-4.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.1

File hashes

Hashes for lineup_widget-4.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c06cbc10125f5f9cefd4df38c158418a9f60c9886ba0fe131a65f62c69734c7b
MD5 213b17ad99dbf273077e6e03e877c324
BLAKE2b-256 949286404eac2840b0313e93fba7999de9174b3883245fc905836b26322dc180

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page