Interactive Data Visualization in the browser, from Python

Overview
Bokeh logotype

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords high-performance interactivity over large or streaming datasets. Bokeh can help anyone who would like to quickly and easily make interactive plots, dashboards, and data applications.

Latest Release Latest release version npm version Conda Conda downloads per month
License Bokeh license (BSD 3-clause) PyPI PyPI downloads per month
Sponsorship Powered by NumFOCUS Live Tutorial Live Bokeh tutorial notebooks on MyBinder
Build Status Current github actions build status Support Community Support on discourse.bokeh.org
Static Analysis Language grade: Python Language grade: JavaScript Twitter Follow Bokeh on Twitter

If you like Bokeh and would like to support our mission, please consider making a donation.

colormapped image plot thumbnail anscombe plot thumbnail stocks plot thumbnail lorenz attractor plot thumbnail candlestick plot thumbnail scatter plot thumbnail SPLOM plot thumbnail
iris dataset plot thumbnail histogram plot thumbnail periodic table plot thumbnail choropleth plot thumbnail burtin antibiotic data plot thumbnail streamline plot thumbnail RGBA image plot thumbnail
stacked bars plot thumbnail quiver plot thumbnail elements data plot thumbnail boxplot thumbnail categorical plot thumbnail unemployment data plot thumbnail Les Mis co-occurrence plot thumbnail

Installation

The easiest way to install Bokeh is using the Anaconda Python distribution and its included Conda package management system. To install Bokeh and its required dependencies, enter the following command at a Bash or Windows command prompt:

conda install bokeh

To install using pip, enter the following command at a Bash or Windows command prompt:

pip install bokeh

For more information, refer to the installation documentation.

Resources

Once Bokeh is installed, check out the first steps guides.

Visit the full documentation site to view the User's Guide or launch the Bokeh tutorial to learn about Bokeh in live Jupyter Notebooks.

Community support is available on the Project Discourse.

If you would like to contribute to Bokeh, please review the Developer Guide and request an invitation to the Bokeh Dev Slack workspace.

Note: Everyone interacting in the Bokeh project's codebases, issue trackers and discussion forums is expected to follow the Code of Conduct.

Follow us

Follow us on Twitter @bokeh

Sponsors

Fiscal Sponsors

The Bokeh project is grateful for individual contributions as well as sponsorship by the organizations and companies below:

NumFocus Logo Blackstone Logo
Anaconda Logo NVidia Logo Rapids Logo
Quansight Logo Rex Logo Nom Nom Data Logo

If your company uses Bokeh and is able to sponsor the project, please contact [email protected]

Bokeh is a Sponsored Project of NumFOCUS, a 501(c)(3) nonprofit charity in the United States. NumFOCUS provides Bokeh with fiscal, legal, and administrative support to help ensure the health and sustainability of the project. Visit numfocus.org for more information.

Donations to Bokeh are managed by NumFOCUS. For donors in the United States, your gift is tax-deductible to the extent provided by law. As with any donation, you should consult with your tax adviser about your particular tax situation.

In-kind Sponsors

The Bokeh project is also grateful for the donation of services from the following companies:

