-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sign detection for negative traces #118
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
+ Coverage 88.49% 88.62% +0.13%
==========================================
Files 6 6
Lines 339 343 +4
==========================================
+ Hits 300 304 +4
Misses 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
|
if stack | ||
plot_kwargs[:stackgroup] = string(plot_length + 1) | ||
plot_kwargs[:stackgroup] = string(plot_length + 1 + sign_group) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I fully understand this line. I get that we want the negative and non-negative data to go in different groups and that adding sign_group
achieves that, but why are we naming the groups based on plot_length
, and why the magic number sign_group = 10
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a 10 is such that is still compatible with the other uses of plot data frames.
@@ -94,7 +100,7 @@ function _dataframe_plots_internal( | |||
layout_kwargs[:xaxis] = | |||
Plots.PlotlyJS.attr(; showticklabels = !bar, title = "$time_interval") | |||
layout_kwargs[:title] = "$title" | |||
layout_kwargs[:barmode] = stack ? "stack" : "group" | |||
layout_kwargs[:barmode] = stack ? "relative" : "group" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't object to this change, but my test stacked plot with negative data looks the same before vs. after. In what situation does this give a different-looking plot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when generation is negative. That's the use case
Creates a group to handle the negative values separately