Closed Vindaar closed 6 years ago
Squashed some of the commits.
I'll move the ErrorBar
related functions to its own module tomorrow. Maybe I should split the api.nim
into a plotly_types.nim
, color.nim
, errorbar.nim
and keep the JSON related code in the api.nim
?
Maybe I should split the api.nim into a plotly_types.nim, color.nim, errorbar.nim and keep the JSON related code in the api.nim
I think that would make sense.
Went ahead and did that refactor, also made the ErrorBarKind
public (had to do that anyways to have it inside of the plotly_types
module).
First of all thanks for the great work so far!
I went ahead and added support for error bars on plots by introducing an
ErrorBar
type andxs_err
/ys_err
fields to theTrace
.I'm not sure if I'm super happy with my implementation here, but it seems to work just fine. It supports the whole range of plotly.js error bars, namely:
A simple example based on the scatter plot is also added.
What this PR also includes (I can cherry pick the error bar stuff out, if you don't like this): I changed a few procs to use the
result
variable instead of return, changed the style of the whitespace for the argument type and replaced theproc
keyword with the newfunc
keyword inapi.nim
.