Skip to content

Commit

Permalink
Started new plot impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Oct 13, 2023
1 parent 3c83c65 commit e9d0f54
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 32 deletions.
10 changes: 5 additions & 5 deletions plot/annotation.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 0 additions & 5 deletions plot/scripts/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
44 changes: 22 additions & 22 deletions plot/trace.v
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

0 comments on commit e9d0f54

Please sign in to comment.