Skip to content
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

WIP: add interactive recipe for OnlineStats plot #215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

piever
Copy link
Collaborator

@piever piever commented Jul 20, 2018

Still needs tests and docs and I need to allow the user to choose what statistics to run. Of course the layout should be worked on, not sure what option is best but am open to suggestions. Here the user can choose x axis, optionally y axis, whether they want to split the data and by which variables, whether they want to drop missing data and the number of partitions. Only plot button and number of partition slider cause the plot to update.

This takes a very small dependency (Widgets+Observables), and to use it the user needs to:

using Plots, Interact, JuliaDB
interactivepartition(t)

@joshday I may need some help as I don't know OnlineStats that much. Is there a list of statistics that it makes sense to use for this kind of plot? Do they all have a version with zero arguments (say Extrema())?

interactivepartition

@joshday
Copy link
Collaborator

joshday commented Jul 20, 2018

The partitionplot code needs some cleanup (see my stale PR #190). I haven't had time to look at it lately, but I may actually have the time today.

Note that partitionplot is meant to be an easier way of working with OnlineStats.Partition and OnlineStats.IndexedPartition, but there are some edge cases for which partitionplot makes things more difficult (why I need to clean things up).

The most useful stats to use with this are Extrema, Mean, Hist, and CountMap.

@piever
Copy link
Collaborator Author

piever commented Jul 20, 2018

Ok, let me know when the API of partitionplot stabilizes!

Otherwise, I could also do the GUI for OnlineStats.Partition (if it turns out to be useful for non-tabular data as well or is something you'd be interested in having in OnlineStats).

@codecov-io
Copy link

codecov-io commented Jul 20, 2018

Codecov Report

Merging #215 into master will decrease coverage by 0.88%.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #215      +/-   ##
========================================
- Coverage   72.88%    72%   -0.89%     
========================================
  Files          19     20       +1     
  Lines        1309   1325      +16     
========================================
  Hits          954    954              
- Misses        355    371      +16
Impacted Files Coverage Δ
src/JuliaDB.jl 100% <ø> (ø) ⬆️
src/interactiverecipes.jl 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79b9d1f...55c4b5c. Read the comment docs.

@shashi
Copy link
Collaborator

shashi commented Nov 6, 2018

This is cool! We should chip on it a bit more.

@piever
Copy link
Collaborator Author

piever commented Nov 6, 2018

I'm happy to update it as Interact changed quite a bit in the mean time but I was waiting for JuliaDB to update to 1.0 as latest Interact is not Julia 0.6 compatible

:nparts = @nodeps slider(1:200, value = 100, label = "number of partitions")
:nparts_throttle = Observables.throttle(throttle, :nparts)
:dropmissing = @nodeps toggle(false, label = "dropmissing")
:by = @nodeps dropdown(colnames(t), multiple = true)
Copy link
Collaborator

@shashi shashi Feb 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @nodeps macro is kind of an eye sore... They all appear as an :sym = @nodeps ... assignment here. I was wondering if it'd be OK to take syntax inspiration/precedent from PlotRecipes and use :sym <-- slider(...) to mean :sym = @nodeps slider(...).

I almost want to be convinced that what I just said is a terrible idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually like to remove syntactic magic as much as possible. One possible way forward is piever/Widgets.jl#25: add definitions in Widgets which would be overloaded by a backend (InteractBase for now, hopefully also Makie in the future). Then slider would be defined in Widgets so just sym = slider(1:100) would work. I was planning to try and finish up that PR in the near future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually like to remove syntactic magic as much as possible. One possible way forward is piever/Widgets.jl#25: add definitions in Widgets which would be overloaded by a backend (InteractBase for now, hopefully also Makie in the future). Then slider would be defined in Widgets so just sym = slider(1:100) would work. I was planning to try and finish up that PR in the near future.

@piever
Copy link
Collaborator Author

piever commented Feb 17, 2019

Thanks to the rework in Widgets and InteractBase the @nodeps macro is no longer needed and there is overall less macro magic. There still seems to be some issues with the underlying plot recipes though, see #252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants