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

mode:text for regl-scatter2d #2501

Closed
jackparmer opened this issue Mar 27, 2018 · 6 comments
Closed

mode:text for regl-scatter2d #2501

jackparmer opened this issue Mar 27, 2018 · 6 comments
Assignees
Labels
feature something new

Comments

@jackparmer
Copy link
Contributor

jackparmer commented Mar 27, 2018

I have a few bio customers who need to display hundreds to thousands of single letter markers like in the below graph:

image

@dfcreative already has a great example of single-letter rendering for regl-scatter2d here:
https://dfcreative.github.io/regl-scatter2d/copyrights.html

I'd like to propose that mode: text be enabled for scattergl, but only work for single letters (for now).

Note that mode: text currently does not do anything for scattergl: https://codepen.io/plotly/pen/dmZNjM

We've tried creating graphs like the above with SVG, but for a larger number of letters, they are too slow. Here is an SVG example with a mode: text scatter trace overlaid on a heatmap trace: https://plot.ly/~jackp/18395/ (Note how long it takes to update when dragging the slider).

@jackparmer jackparmer added the feature something new label Mar 27, 2018
@etpinard
Copy link
Contributor

etpinard commented Mar 27, 2018

I have my doubts about the single-letter approach. If we do so, then we would stuck with that until we make breaking API changes. @dfcreative How hard would it be to support text of all lengths?

And by the way @jackparmer about https://plot.ly/~jackp/18395/ are you unhappy about the first-render performance or just the drag hangups (or both 😏 )? Simply improvement drag performance for SVG text nodes shouldn't be too hard.

@jackparmer
Copy link
Contributor Author

are you unhappy about the first-render performance or just the drag hangups (or both 😏 )

Mostly the drag performance.

How hard would it be to support text of all lengths?

Dima told me up to 2 weeks.

@dy
Copy link
Contributor

dy commented Mar 27, 2018

@etpinard depends on the requirements. There are many ways to do that, the simplest is canvas2d texture, that may take a day or two, not guaranteed it will be fast. Font-texture or something with sdf would take a week or two. Same for vector-based approach.

There is no reliable components for doing full-featured font rendering in webgl so far. The nicest approach is in thetamath, but that is written in glslx and skew-lang.

@jackparmer
Copy link
Contributor Author

I think we should do the sdf method after splom if we want multi-character marker text in scattergl. No point in adding mode: text to scattergl if it's not going to be significantly faster than SVG scatter.

@etpinard
Copy link
Contributor

Related: #1116

@etpinard etpinard changed the title single-letter mode:text for regl-scatter2d mode:text for regl-scatter2d Apr 4, 2018
@etpinard
Copy link
Contributor

etpinard commented Jul 5, 2018

done in #2737, followup in #2780

@etpinard etpinard closed this as completed Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

3 participants