GithubHelp home page GithubHelp logo

jwkvam / bowtie Goto Github PK

View Code? Open in Web Editor NEW
764.0 26.0 71.0 633 KB

:bowtie: Create a dashboard with python!

License: MIT License

Python 72.17% JavaScript 26.67% Makefile 0.56% Dockerfile 0.46% HTML 0.14%
python dashboard interactive visualization webapp flask react socket-io plotly data-science

bowtie's Introduction

Installation | Documentation | Gitter Chat | Google Group

Bowtie

Build Status Documentation Status PyPI version Conda version PyPI codecov prettier

Introduction

Bowtie is a library for writing dashboards in Python. No need to know web frameworks or JavaScript, focus on building functionality in Python. Interactively explore your data in new ways! Deploy and share with others!

Demo

See a live example generated from this code!

For more examples, check out the gallery and repos. Feel free to add your own creations!

Installation

If you use conda, you can install with:

conda install -c conda-forge bowtie-py

If you use pip, you can install with:

pip install bowtie

Requirements

Bowtie uses Yarn to manage node packages. If you installed Bowtie through conda, Yarn was also installed as a dependency. Yarn can be installed through conda:

conda install -c conda-forge yarn

Otherwise follow install instructions for Yarn for your OS.

Documentation

Available here.

Jupyter Integration

An early integration with Jupyter has been prototyped. I encourage you to try it out and share feedback. I hope this will make it easier to make Bowtie apps.

Read the documentation for more details.

Docker

Docker images are provided as an alternative way to use Bowtie. They are available on Docker Hub:

docker pull jwkvam/bowtie

Read the documentation for more details.

The Goal

Contributing

You can help Bowtie in many ways including:

  • Try it out and report bugs or what was difficult.
  • Help improve the documentation.
  • Write new widgets.
  • Provide hosting for apps in the gallery.
  • Say thanks!

coffee

bowtie's People

Contributors

gitter-badger avatar jwkvam avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bowtie's Issues

more flexible layout api?

Could draw inspiration from matplotlib subplots api. Might want to have options to span multiple rows, instead of the somewhat rigid n rows with a variable number of widgets per row.

ant looks nice

https://ant.design/docs/react/introduce

strongly considering just always using ant.design styling for bowtie because

  1. They have all the widgets I need as far as I can tell.
  2. I like the UX of their components more than palantir's blueprint.
  3. It looks nice.
  4. More professional looking to have components with consistent look and feel.
  5. Can change primary color to whatever you want.

use session to cache results

copy_current_request_context does some weird things to the session that I need to figure out. Current thinking is to return a dict of data to store. Then need to figure out a nice way to get it back out, hopefully without adding more arguments.

I hope this would enable faster interaction, enabling things seen here, without writing any javascript though of course.

refs:

add support for more complex login process

redirect / to a /login page which is supplied by the user?

Current proposal is is to have the user provide the following:

  • a login function which returns a bool indicating if the login was successful or not
  • a test if someone is logged (i.e. to be used to redirect to login page or continue to web app)
  • a login page (perhaps as a string or file, maybe provide a default template to make things easy)

fix issues related to heroku deploy

  • using $PORT
  • importing relative path
  • remove numpy dependency? (maybe)
  • include example Procfile
  • deploy script? (run webpack -p and only add necessary files to git)

provide multiple language APIs

A possible long-term goal, but the only communication is through socket.io. We can reuse the javascript with other backends for languages like R and Julia.

scheduled tasks are limited to broadcasting messages

One way this could be improved is for scheduled tasks tell each client to create a request to the server to get updates. This way, the server can send individual updates to each client.

On the other hand this feels a little convoluted, but I think it will work until a better solution can be found.

refactor `.get` accessor to be generated by metaclass

This is not very visible to the user right now. It's not in the docs. The only reason someone could find it is by using tab completion in IPython or viewing the dir(.).

The best solution is probably make a metaclass wrapper like for on_* and do_*

support for initial function

It would be handy to have a function that get's called on initial page load from the client. Here's a sketch of how this can work:

  1. Add an emit from index.jsx
  2. Add a handler template in server.py
  3. Add functionality to Layout class to call a python function on the initial signal.

node-sass 4.2.0 breaks when python3 is default python

using node-sass 4.1.1 works

Directory: /Users/jacques/dev/bowtie-sines/build/node_modules/node-sass
Output:
Building: /usr/local/Cellar/node/7.4.0/bin/node /Users/jacques/dev/bowtie-sines/build/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/Cellar/node/7.4.0/bin/node',
gyp verb cli   '/Users/jacques/dev/bowtie-sines/build/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/isexe/index.js:44:5
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/isexe/access.js:8:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:112:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/which/which.js:89:16
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/isexe/index.js:44:5
gyp verb `which` failed     at /Users/jacques/dev/bowtie-sines/build/node_modules/isexe/access.js:8:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:112:15) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /Users/jacques/miniconda/bin/python
gyp verb check python version `/Users/jacques/miniconda/bin/python -c "import platform; print(platform.python_version());"` returned: "3.5.2\n"
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/Users/jacques/miniconda/bin/python" is v3.5.2, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (/Users/jacques/dev/bowtie-sines/build/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack     at /Users/jacques/dev/bowtie-sines/build/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:202:7)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:885:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:188:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:501:12)
gyp ERR! System Darwin 16.4.0
gyp ERR! command "/usr/local/Cellar/node/7.4.0/bin/node" "/Users/jacques/dev/bowtie-sines/build/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/jacques/dev/bowtie-sines/build/node_modules/node-sass
gyp ERR! node -v v7.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Build failed with error code: 1

functions taking input from several widgets can cumbersome

Fro example, you have 3 drop down widgets and you have a function that needs the state of all 3. Currently you might do something like this:

a, b, c = (dropdown() for _ in range(3))

def foo(a_value, b_value, c_value):
    more_stuff()

def foo_a(a_value):
    b_value = b.get()
    c_value = c.get()
    foo(a_value, b_value, c_value)
def foo_b(b_value):
    a_value = a.get()
    c_value = c.get()
    foo(a_value, b_value, c_value)
def foo_c(c_value):
    a_value = a.get()
    b_value = b.get()
    foo(a_value, b_value, c_value)

layout.subscribe(a.on_change, foo_a)
layout.subscribe(b.on_change, foo_b)
layout.subscribe(c.on_change, foo_c)

There probably are better approaches here. Dash may have a better model here that could be drawn from.

update gif

bowtie demo looks a bit nicer now, should update the gif

authentication

Bowtie doesn't come out of the box with authentication. If you want it, I would follow this guide and modify ./build/src/server.py.

use msgpack instead of json

table = SmartGrid()

then if there are hyphens in the data

table.get()

hangs.

edit: Have now also encountered this with drop down widgets. Workaround has still remained to replace the hyphens with some other character.

make widgets with minimum size?

I'm working on a dashboard where i'd like to stack 3 widgets, but on my screen they render with very small heights... is there a way to forece them to occupy a minimum height?

image

consider using socket.volatile

It's probably okay to miss messages especially if many are being sent repeatedly. Similar to how Jupyter notebooks throttle messages sent over zeromq.

add more visual widgets

if i want to have image support I would like to be able to query for size or generate an svg from matplotlib

  • table
  • image (for matplotlib)

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.