Skip to content

Inner workings refactor: Support all parameters on the respective TraceStyle function #112

@kMutagene

Description

@kMutagene

Description

We have the problem of chart generation having easily > 20 parameters, an amount that is not especially user friendly when exploring the ChartAPI for the first time. While the following is kind of half there already, my first reaction to this was providing two overloads:

Chart.Point(<the most common 5 parameters>)
Chart.Point(<all >30 parameters>)

But this makes the API more bloated than it is already.

So the way to go at this is use the Trace layer that is already there: All charts have a corresponding TraceStyle function. This is the function that should be able to set all parameters of a respective chart type, and it should be obvious from the documentation that they should be used for full access to all styling parameters.

Here are the ways for applying full control then:

Chart.Point(basics)
|> GenericChart.mapTrace (
	Trace.TraceStyle.Scatter(
		details
	)
)

Trace.initScatter(
    Trace.TraceStyle.Scatter(details)
)
|> GenericChart.ofTraceObject

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions