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

Support Plotly line attributes #33

Open
mars0i opened this issue Mar 7, 2025 · 2 comments
Open

Support Plotly line attributes #33

mars0i opened this issue Mar 7, 2025 · 2 comments

Comments

@mars0i
Copy link
Member

mars0i commented Mar 7, 2025

I think it would be useful to add Plotly-Hanami substitution keys for line width and dashed/dotted configuration, etc. line attributes:

{:data [{... :line {:width 1} ...} ...]}

The argument is a number, default 2: https://plotly.com/javascript/reference/scatter/#scatter-line-width

{:data [{... :line {:dash} ...} ...]}

This controls whether the line is solid, dashed, dotted, etc. ('Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").') https://plotly.com/javascript/reference/scatter/#scatter-line-dash

It's of course possible to use these attributes now e.g. using assoc-in on plotly/plot's output, but these seem like they would often be useful.

@daslu
Copy link
Member

daslu commented Mar 7, 2025

Thanks

@mars0i mars0i changed the title Support line attributes Support Plotly line attributes Mar 7, 2025
@mars0i
Copy link
Member Author

mars0i commented Mar 11, 2025

I just realized that the default line width is already controlled by :=mark-size. There are examples in the Plotly Walkthrough that illustrate this configuration. However, I don't think that :=mark-size can be used to set different widths for different lines at present. It's useful to be able to set different widths for lines representing different date in the same plot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants