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.

`figure.circle` render jumps around x-axis when zooming

See original GitHub issue

I’m a big fan of the library and have tried to be thorough in this bug report. Finding something like this might turn off people. If I’m doing science and the data appears to change while interacting, that breaks everything.

HTH

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

  • bokeh == 1.04
  • python == 3.7.2
  • Linux - Ubuntu 16
  • Chrome browser

Description of expected behavior and the observed behavior

Time series data from two curves plotted on same figure, when zooming the x-values of one curve jumps left and right of the reference curve. Not sure if the actual values are changing (unlikely) but it’s rendered position, relative to the reference curve jumps to the left and to the right or to the nominal position when zooming in/out.

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

from bokeh.plotting import figure, output_file, save
from bokeh.models import ColumnDataSource, LinearColorMapper, Range1d, WheelZoomTool                                                                
from bokeh.layouts import column, row
import numpy as np
import pandas as pd


fig_kwargs = {
    "x_axis_type": "datetime",
    "width": 1900,
    "height": 400,
    "tools": "pan,save,reset,box_zoom,xwheel_zoom",
    "active_scroll": "xwheel_zoom",
    "output_backend": "webgl",
}
output_file(f"reproduce.html")

fig = figure(**fig_kwargs)

control = np.arange(100)

df = pd.DataFrame(
    {
        "time": pd.date_range(pd.datetime.now(), periods=100, freq="1s"),
        "ctrl": control,
        "test": control + 5 * np.random.randn(100),
    }
)

# control
fig.scatter(
    x=df.time,
    y=df.ctrl,
    line_color="red",
    fill_color=None,
    marker="cross",
    size=5,
    legend="control line",
)

# test - no worky
fig.circle(
    x=df.time,
    y=df.test,
    fill_color=None,
    line_color="black",
    size=5,
    legend="test - wierd",
)

# test - yes worky
fig.scatter(
    x=df.time,
    y=df.test,
    fill_color=None,
    line_color="blue",
    size=5,
    legend="test - normal",
)

save(column(fig))

Stack traceback and/or browser JavaScript console output

Possibly issue related to WebGL backend compatibility

image

Screenshots or screencasts of the bug in action

Working at 1st zoom-level when method is scatter

image

Working at 2nd zoom-level when method is scatter

image

Not Working at 1st zoom-level when method is circle

image

Not Working at 2nd zoom-level when method is circle

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Jun 19, 2020

@devjit There have been a few small improvements to webgl codepaths recently. It’s possible this was fixed incidentally/accidentally as part of those—you’d just need to try a latest release and see. The large chunk of work I described above (re-writing the webgl backend) has not started yet (we did not get the CZI funding in 2019)

0reactions
bryevdvcommented, Aug 25, 2020

There was the start of a major webgl re-work in 2.2 and as of that release I can no longer repro this issue, so I will close. If you can still see this issue with 2.2+ please provide a complete minimal reproducer to investigate.

Screen Shot 2020-08-24 at 9 25 42 PM

Note that there is a small unrelated issue where webgl does not like like None colors (I had to set fill_color to “white” e.g.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scatterplot Zoom - Condense X-axis instead of changing ...
I'm running into a unique issue where instead of changing the radius of each point during zoom, the axis (X- axis) need to...
Read more >
D3 v4 Zoom x-Axis Zooming and Panning Issue - Stack Overflow
I'm updating the graph differently when panning and zooming in order to decrease the amount of times we regenerate the graph.
Read more >
Creating a zoom effect with scroll interactions - YouTube
In this stream, we'll create a zooming effect based on the new Magic Leap website (https://www.magicleap.com/).
Read more >
D3 zoom — the missing manual - freeCodeCamp
The zoom base is the parent element the zoom is attached to or registered on, as they say. It does two things: 1)...
Read more >
Adjust your zoom and view options – Figma Help Center
On both Mac and Windows trackpads, you can use the following gestures to adjust zoom: Stretch two fingers apart to zoom in. Pinch...
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