GithubHelp home page GithubHelp logo

dash_socketio's Introduction

dash socketio

Client Socket.IO for Dash

Install

pip install dash_socketio

Development

Getting Started

  1. Create a new python environment:

    python -m venv venv
    . venv/bin/activate

    Note: venv\Scripts\activate for windows

  2. Install python dependencies:

    pip install -r requirements.txt
  3. Install npm packages:

    1. Optional: use nvm to manage node version:
      nvm install
      nvm use
    2. Install:
      npm install
  4. Build:

    npm run build

Component Code

Publish

If publish on npm:

npm build
npm publish

Justfile

Alternatively, use the provided just commands:

  1. Create a Python environment from previous step 1 and install:
    just install
  2. Build
    just build
  3. Publish
    just publish
  4. See all commands with just -l

dash_socketio's People

Contributors

renaudln 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

Watchers

 avatar  avatar

dash_socketio's Issues

ReadMe

Hi RenaudLN,

Thank you for your help the other day in the Plotly Forum.

I updated the ReadMe and added examples, the code from jinnyzor and one more case which I used.
It is my first time committing to someone's project like this. Should I push the Branch or make a Fork? What does the process usually look like?

Also, do you have any ideas in which direction you would like to develop this package further?
I saw the dash devices package and used your DashSocketIO to link components. Maybe something like the callback_shared might be an interesting addition, or do you rather keep it like it is?

Linking Components

One feature I want to use your library for is linking components across browser windows.

We have several pages with the same dropdown filters and we want to link them. The user can make selections and directly compare the result of this selection in a different view/dashboard.
I tried it with broadcast and that worked really well. But it would be sent to all users.

One option to solve it would be rooms. But I would need to ensure that the socket joins the room on start. Dash_devices achieved something similar with:

@app.callback_shared(None, [Input('shared_slider_no_output', 'value')])
def func(value):
    print('Shared slider no output', value)

I think this would basically wrap two steps:

  1. The socket joins a specific room for sharing the input
  2. Trigger the sent to socket on value change
  3. Have the client-side callback update the state of the value

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.