From 8428a68b80e9a310fcef35604cbd2dfd984b4e32 Mon Sep 17 00:00:00 2001 From: robpoll <37448609+robpoll@users.noreply.github.com> Date: Thu, 22 Oct 2020 09:29:23 +0200 Subject: [PATCH] Pie chart plot type added to TablePlotter (#330) * pie chart plot type added to table_plotter * pie chart plot type added to tableplotter * code formatted with black * tableplotter formatted with black * added label to to piechart * unused labels deleted, names fixed * pie chart default value set to the first available numeric column Co-authored-by: Asgeir Nyvoll <47146384+asnyv@users.noreply.github.com> * changelog updated; piechart option added to tableplotter Co-authored-by: Rob Poll Co-authored-by: Asgeir Nyvoll <47146384+asnyv@users.noreply.github.com> --- CHANGELOG.md | 2 ++ webviz_config/generic_plugins/_table_plotter.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d25d4561..edeb4f23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ shipped plugins install themselves through the `webviz_config_plugins` entrypoin ad-hoc plugins as this is costly to maintain. Also, the `module.PluginName` notation in configuration files can then in future be used fo distinguish between multiple plugin packages using the same plugin name. +- [#330](https://github.com/equinor/webviz-config/pull/330) - Pie chart plot type now +available in table plotter. ### Fixed - [#325](https://github.com/equinor/webviz-config/pull/325) - Support plugin projects diff --git a/webviz_config/generic_plugins/_table_plotter.py b/webviz_config/generic_plugins/_table_plotter.py index d4ac06e6..4d40db25 100644 --- a/webviz_config/generic_plugins/_table_plotter.py +++ b/webviz_config/generic_plugins/_table_plotter.py @@ -96,6 +96,7 @@ def plots(self) -> dict: "histnorm", ], "bar": ["x", "y", "color", "facet_col", "barmode"], + "pie": ["values", "names"], "scatter_3d": ["x", "y", "z", "size", "color"], "line": ["x", "y", "color", "line_group", "facet_col"], "line_3d": ["x", "y", "z", "color"], @@ -130,6 +131,18 @@ def plot_args(self) -> dict: "multi": False, "clearable": False, }, + "values": { + "options": self.numeric_columns, + "value": self.plot_options.get("values", self.numeric_columns[0]), + "multi": False, + "clearable": True, + }, + "names": { + "options": self.columns, + "value": self.plot_options.get("names", None), + "multi": False, + "clearable": True, + }, "size": { "options": self.numeric_columns, "value": self.plot_options.get("size", None),