-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Every function, at some point, has custom code to create a chart. This has necessitated the chart creation code to have some knowledge about the data with which it is created. To facilitate creation, the Chart constructor accepts a Pandas DataFrame which has column names, and when encoding the column names are referenced to encode the data for the chart. In boxplot.py a the _make_box_plot function has been used to abstract the chart creation which removes the need for the process to have information about the data being visualized. Given the addition of zscatter.py which also creates a heatmap and a highlights chart in the same way as zenrich.py, it would be nice to extend the abstraction seen in boxplot.py to the rest of ps-plot.
I am proposing the creation of lower-level function - dedicated to chart creation - which accept a Pandas DataFrame, as well as encoding information, and the give the programmer back a Altair Chart object. This will allow the programmer to construct a DataFrame without having to worry about giving the chart creation process any context about the data. This should reduce the amount of reused code, as well as make maintaining, extending, and writing new actions easier.
Considering the lab only has a few charts which are commonly created, we should start by abstracting this code first, and later more functions can be added.