question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaled sliders - convergence with bqplot and altair

See original GitHub issue

The convergence of altair, bqplot and Jupyter interactive widgets

A quick unordered list of issues that seem unrelated at first but will all come together nicely with this proposal

  • @jdemeyer, in his work on Sage integration, fixed some semantics on our use of isinstance. He suggested that instead of having separate IntSlider and FloatSlider, we merge in a single numeric slider.

    The implementation of Jupyter widgets for manipulating integers and floats are essentially the same since everything maps to the same front-end implementation, especially since we rely on d3.format mini-language for the readout format. The difference between the integral and continuous variants is merely the default value for the display format.

    Note: in another unrelated discussion, (selection widgets), he taught me to type ABCs) I think that we could try to use a hierarchy of trait types mapping the types ABCs such as [PEP 3141] https://www.python.org/dev/peps/pep-3141/), the type hierarchy for numbers.

  • There has been discussions on how we could move away from the current implementation of the Jupyter-widgets slider.

    • We want to get rid of jquery-ui, which is terrible and is not a good citizen of the browser.
    • We want ticks to indicate the current level of the slider, and move the readout so that it does not eat too much of the available length for the slider.
    • @jasongrout was proposing the super-lean no-ui slider as a replacement.
  • bqplot users have created helper functions that result in flat figures with brush or index selectors, that they use to select single values or intervals on date scales, logscales, with graduation.

  • How current bqplot sccales wrap d3 scales in a meaningful fashion: A d3 scale is typically a mapping between a domain (the data) and a range (the visual quantity that it is being mapped to). A bqplot scale is a jupyter widget that does not have a visual representation. - The model holds the domain information and has no information about the range. - The view is typically instanciated as a child view of another widget (e.g. a figure). So it know the actual dimension of the parent view, and can deduce the range. - The view is the object holding the d3 scale, since it has all the information about domain and range.

Proposal

  • We introduce bqplot-like scales as jupyter widget scales (linear, dates, ordinal, color), and maybe refactor the ones of bqplot to use those.
  • sliders and progress bars will hold a scale. A linear slider will simply have a linear scale. A selection slider will have an ordinal scale etc.
  • d3 will be used to render the widgets, so that we will be able to get rid of the jquery-ui implementation, and have all the benefits from d3 (tick formatting, minor / major tick marks / slider on color scales etc…)
  • This will not require a lot of code from d3, since the project went through a split in multiple standalone projects. In fact, we already use d3.format for the readout.
  • The scales would also be used by other projects that need mapping to colors / dates. @maartenbreddels is looking into convergence between bqplot, ipyvolume, pythreejs, and factoring out some these abstractions would help.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
vidartfcommented, Aug 24, 2017

I’ve made a very humble beginning for this in https://github.com/vidartf/ipyscales. Any and all input is welcome 👍

0reactions
jasongroutcommented, Feb 28, 2017

This is related to #1134.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Candlestick Chart in Python (mplfinance, plotly, bokeh, bqplot ...
A simple guide to creating candlestick charts in Python using data visualization libraries mplfinance (matplotlib), Plotly, Bokeh, Bqplot, ...
Read more >
Altair slider transform data - python - Stack Overflow
I've been trying to do a simple plot of average temp data vs. month and using a slider widget to filter though the...
Read more >
understanding and enhancing mixed sample data augmentation ...
常见操作: 水平翻转-Horizontal Flip Scale-亮度变化 透视变换-perspective,旋转-rotation,错切-Shear,仿射-affine等 尺寸变幻-Resize,可能改变长宽比 ...
Read more >
Binder Gallery - MyBinder - GESIS
altair -tutorial, altair-viz, GitHub, 160 ... resources.oreilly.com/binderhub/scale-your-python-processing-with-dask ... bqplot, bloomberg, GitHub, 46.
Read more >
Simple index - piwheels
... saigon gissip phonetizer-google tox-battery django-sitemaps altair-catplot tiddlywebplugins-imaker split-threads napari-annotate zyte-scrapycloud-cli ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found