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

Handle properties that can be single values or collections of the same type #192

Closed
kMutagene opened this issue Sep 20, 2021 · 1 comment · Fixed by #250
Closed

Handle properties that can be single values or collections of the same type #192

kMutagene opened this issue Sep 20, 2021 · 1 comment · Fixed by #250

Comments

@kMutagene
Copy link
Collaborator

Description

Many properties in plotly.js can have multiple types and are interpreted differently depending on that type.
A complex example is Color, which can be either a single string (making all e.g. markers the same color), an array of strings representing color of individual points, values mapping to the relative intensity of a colorscale, etc.

While Color is complex enough to warrant its own type in Plotly.NET, there is another prominent case that should be handled differently, and that is the case where properties can either be a single value, or an array of values of the same type. Examples are the marker properties size and opacity.

These cases will be handled like marker sizes (see for example BubbleCharts) in 2.0:

  • all functions (meaning TraceStyle functions, Chart functions and extension methods) will get two arguments: ?<Property> and ?Multi<Properties>
  • As both could be set in a single call, The rule is that ?Multi<Properties> will always overrule ?<Property>
@kMutagene
Copy link
Collaborator Author

Related: #191 , #142

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.

1 participant