adamerose / PandasGUI

A GUI for Pandas DataFrames
MIT No Attribution
3.19k stars 236 forks source link

New settings for custom kwargs #104

Closed fdion closed 3 years ago

fdion commented 3 years ago

Overview

Note, default title format is:

"{name}: {title_columns}{title_dimensions}{names}{title_y}{title_z}{over_by}{title_x} {selection}<br>"\
"<sub>{groupings}{filters} {title_trendline}</sub>"

Definition of the fields (also in utility.py comment):

Besides all dragger selections (x, y, z, color etc), and all custom kwargs, extra template variables are:

          date: current datetime
          filters: active filter expressions, comma delimited
          title_x: x minus units and with log scale if selected
          title_y: y minus units and with log scale if selected
          title_z: z minus units and with log scale if selected
          title_dimensions: dimensions list minus units
          title_columns: columns list minus units
          title_trendline: trendline description
          vs: when doing a title with x vs y, use {x}{vs}{y}
          over_by: when doing a title y over x, use {y}{ober_by}{x}. Preferred. for distributions, will use "by"
          name: dataframe name
          total: total number of observations
          subset: observations with active filters applied
          selection: ready to use string representing {subset} observations of {total}
          groupings: groupings tied to Legend and not on legend: marker_symbol, line_group, size etc

The title can also contain a few select html tags, like <i></i>, <b></b>, <sub></sub>, <br> etc (whatever plotly supports)

Testing

render_mode

Passed render_mode = 'auto', 'svg', 'webgl' and not passing it at all, worked as intended. svg was a few times slower than webgl/auto on a large set as expected, but at least that allows use of pandasgui without webgl.

Title

Histogram

filter applied: histogram_default_X

testing orientation: histogram_h_x_y_inverted

Scatter

size not in legend, but in subtitle: scatter

Lowess trendlines (requires statsmodels to be installed and the use of the trendline custom kwargs set to lowess: scatter_lowess

OLS trendlines (requires statsmodels to be installed and the use of the trendline custom kwargs set to ols: scatter_trendlines

Line

This will have to be revisited once line and bar have groupby as optional, title is not totally accurate as it is not reflecting masked observations and the average.

Using log scale on Y: line_log_y

Regular scale: lines_gapminder

Bar

See comment above on groupby for lines (for bar, in one case, average, in the other would be a count)

This is the current result with groupby: bar_with_groupby

With groupby disabled it would have looked something like this: bar_group_disabled

Box

Works fine with dark theme: box_titanic_extra_text

Title above has additional text, entered through custom kawrgs: extra_text

While on the subject of dark theme, trying a different plot type: penguins_scatter

Violin

[edited] Violin has similar title to box plot

violin_correction

Scatter 3D

most basic 3d plot: scatter_3d_just_title_when_no_filter_or_legend

3d with log scale on Y, filter applied and using size: scatter_3d_mpg_with_log_scale_cubed_weight

Heatmap

Heatmap with X/Y: heatmap_xy

Heatmap with X/Y/Z default aggregation (note, this is sum for heatmap): heatmap_xyz_default

Heatmap with X/Y/Z specified histfunc of max: heatmap_xyz_histfunc_max

Contour

Contour with X/Y: contour_xy

Contour with X/Y/Z default aggregation (note, this is count for contour): contour_xyz_default

Heatmap with X/Y/Z specified histfunc of max: contour_xyz_histfunc_max

Pie

Standard pie chart: pie

Pie chart with custom kwarg: pie_donut

Scatter matrix

Multiple dimensions (with units removed in title), no filters, origin / model year in legend (color, symbol), size in subtitle, all possible elements in play: splom

Wordcloud

With filter applied: wordcloud

Closes

This closes #101

This closes #102

END OF LINE

adamerose commented 3 years ago

Nice work thanks