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

Reworked data handling, allow for smaller board prototyping, and refactored slider plugins #2

Merged
merged 7 commits into from
Jul 22, 2022

Conversation

rickymagner
Copy link
Collaborator

This PR includes some code to address as few known shortcomings of the codebase.

  • Added a "hidden class" of DataManagers which get added to every DynamicPanel. These handle things like holding data relevant to the panel, parse from file paths, etc. Now you can load in DataFrames right from memory, which also gives a nice performance boost (at least anecdotally) and makes it easier to experiment. They also allow the new feature of using another panel's selected data as input, with documentation coming soon!
  • More edge-case testing for rendering boards without tabs & sidebars was done, and things should run smoothly now even with just one PlotPanel! One can use the start_app command to run an instance where the board input just receives a PlotPanel to view, or aPlotPanel with some plugins, etc. This should allow for very fast prototyping, and documentation with very simple starter code is coming soon for this use case.
  • Previously the Slider and RangeSlider plugins were handled with one class. Now these have been split into two separate, somewhat slightly redundant but much cleaner code.
  • Some other small updates to docstrings, etc should also be here.

Copy link

@meganshand meganshand left a comment

Choose a reason for hiding this comment

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

I had a few small questions but overall this is really well documented 👍

quickboard/base/_datamanager.py Outdated Show resolved Hide resolved
style=styles.PANEL_STYLE
)

def data_transform(self, df):

Choose a reason for hiding this comment

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

should this be named get_data_transform? I'm not clear on why this method is needed.

Copy link
Collaborator Author

@rickymagner rickymagner Jul 19, 2022

Choose a reason for hiding this comment

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

This is more of an "abstract method" in that can be overridden by child classes and is built-in to the callback infrastructure. I think I'm going to retire that functionality in a future release since I'm not sure it really adds anything (for plots at least; for data tables I think it still has some use in some examples I've written but can refactor those).

Choose a reason for hiding this comment

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

oh gotcha, that makes sense

@rickymagner
Copy link
Collaborator Author

Just added a bunch of documentation as well to try to squeeze into this PR, which demonstrates how to use some of the old and new features.


else:
self.df = pd.DataFrame()
print("ERROR: Invalid data_source input. Please see documentation for list of valid input types.")

Choose a reason for hiding this comment

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

Could you throw an actual error here now rather than just printing a message?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be fixed now

@meganshand
Copy link

This looks great! The documentation you added is really clear. On a note of personal preference, I do find life expectancy a somewhat bleak topic for a demo. On the other hand it's memorable and understandable!

@rickymagner
Copy link
Collaborator Author

Thanks, and yeah, I chose that default Plotly data set since it seems amenable to lots of different visualizations rather than for interesting content. Hopefully the examples with life expectancy are not too morbid to be distracting!

@rickymagner rickymagner merged commit ce05509 into main Jul 22, 2022
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.

None yet

2 participants