WIP: suport colorscale, custom labels and scattergl#1
Draft
adrien-n wants to merge 2 commits intocamlspotter:masterfrom
Draft
WIP: suport colorscale, custom labels and scattergl#1adrien-n wants to merge 2 commits intocamlspotter:masterfrom
adrien-n wants to merge 2 commits intocamlspotter:masterfrom
Conversation
Author
|
Two other possible approaches: 1- expose more of python.ml (make t not private and expose go, of_attributes and of_layout functions) My preference is 2- as it's very simple and effective. On the other hand, it requires using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I've started using plotly and I'm very happy to have bindings for it!
I wanted to add a Viridis colorscale and label all my markers. Unfortunately this doesn't really fit in well with the current API (and Plotly's API does not always make things easy) and I wanted to start a discussion on how to integrate these two things.
First, "colorscale" is an attribute in the "marker" attribute and there are several ways to use it, including passing all the colors to use one-by-one but the most common case is probably to pass all your data and habe plotly create the colormap.
Second, "text" is a direct attribute and it's simply the strings in the same order as the points to label.
I think it's possible to add a
?textargument as I've done here. I don't think the current code for marker and color scale is fine however and I'd like your input.It's possible to extend the
Base.Type.tand convert using it but that's quite a bit of work and there are probably more cases (here, I already needed an array of elements that are either a string, an integer or a float array). What do you think about allowing the user to directly pass custom attributes directly as lists of python values? In the linked code,marker_attributeswould be a parameter instead of being defined inplotly-ocaml.PS: I think the string
"marker"shouldn't be constant but that doesn't change the crux of the topic.