Skip to content

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

Closed
@kMutagene

Description

@kMutagene

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions