Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add source parameter to Span or create SpanSet #5962

Closed
agilly opened this issue Mar 7, 2017 · 8 comments · Fixed by #9648
Closed

add source parameter to Span or create SpanSet #5962

agilly opened this issue Mar 7, 2017 · 8 comments · Fixed by #9648

Comments

@agilly
Copy link

agilly commented Mar 7, 2017

This is not a bug but rather a feature request.

The Label text annotation currently has a very useful corresponding LabelSet companion that allows to define a ColumnDataFrame as source for the text boxes.

It would be helpful to have an equivalent SpanSet object to draw multiple spans from a ColumnDataFrame. Currently, to arrive at the same result one has to hack one's way using ray objects bound to a data frame.

Current way:

# rays used as spans, y is a large negative number for vertical spans
p.ray(x='x', y='y', color='firebrick', length=0, angle=90, angle_units='deg', alpha='alpha', source=ray_source)

Proposed way:

spans=SpanSet(location='x', dimension='height', line_color='firebrick', alpha='alpha', source=span_source)
p.add_layout(spans)
@bryevdv
Copy link
Member

bryevdv commented Mar 8, 2017

This seems reasonable. Checking, do you have the ability and interest to work this up in a PR? The LabelSet code should be a fairly reasonable comparison and we are happy to answey any dev-related questions.

@bryevdv
Copy link
Member

bryevdv commented Mar 9, 2017

ping @agilly sorry I should have used your GH name in the previous message to notify you

@agilly
Copy link
Author

agilly commented Mar 9, 2017

Sorry for the delay. Interest, certainly; ability, not sure. This would certainly be a first. It might take some time until I get my bearings. So far I can see 3 files that would need to be modified/created:

  • bokehjs/src/coffee/models/annotations/index.ts, modified with something like export {SpanSet} from "./span_set"
  • bokehjs/src/coffee/models/annotations/span_set.coffee, which should be modelled after label_set.coffee
  • bokeh/models/annotations.py, for the class definition.

Is there anything else (apart from the docs)?

@bryevdv
Copy link
Member

bryevdv commented Mar 9, 2017

@agilly Yes that's pretty much it for the implementation. The PR would need also need a basic "test the default values" test like this:

https://github.com/bokeh/bokeh/blob/master/bokeh/models/tests/test_annotations.py#L223

I'm happy to advise or help contribute on any or all of those (including the docs which is just a line to add things to the refguide and a small section in the users guide)

@behinger
Copy link

Any update on this? Would be quite helpful to me

@bryevdv
Copy link
Member

bryevdv commented Dec 27, 2018

@behinger if there were any update, it would be here. Resources are very limited right now, we are happy to help/advise anyone who would like to work on a PR earlier than the core team is able to look at it.

@lemarcantoine lemarcantoine mentioned this issue Feb 8, 2020
3 tasks
@bryevdv bryevdv modified the milestones: short-term, 2.1 May 21, 2020
@bryevdv bryevdv modified the milestones: 2.1, short-term May 22, 2020
@bryevdv bryevdv reopened this Jun 7, 2020
@bryevdv
Copy link
Member

bryevdv commented Jun 7, 2020

PR had to be reverted, unfortunately, due to errors on master after merge.

@mattpap
Copy link
Contributor

mattpap commented Nov 19, 2023

In PR #12677 HSpan and VSpan glyphs were implemented, which allow to achieve what was proposed in this issue. Additionally, existing vectorized annotations will be replaced with glyphs (see e.g. PR #13344).

@mattpap mattpap closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
@mattpap mattpap removed this from the short-term milestone Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants