GithubHelp home page GithubHelp logo

fagan2888 / lineup_widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lineupjs/lineup_widget

0.0 1.0 0.0 188 KB

Jupyter Widget wrapper for Lineup.js @sgratzl

Home Page: https://lineup.js.org

License: MIT License

Python 50.32% JavaScript 17.48% TypeScript 31.56% CSS 0.64%

lineup_widget's Introduction

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/datavisyn/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)

lineup_widget's People

Contributors

sgratzl avatar toddrme2178 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.