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.

Improve Annotations vs Glyphs for 3.0

See original GitHub issue

There are duplications, inconsistencies and warts around annotations.

Some context: The original motivation for splitting off annotations like BoxAnnotation from say, a Rect glyph is that annotations may be positioned via screen coordinates, which makes re-using the spatial index hit-testing cumbersome/impossible.

Some goals:

  • Adopt consistent naming conventions for single/multiple. E.g. we have Label (single) and LabelSet (plural) for labels. But Arrow i implicitly vectorized with a source.

  • Allow annotations to be added to legends (this has come up several times recently)

  • Allow annotations to participate in hit testing – but this is probably best exposed as a new event for annotations, rather than selections on data sources

  • Some annotation specific improvements:

    • make it easy to attach labels to other things
    • make arrows simpler/easier to use (also easy to “attach” to things)
  • Try to find opportunities to reduce code duplication between annotations and similar glyphs

EDIT:

  • Allow annotation visibility to be linked to other glyphs

cc @bokeh/dev What else?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
bryevdvcommented, Apr 26, 2020

Where the attachment is optional?

and PlotAnnotation would be singular (a box, a, region, a free-standing label).

I think it’s reasonable to have separate types for glyph labels and plot labels. Indeed there would have to be, if we make the PlotAnnotation vs GlyphAnnotation split in the class hierarchy. I just don’t like the current names “Label” and (especially) “LableSet” at all.

1reaction
bryevdvcommented, Apr 24, 2020

So, FYI I agre things should be made less obtrusive, think there are reasonable reasons to maintain some separation:

  • annotation should generally go “on top” so the separation affords a place to specify an appropriate default render level for annotations that is different from glyphs

  • rbush spatial indexing uses data coords. It has to, otherwise a complete-reindex would be required on e.g. every single pan movement. But this makes hit testing things that can have fixed screen coordinates (or worse–a mix of screen and data coordinates) very, very difficult.

    What would like is for annotations to support hit tests, just not to use rbush for it like glyphs do (there are usually only a relatively small number of annotations drawn, hit testing can just be brute-forced in screen space)

We also jut have a lot of glyphs. Keeping a group of “annotations” affords some structure for documentation, even if things can be used relatively in the same manner.

Also there are thing that just behave differently. There is no glyph analogue to Band, and I don’t think there should be. There is no notion of rects or quads that can be unbounded in any dimension, and I don’t think there should be that, either.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Glyphs 3 Handbook December 2021 - Glyphs App
Glyphs 3 is a professional Mac application for creating OpenType fonts. It allows you to draw, edit and test letter shapes in a...
Read more >
glyphs — Bokeh 3.0.0rc6 Documentation
Base class for all glyph models. Note. This is an abstract base class used to help organize the hierarchy of Bokeh model types....
Read more >
Numeric Annotation Glyphs - Wikipedia
Numeric Annotation Glyphs or NAGs are used to annotate chess games when using a computer, typically providing an assessment of a chess move...
Read more >
How can I add text annotation in Bokeh? - Stack Overflow
As of version 0.12.2, to add text annotations you would use the "label" glyph. from bokeh.models import Label p = figure(.
Read more >
Creating custom symbol images for your app - Apple Developer
Create, organize, and annotate symbol images using SF Symbols. ... your minimum deployment target is iOS 15 or later, you only need the...
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