diff --git a/plot/annotation.v b/plot/annotation.v index fb932b673..9b44f6044 100644 --- a/plot/annotation.v +++ b/plot/annotation.v @@ -5,10 +5,10 @@ pub struct Annotation { pub mut: x f64 y f64 - text string - showarrow bool - arrowhead int - arrowcolor string = 'black' - align string = 'center' + text string [omitempty] + showarrow bool [omitempty] + arrowhead int [omitempty] + arrowcolor string [omitempty] + align string [omitempty] font Font } diff --git a/plot/scripts/plotter.py b/plot/scripts/plotter.py index 40e255e1d..df9c1febb 100644 --- a/plot/scripts/plotter.py +++ b/plot/scripts/plotter.py @@ -84,11 +84,6 @@ def process_trace(trace): trace = remove_empty_keys(trace) - if trace_type == 'pie': - if "marker" in trace: - trace["marker"].pop("opacity") - trace["marker"].pop("colorscale") - return map_trace_type_to_plotly_object(trace_type)(trace) diff --git a/plot/trace.v b/plot/trace.v index e0e4a9695..a1be4a50c 100644 --- a/plot/trace.v +++ b/plot/trace.v @@ -20,36 +20,36 @@ pub mut: x XType xbins map[string]f32 y []f64 - z ZType - values []f64 - labels []string - text []string - customdata [][]string - name string - mode string - marker Marker - line Line - pull []f64 - hole f64 - colorscale string = 'Viridis' - hovertemplate string - textinfo string - fill string - fillcolor string + z ZType [omitempty] + values []f64 [omitempty] + labels []string [omitempty] + text []string [omitempty] + customdata [][]string [omitempty] + name string [omitempty] + mode string [omitempty] + marker Marker [omitempty] + line Line [omitempty] + pull []f64 [omitempty] + hole f64 [omitempty] + colorscale string [omitempty] = 'Viridis' + hovertemplate string [omitempty] + textinfo string [omitempty] + fill string [omitempty] + fillcolor string [omitempty] } pub struct Marker { pub mut: - size []f64 - color []string - opacity f64 = 0.8 - colorscale string = 'Viridis' + size []f64 [omitempty] + color []string [omitempty] + opacity f64 [omitempty] + colorscale string [omitempty] } pub struct Line { pub mut: - color string - width f64 = 2.0 + color string [omitempty] + width f64 [omitempty] = 2.0 // check Plotly docs for more dash types dash string = 'solid' }