Security

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Issues
  • Improve the layout subsystem

    Improve the layout subsystem

    addresses #8084

    fixes #4407 (new feature) fixes #4643 (irrelevant) fixes #5169 (fixed, needs a test) fixes #5572 (fixed) fixes #6294 (fixed) fixes #6417 (fixed, needs a test) fixes #6768 (fixed, needs a test) fixes #7120 (fixed, needs a test) fixes #7185 (irrelevant) fixes #7497 (fixed) fixes #7590 (fixed) [already closed?] fixes #7771 (fixed) fixes #8227 (fixed) fixes #8229 (new feature, needs tests, examples) fixes #6822 (fixed) fixes #4395 (fixed)

    fixes #8391 (fixed, needs test) fixes #7260 (fixed) fixes #7454 (fixed, needs test) fixes #5749 (fixed) fixes #6259 (fixed) fixes #4608 (fixed) fixes #8611 (fixed)

    status: accepted 
    opened by mattpap 164
  • Bokeh / JupyterLab integration

    Bokeh / JupyterLab integration

    Updated high level design principles:

    • [ ] mime bundle for loading BokehJS

      The output_notebook() function generates a mime bundle looks like

      {'application/javascript': js, 
        'application/vnd.bokeh.bootstrap_bokehjs': ''}
      

      In the classic notebook, it ignores the bokeh mimetype and runs the JS. In JLab, the Bokeh mimetype has a higher precedence, so it ignores the JS mimetype.

      • For the classic notebook the JS will load the Bokeh mini-extension to register for the show mime type. Additionally BokehJS will be loaded from CDN or for inline resources, from the JS in the bundle itself.

      • For JLab the Bokeh mini-extension will be previously installed via usual JLab mechanisms. The extension will load BokehJS from CDN or for inline resources, from the locally installed Bokeh package. (via a REST endpoint??)

    • [ ] mime bundle for showing standalone docs and applications

      The show(...) function generates a mime bundle that looks like

      'application/vnd.bokeh.show`: JSON
      

      Where JSON is the serialized Bokeh Document and any additional metadata (versions, comm ids etc)

    type: task reso: completed tag: component: build tag: component: bokehjs tag: notebook 
    opened by bryevdv 104
  • Generalized event system

    Generalized event system

    This PR is one I have been working on with @bryevdv on my fork (https://github.com/jlstevens/bokeh/pull/4) that aims to fix issue #5278 and will possibly help address issue #3393. This PR supersedes #5276.

    Aim

    The goal is to allow users to specify Python and Javascript callbacks associated with events. Some suggestions for potential events include UIEvents (including hammer events such as 'tap', 'press', keypress events), model related events such as button click events as well as document level events such as 'busy'. Other proposals for events may be found on this wiki page.

    As there are many potential event types, the goal is to introduce a very general mechanism that abstracts over all these potential event types (hammer, DOM, model related, document). This would be a very useful feature to have for building bokeh apps as well as for third party libraries used to build interactive Bokeh visualizations such as HoloViews.

    Architecture outline

    The API is very similar to the existing on_change and js_on_change API used to register callbacks triggered by property changes.

    Events callbacks are defined on Model and stored on the JS side as a property js_event_callbacks and on the Python side in the _event_callbacks attribute of theEventCallbackManager mixin class (which is analogous to the PropertyCallbackManager class - formerly known as CallbackManager).

    An EventManager instance exists per document in both on Python and Javascript - its job is to route events from wherever they are generated to the appropriate models that can process them. Model instances are responsible for actually invoking the registered callbacks in response to an event, triggered on the event manager. The EventManager also handles the communication of events from Javascript to Python as necessary.

    To achieve this, Model has a subscribed_events property which specifies which events are being listened to on the Python side. These are the events that are to be communicated to Python so that Python callbacks can respond accordingly. Both Javascript and Python callbacks receive an event instance (e.g Tap) which contains information such as the position of the tap. In terms of the communication protocol, there is a single new Event message that is converted into corresponding event instances once received.

    Current status

    You can now use on_event and js_on_event with the currently defined set of events to execute either Javascript or Python callbacks. You can see the API in action in the fourier_animated.py example I am currently using for testing. I intend to write a new example app from scratch and include it in this PR later.

    Open questions

    The main architectural issue right now is that I need a way to supply event instances with a particular model id in order to target a particular model. For instance, events from a given UIEvents instance only apply to a particular Plot instance. What is the best way to get the appropriate model id - at the point where the events are generated? For more information about the problem, see https://github.com/jlstevens/bokeh/pull/4.

    TODO

    I have already listed various TODO items at https://github.com/jlstevens/bokeh/pull/4 and here are the most important outstanding items:

    • [x] Write an example of a Button widget click event.
    • [x] Make sure all classes have decent docstrings
    • [x] Illustrate custom events by building a custom model.
    • [x] Testing

    Edit: to avoid having to refer back to the PR on my fork, here are the other TODO items I assigned myself:

    • [x] Rename js_callbacks to js_property_callbacks
    • [x] Add more event types and check they have useful contents
    • [x] Make a new bokeh app example specifically for illustrating events (edit: superseded for now with two demos in examples/howto ).
    • [x] Type annotations for typescript

    Possible Future work

    Currently events originating in JS can be communicated to Python but events originating in Python cannot currently be communicated to JS. An earlier prototype demonstrated that this feature is possible with the proposed architecture but this feature involves some tricky issues connecting up the communication protocol that are outside the scope of this PR.

    In addition, it is trivial to add a Javascript API to the current system. This was successfully prototyped but is omitted here as there was no obvious naming scheme for the JS methods.

    status: accepted PROTOCOL 
    opened by jlstevens 94
  • Bokeh occasionally not working with Jupyter Notebook

    Bokeh occasionally not working with Jupyter Notebook

    I'm not sure what's going on. I get this error occasionally and I may have gotten a reproducible example but I haven't confirmed just yet.

    There are no errors in the python side. Instead of a plot I see <bokeh.io._CommsHandle at 0x109b1ec18> as the output. The javascript console shows:

    Kernel: kernel_restarting (b738e19a-021b-47ef-9d08-076f696147c8)
    main.min.js:22329 Kernel: kernel_created (b738e19a-021b-47ef-9d08-076f696147c8)
    main.min.js:22673 Starting WebSockets: ws://localhost:8888/api/kernels/b738e19a-021b-47ef-9d08-076f696147c8
    main.min.js:22329 Kernel: kernel_connected (b738e19a-021b-47ef-9d08-076f696147c8)
    main.min.js:22329 Kernel: kernel_ready (b738e19a-021b-47ef-9d08-076f696147c8)
    (program):67 Bokeh: BokehJS loaded, going straight to plotting
    cdn.pydata.org/bokeh/release/bokeh-0.11.0.min.js:3 Bokeh: setting log level to: 'info'
    (program):53 Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.11.0.min.css
    (program):55 Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.11.0.min.css
    (program):72 Bokeh: BokehJS loaded, going straight to plotting
    
    Could not open comm  --  Error: Class 1854dd25-3916-46bd-aab3-1729f21a403a not found in registry
    main.min.js:23119 Couldn't process kernel message WrappedError(anonymous function) @ main.min.js:23119
    
    Couldn't process kernel message WrappedError(anonymous function) @ main.min.js:23119
    
    type: bug reso: completed 
    opened by AlJohri 91
  • Another attempt to make layout more reliable

    Another attempt to make layout more reliable

    • [x] implement per-root layout solver
    • [ ] make layout reinitializable

    fixes #5967 ? #5518 ? #4810 fixes #4449

    ? #1650 -- not fixed because constraints are still bound to models, and there are other issues to resolve (e.g. we shouldn't touch plot.renderers).

    status: accepted 
    opened by mattpap 88
  • Adding Horizon high-level chart (clean version)

    Adding Horizon high-level chart (clean version)

    Here is another cleaned version of the horizon chart based on previous feedback and comments.

    type: feature status: accepted reso: completed 
    opened by matdrapeau 71
  • JS/TS charts API

    JS/TS charts API

    This is really preliminary stuff.

    • [x] pie chart
    • [x] bar chart
    • [ ] line chart
    • [x] hover centered on slices, not glyph
    • [x] hover glyph sometimes doesn't deactivate (tooltip hides properly)
    • [ ] hover can affect only certain properties (e.g. can't change AnnularWedge's radius) (#2367)
    • [x] tooltip attachment in the vertical dimension
    • [x] Quad supports categorical axes
    • [x] allow to anchor tooltip to Quad glyph's sides

    Those are related:

    • [ ] fix range_padding when constructing plots in JS
    • [ ] DataRange1d should consider only visible part of AnnularWedge
    • [ ] AnnularWedge.bounds() always returns [0, 0, 0, 0]

    fixes #4311

    status: accepted 
    opened by mattpap 68
  • Add drawing tools

    Add drawing tools

    This PR adds a range of draw tools, which allow adding and editing points, multi-lines, boxes and polygons, addressing https://github.com/bokeh/bokeh/issues/6370. For a demo of each of the tools go here (currently these use HoloViews but I'm working on pure bokeh examples now): https://anaconda.org/philippjfr/drawing_tools/notebook

    BoxDrawTool

    Allows drawing a rectangular bounding box, which will persist.

    PointDrawTool

    Allows adding points, dragging points and deleting points:

    • Add: Click anywhere on the plot
    • Drag: Click on the point and drag it
    • Delete: Tap on point (or use box_select tool) and hit delete

    PolyDrawTool

    The tool handles drawing multiple polygons/multi-lines. Holding shift will allow editing the previously drawn polygon. Without holding shift a new polygon is added.

    • Add polygon/multi-line: Drag from one point to another
    • Add vertex to polygon: Hold shift then click and drag to new vertex position
    • Delete: Tap on polygon/multi-line and hit delete

    PolyEditTool

    The vertex editing tools allow double clicking on a polygon/polyline and edit its vertices.

    • Double Tap: Selects a polygon/polyline for vertex editing
    • Drag: Clicking and dragging a vertex adjusts the polygon/polyline
    • Delete: Tap on a vertex and press delete

    API

    The API generally is very simple, pass the renderers to be edited to each of the tools. The VertexEditTool also requires a separate vertex_renderer to draw the vertices.

    ToDo

    • [x] Agree on naming
    • [x] Refactor a bit to reduce code duplication
    • [x] Add docstrings
    • [x] Add documentation and examples
    • [x] Resolve remaining TypeScript issues
    • [x] tests added / passed
    • [x] release document entry (if new feature or API change)
    status: accepted 
    opened by philippjfr 66
  • Allow easy customization of HTML templates

    Allow easy customization of HTML templates

    Early work in progress.

    fixes #4986

    status: accepted 
    opened by mattpap 60
  • Implementation of TypeScript API

    Implementation of TypeScript API

    • [x] add support for getters/setters (Object.defineProperty)
    • [x] fix all clashes between unrelated this.prop and this.get("prop")
    • [x] implement CoffeeScript/TypeScript mid-level API (bokeh.plotting)
      • [x] finalize edge cases
      • [x] add support for legends
      • [x] add support for tools
      • [ ] ~~add remaining API functions (io, hold, etc.)~~
    • [x] TypeScript typings for low- and mid-level APIs
      • [x] add support for included properties (mixins with prefix)
      • [ ] make attrs in new Model(attrs) type-safe without too much code duplication
      • [ ] figure out how to remove string from Color union type
    • [x] make gulp test work again
      • [x] fix unit tests
      • [ ] ~~add support for on-the-fly typescript compilation~~
    • [x] add examples:
      • [x] low-level (bokehjs/examples/anscombe)
      • [x] mid-level (bokehjs/examples/burtin)

    Note: to compile everything (scripts, typings and examples), issue gulp examples.

    status: accepted type: task reso: completed tag: component: bokehjs tag: API: plotting 
    opened by mattpap 59
  • [FEATURE] D3-force integration

    [FEATURE] D3-force integration

    Discussion first started here: #11711 Proof of concept CodePen here: https://codepen.io/gparki/pen/zYdKPLr cc @bokeh/dev

    This is an involved project I'm interested in leading, and I'd like to start the design discussion on how this API should look and behave. I'm just spitballing here - I'd love some feedback, and please challenge any of my assumptions...

    Constraints/expectations:

    • This only works for glyphs inheriting from XYGlyph
    • This should be applicable to graphs, and I believe a new ForceLayoutProvider will be able to handle this

    How I picture the API looking:

    from bokeh.plotting import figure
    from bokeh.models import simulation, xForce, yForce
    
    s = simulation(animated=True)
    
    # add single force
    s.add_force(xForce(x=3, strength=0.5))
    
    # or list of forces
    s.add_force([xForce(x=10, strength=0.1), yForce(y=2, strength=0.7)])
    
    # or perhaps address the internal list of forces directly
    s.forces = [my_list_of_forces]
    
    p = figure()
    p.circle(x, y, simulation=s)
    

    I also envision a convenience syntax to add multiple forces at once:

    from bokeh.models import simulation
    
    s = simulation(alpha=0.9).x(x=1, strength=8).y(3, 0.3).radial(10, 0.2)
    

    And for graphs:

    from bokeh.models import GraphRenderer, ForceLayoutProvider
    
    graph_layout = dict(zip(node_indices, zip(x, y)))
    
    graph = GraphRenderer()
    graph.layout_provider = ForceLayoutProvider(graph_layout=graph_layout, distance=10, strength=2.0)
    

    Classes/Properties

    In pseudo code:

    class Simulation(Model):
    
       # Initial "temperature" of model which decays each tick
       alpha: Float or "auto"
    
       # Final "temperature" threshold which determines end of the simulation
       alpha_min: Float or "auto"
    
       alpha_decay: Float or "auto"
       velocity_decay: Float or "auto"
    
       # Number of iterations to tick - overrides the alpha decay timer and sets animated=False
       iterations: Int or "auto"
    
       # Controls if simulation should be ticked over time or rapidly calculated and then displayed
       animated: Bool, default True
    
       # List of forces applied to simulation
       forces: List[BaseForce]
    
    class ForceLayoutProvider(LayoutProvider, Simulation):
       # Parameters applied directly to "link" force on the JS side
       distance: Float
       strength: Float
    
    @abstract
    class BaseForce(Model):
       strength: Float, default 0.2
    
    class xForce(BaseForce):
       x: Float
    
    class yForce(BaseForce):
       y: Float
    
    ...etc
    
    type: discussion 
    opened by g-parki 1
  • elaborate on git commit/push process in docs

    elaborate on git commit/push process in docs

    Elaborates on git branch creation, making commits, and pushing. Also fixes small typo in the "working with Bokeh models" page.

    • [x] issues: fixes #11757
    tag: component: docs status: ready type: task 
    opened by g-parki 1
  • [FEATURE] Elaborate on branch creation and git commits in docs

    [FEATURE] Elaborate on branch creation and git commits in docs

    Docs currently assume some knowledge of git, but I think being a little more explicit will be helpful with newcomers. Current docs have a "create a branch" section followed by a "push branch to Github" section. In between these I think a "make commits" section with git examples would be useful.

    tag: component: docs type: task 
    opened by g-parki 2
  • [FEATURE] Support for interactive Bokeh visualizations within VS Code (using push_notebook)

    [FEATURE] Support for interactive Bokeh visualizations within VS Code (using push_notebook)

    FOLLOW THESE INSTRUCTIONS CAREFULLY

    ISSUES THAT DO NOT CONTAIN NECESSARY INFORMATION MAY BE CLOSED, IMMEDIATELY

    The issue tracker is NOT the place for general support. For questions and technical assistance, come join the Bokeh Project Discourse.

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Note: Everyone interacting in the Bokeh project's codebases, issue trackers, and discussion forums is expected to follow the Code of Conduct.

    Hi, I'm one of the maintainers of the Jupyter extension in VS Code. First thanks for this great product, we've found a lot of users use Bokeh within VS Code, and haven't had many issues with this, except for bokeh server apps (for which ther'es a separate issue) and push_notebook (which is what this issue is about).

    I have narrowed down the cause of the issue to the fact the kernels are not accessible in the notebook.ts file. Looking at the code we have special code to handle Jupyter Notebooks, Jupyter Lab and Google Colab.

    I was wondering whether you'd be open to a similar special casing for VS Code.

    TRIAGE 
    opened by DonJayamanne 6
  • [FEATURE] Show scale in map

    [FEATURE] Show scale in map

    I am using the OSM tile provider in bokeh to plot a basemap. I think it would be great to have a way to show the scale of the map in meters or kilometers depending on the zoom level.

    Just to clarify, the axis labels can remain in WGS84-pseudo-mercator but I want to have a scale or some sort of ruler to give a better sense of the distances in the plot.

    Here is an example image from the OSM website where I have marked the scale in the bottom left corner.

    ebe74fa72f7f3145bdfcbb1a5a1caeb426a2b245

    TRIAGE 
    opened by sebhan2 9
  • [FEATURE] Github merge instructions in docs

    [FEATURE] Github merge instructions in docs

    The first merge option is "Create a merge commit," which yields ugly results when the new folks (i.e. me) do their first merge. I now know we "squash and merge" most of the time. Maybe add some dev documentation about how this is managed? cc @tcmetzger

    image image

    tag: component: docs type: task 
    opened by g-parki 1
  • [BUG] Hover tool takes long time to render (-> #11629)

    [BUG] Hover tool takes long time to render (-> #11629)

    ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

    Working: bokeh: 2.3.3 python: 3.8.11 jupyterlab: 3.1.7 OS: Windows 10, version 20H2

    Broken: bokeh: 2.4.1 python: 3.8.11 jupyterlab: 3.1.7 OS: Windows 10, version 20H2

    Description of expected behavior and the observed behavior

    After updating from Bokeh 2.3.3 to either 2.4.0 or 2.4.1, the hovertool becomes very slow. The issue had already been posted here, and flagged as fixed for 2.4.1. Unfortunately, it still persists.

    Bokeh 2.3.3 (left) vs Bokeh 2.4.1 (right):

    https://user-images.githubusercontent.com/40465719/137766962-f1ca3b38-77a1-4d54-9c67-0488b99646cf.mp4

    Complete, minimal, self-contained example code that reproduces the issue

    import xarray as xr
    import numpy as np
    import pandas as pd
    import hvplot.xarray, hvplot.pandas
    import holoviews
    
    ds = xr.Dataset(
        data_vars=dict(
            frate=(["time","symbol"], np.random.rand(2307,138))
        ),
        coords=dict(
            symbol=(["symbol"], 
                   np.array(['1000SHIBUSDT', '1000XECUSDT', '1INCHUSDT', 'AAVEUSDT', 'ADABUSD',
           'ADAUSDT', 'AKROUSDT', 'ALGOUSDT', 'ALICEUSDT', 'ALPHAUSDT',
           'ANKRUSDT', 'ARUSDT', 'ATAUSDT', 'ATOMUSDT', 'AUDIOUSDT',
           'AVAXUSDT', 'AXSUSDT', 'BAKEUSDT', 'BALUSDT', 'BANDUSDT',
           'BATUSDT', 'BCHUSDT', 'BELUSDT', 'BLZUSDT', 'BNBBUSD', 'BNBUSDT',
           'BTCBUSD', 'BTCDOMUSDT', 'BTCSTUSDT', 'BTCUSDT', 'BTSUSDT',
           'BTTUSDT', 'BZRXUSDT', 'C98USDT', 'CELOUSDT', 'CELRUSDT',
           'CHRUSDT', 'CHZUSDT', 'COMPUSDT', 'COTIUSDT', 'CRVUSDT', 'CTKUSDT',
           'CVCUSDT', 'DASHUSDT', 'DEFIUSDT', 'DENTUSDT', 'DGBUSDT',
           'DODOUSDT', 'DOGEBUSD', 'DOGEUSDT', 'DOTUSDT', 'DYDXUSDT',
           'EGLDUSDT', 'ENJUSDT', 'EOSUSDT', 'ETCUSDT', 'ETHBUSD', 'ETHUSDT',
           'FILUSDT', 'FLMUSDT', 'FTMUSDT', 'FTTBUSD', 'GALAUSDT', 'GRTUSDT',
           'GTCUSDT', 'HBARUSDT', 'HNTUSDT', 'HOTUSDT', 'ICPUSDT', 'ICXUSDT',
           'IOSTUSDT', 'IOTAUSDT', 'IOTXUSDT', 'KAVAUSDT', 'KEEPUSDT',
           'KLAYUSDT', 'KNCUSDT', 'KSMUSDT', 'LINAUSDT', 'LINKUSDT',
           'LITUSDT', 'LRCUSDT', 'LTCUSDT', 'LUNAUSDT', 'MANAUSDT',
           'MASKUSDT', 'MATICUSDT', 'MKRUSDT', 'MTLUSDT', 'NEARUSDT',
           'NEOUSDT', 'NKNUSDT', 'OCEANUSDT', 'OGNUSDT', 'OMGUSDT', 'ONEUSDT',
           'ONTUSDT', 'QTUMUSDT', 'RAYUSDT', 'REEFUSDT', 'RENUSDT', 'RLCUSDT',
           'RSRUSDT', 'RUNEUSDT', 'RVNUSDT', 'SANDUSDT', 'SCUSDT', 'SFPUSDT',
           'SKLUSDT', 'SNXUSDT', 'SOLBUSD', 'SOLUSDT', 'SRMUSDT', 'STMXUSDT',
           'STORJUSDT', 'SUSHIUSDT', 'SXPUSDT', 'THETAUSDT', 'TLMUSDT',
           'TOMOUSDT', 'TRBUSDT', 'TRXUSDT', 'UNFIUSDT', 'UNIUSDT', 'VETUSDT',
           'WAVESUSDT', 'XEMUSDT', 'XLMUSDT', 'XMRUSDT', 'XRPBUSD', 'XRPUSDT',
           'XTZUSDT', 'YFIIUSDT', 'YFIUSDT', 'ZECUSDT', 'ZENUSDT', 'ZILUSDT',
           'ZRXUSDT'])),
            time=(["time"],pd.date_range(start='2019-09-10 08:00:00', end='2021-10-18 00:00:00', periods=2307)),)
    )
    
    plot = ds.hvplot.heatmap(
        'time','symbol','frate',cmap='coolwarm',
    )
    plot
    

    https://user-images.githubusercontent.com/40465719/137767581-1d41a599-7bb7-4361-ac0e-8156e60c7eb3.mp4

    Stack traceback and/or browser JavaScript console output

    No traceback and/or JS console output

    TRIAGE 
    opened by Material-Scientist 1
  • [BUG] Event loop hooks for server_lifecylce are gone in Bokeh v2.4.1

    [BUG] Event loop hooks for server_lifecylce are gone in Bokeh v2.4.1

    Event loop hooks for server_lifecylce are gone in Bokeh v2.4.1

    The event loop functions in the lifecycle-hooks of the bokeh server are gone in v2.4.1. These following functions on the server_context object no longer exist:

    • add_periodic_callback
    • add_next_tick_callback

    In short, this code no longer works (straight from the docs):

    
    def foo():
        pass
    
    def bar():
        pass
    
    def on_server_loaded(server_context):
        server_context.add_next_tick_callback(foo)  # this is broken
    
    def on_server_unloaded(server_context):
        server_context.add_next_tick_callback(bar)  # this is broken
    
    def on_session_created(session_context):
        # If present, this function executes when the server creates a session.
        pass
    
    def on_session_destroyed(session_context):
        # If present, this function executes when the server closes a session.
        pass
    

    This might just be a missing documentation in the migration guide, but if you relied on this feature - it now no longer works, so might be nice to document how this can be fixed.

    I see that the server_context now has access to an event_loop directly, so maybe that's the way to go?

    type: discussion 
    opened by jundl77 12
  • [BUG] DataTable autosize_mode =

    [BUG] DataTable autosize_mode = "fit_viewport" does not adjust column widths as data is updated

    ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

    Bokeh 2.4.1 Python 3.9.6 MacOS Catalina 10.15.7 Chrome 94.0.4606.81

    Description of expected behavior and the observed behavior

    When using DataTable's autosize_mode = "fit_viewport", the columns don't get updated when the data or headers change. In applications where the table begins empty and gets filled when the user selects options, this can result in the data looking squished.

    That is unlike when using DataTable's autosize_mode = "fit_columns", which updates the column sizes dynamically and is quite nice.

    This issue is likely related to #11436.

    Complete, minimal, self-contained example code that reproduces the issue

    Take https://github.com/bokeh/bokeh/tree/branch-3.0/examples/app/export_csv and updated main.py to:

    from os.path import dirname, join
    
    import pandas as pd
    
    from bokeh.io import curdoc
    from bokeh.layouts import column, row
    from bokeh.models import (Button, ColumnDataSource, CustomJS, DataTable,
                              NumberFormatter, RangeSlider, TableColumn)
    
    df = pd.read_csv(join(dirname(__file__), 'salary_data.csv'))
    
    source = ColumnDataSource(data=dict())
    
    def update():
        current = df[(df['salary'] >= slider.value[0]) & (df['salary'] <= slider.value[1])].dropna()
        source.data = {
            'name'             : current.name,
            'salary'           : current.salary,
            'years_experience' : current.years_experience,
        }
    
    slider = RangeSlider(title="Max Salary", start=10000, end=110000, value=(10000, 10000), step=1000, format="0,0")
    slider.on_change('value', lambda attr, old, new: update())
    
    button = Button(label="Download", button_type="success")
    button.js_on_click(CustomJS(args=dict(source=source),
                                code=open(join(dirname(__file__), "download.js")).read()))
    
    columns = [
        TableColumn(field="name", title="Employee Name"),
        TableColumn(field="salary", title="Income", formatter=NumberFormatter(format="$0,0.00")),
        TableColumn(field="years_experience", title="Experience (years)")
    ]
    
    #data_table = DataTable(source=source, columns=columns, width=800, autosize_mode='fit_columns')
    data_table = DataTable(source=source, columns=columns, width=800, autosize_mode='fit_viewport')
    
    controls = column(slider, button)
    
    curdoc().add_root(row(controls, data_table))
    curdoc().title = "Export CSV"
    
    update()
    

    When the sliders get adjusted such that data appears in the table, the column widths don't get updated. If you change the DataTable to autosize_mode='fit_columns', the columns width do get updated.

    Screenshots or screencasts of the bug in action

    Squished columns: Screen Shot 2021-10-15 at 3 04 13 PM

    TRIAGE 
    opened by EfremBraun 0
  • Need examples of callbacks with BokehJS

    Need examples of callbacks with BokehJS

    ref: https://discourse.bokeh.org/t/bokehjs-callback-on-select-get-start-and-end/8514

    There is almost no information I am aware of (examples, docs) demonstrating how BokehJS users might set up callbacks on ranges, selections, etc as there is for Python. The Discourse question above is a prototypical example ask "update a div from a range event"

    There should be examples under bokehjs/examples and also documentation support in the users guide: https://docs.bokeh.org/en/latest/docs/user_guide/bokehjs.html#

    tag: component: docs type: task tag: component: examples tag: component: bokehjs 
    opened by bryevdv 0
Owner
Bokeh
Interactive Data Visualization
Bokeh
Declarative statistical visualization library for Python

Altair http://altair-viz.github.io Altair is a declarative statistical visualization library for Python. With Altair, you can spend more time understa

Altair 6.4k Feb 18, 2021
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

???? Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

wq framework 1.1k Oct 24, 2021
Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

vispy 2.8k Oct 23, 2021
Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

vispy 2.6k Feb 13, 2021
Main repository for Vispy

VisPy: interactive scientific visualization in Python Main website: http://vispy.org VisPy is a high-performance interactive 2D/3D data visualization

vispy 2.6k Feb 17, 2021
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.3k Oct 22, 2021
Bokeh Plotting Backend for Pandas and GeoPandas

Pandas-Bokeh provides a Bokeh plotting backend for Pandas, GeoPandas and Pyspark DataFrames, similar to the already existing Visualization feature of

Patrik Hlobil 717 Oct 13, 2021
Bokeh Plotting Backend for Pandas and GeoPandas

Pandas-Bokeh provides a Bokeh plotting backend for Pandas, GeoPandas and Pyspark DataFrames, similar to the already existing Visualization feature of

Patrik Hlobil 614 Feb 17, 2021
Python Data. Leaflet.js Maps.

folium Python Data, Leaflet.js Maps folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js

null 5.5k Oct 24, 2021
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 966 Oct 24, 2021
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 692 Feb 18, 2021
3D Vision functions with end-to-end support for deep learning developers, written in Ivy.

Ivy vision focuses predominantly on 3D vision, with functions for camera geometry, image projections, co-ordinate frame transformations, forward warping, inverse warping, optical flow, depth triangulation, voxel grids, point clouds, signed distance functions, and others. Check out the docs for more info!

Ivy 33 Oct 16, 2021
2D maze path solver visualizer implemented with python

2D maze path solver visualizer implemented with python

SS 13 Sep 17, 2021
A Python package that provides evaluation and visualization tools for the DexYCB dataset

DexYCB Toolkit DexYCB Toolkit is a Python package that provides evaluation and visualization tools for the DexYCB dataset. The dataset and results wer

NVIDIA Research Projects 69 Oct 18, 2021
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Altair 339 Aug 5, 2021
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Altair 340 Feb 1, 2021
Debugging, monitoring and visualization for Python Machine Learning and Data Science

Welcome to TensorWatch TensorWatch is a debugging and visualization tool designed for data science, deep learning and reinforcement learning from Micr

Microsoft 3.2k Oct 22, 2021
Domain Connectivity Analysis Tools to analyze aggregate connectivity patterns across a set of domains during security investigations

DomainCAT (Domain Connectivity Analysis Tool) Domain Connectivity Analysis Tool is used to analyze aggregate connectivity patterns across a set of dom

DomainTools 24 Oct 22, 2021
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 173 Oct 22, 2021