Giter Site home page Giter Site logo

linked-scatterplot-table-download-poc's Introduction

Bokeh scatter linked to table with download - proof of concept

This repo contains a minimal proof-of-concept for linking a scatterplot selection to a table in Bokeh. It also contains a "Download" button that triggers download.js which will save the current table as a CSV file.

To run locally:

$ cd path/to/repo
$ bokeh serve --show app/

static screenshot of app

Requirements

Created with bokeh==2.3.0 and Python 3.9.2. Not tested with other versions.

linked-scatterplot-table-download-poc's People

Contributors

deppen8 avatar

Watchers

 avatar  avatar

linked-scatterplot-table-download-poc's Issues

update table when resetting to all points selected

Hi, I've been looking for code like this for a while now - thanks for sharing! I am adapting this for a standalone bokeh html file. When I un-select a subset of points so the graph goes back to "all" points, the cb_obj.indices is an empty list. So I updated the source1.selected.js_on_change callback like so:

for (var i = 0; i < inds.length; i++) {
  d2['x'].push(d1['x'][inds[i]])
  d2['y'].push(d1['y'][inds[i]])
  d2['label'].push(d1['label'][inds[i]])
}

becomes

if (inds.length==0) {
  for (var i = 0; i < d1['x'].length; i++) {
    d2['x'].push(d1['x'][i])
    d2['y'].push(d1['y'][i])
    d2['label'].push(d1['label'][i])
  }
} else {
  for (var i = 0; i < inds.length; i++) {
    d2['x'].push(d1['x'][inds[i]])
    d2['y'].push(d1['y'][inds[i]])
    d2['label'].push(d1['label'][inds[i]])
  }
}

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.