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.

Rays get hidden when zooming too much

See original GitHub issue

Description of the problem

When creating a plot with rays, if I zoom in “too much”, rays disappear. Apparently, this happens when zooming small areas which are relatively far from the start of the rays.

edit Basically, “infinite” rays gets shorter as you zoom in. Zooming in far from the start point will make the ray be too short to be visible.

MWE

Running the following code in jupyter notebook, rays start from 0 and have infinite length upwards. If I , for instance, zoom in the area (0;1), (35,0.5) I can still see the rays being painted, but if zoom in the area (0; 1.01), (35;0.98), rays disappear.

If, after zooming in (0; 1.01), (35;0.98), I pan the view toward the bottom, I can see the rays appearing near y coordinate 0.14. Therefore, rays have an y-extension that goes from 0 to 0.14, instead of 0 to infinity.

Resetting the view will bring back the rays as expected.

x = np.arange(50)
data = np.random.rand(x.shape[0])

tags = [1, 17, 31]
colors = 'red green red'.split()

ax = figure(plot_width=300, plot_height=300)

for t, c in zip(tags, colors):
    ax.ray(x=t, y=0, length=0, angle=90, angle_units='deg', color=c)

ax.line(x, data)
show(ax)

No errors on JavaScript console.

Platform

  • bokeh 0.13.0
  • python 3.6.6
  • jupyter notebook 5.6.0
  • Fedora Linux 27
  • mozilla firefox 61.0.1

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Aug 1, 2018

Anyway, we will have to report to a line clipping algorithm, e.g. Liang-Barsky (possible JS ref implementation here: https://gist.github.com/w8r/7b701519a7c5b4840bec4609ceab3171)

0reactions
bryevdvcommented, Aug 1, 2018

Even more fun, Number.MAX_SAFE_INTEGER renders this:

screen shot 2018-08-01 at 13 21 33
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do my vertices fade the further I zoom in?
The reason why zoom in/out affects those "fading" vertices is because blender is displaying partially wire inside of a mesh to improve viewport...
Read more >
Zoom: My Top 10 Home Lighting Tips
Fix: Raise your camera up to eye level ... It's just so easy! Raising the camera up a bit accomplishes a few things....
Read more >
Can not see objects when camera is zoomed out
Make sure you are viewing your scene from the camera Ctrl Numpad 0. Click on the camera properties tab on right panel. Under...
Read more >
Adjust your zoom and view options – Figma Help Center
When you first open a file, the default zoom level will be set to Zoom to fit. This focuses the viewport so you...
Read more >
How to Fix Mouse Zooming instead of Scrolling in Windows 10
In this video tutorial we are going to show you that how to Fix Mouse Zoom in instead of Scrolling in Windows 10If...
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