How to use the autovizwidget.autovizwidget.plotlygraphs.piegraph.PieGraph function in autovizwidget

To help you get started, we’ve selected a few autovizwidget examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyter-incubator / sparkmagic / autovizwidget / autovizwidget / plotlygraphs / graphrenderer.py View on Github external
def _get_graph(chart_type):
        if chart_type == Encoding.chart_type_scatter:
            graph = ScatterGraph()
        elif chart_type == Encoding.chart_type_line:
            graph = LineGraph()
        elif chart_type == Encoding.chart_type_area:
            graph = AreaGraph()
        elif chart_type == Encoding.chart_type_bar:
            graph = BarGraph()
        elif chart_type == Encoding.chart_type_pie:
            graph = PieGraph()
        elif chart_type == Encoding.chart_type_table:
            graph = DataGraph()
        else:
            raise ValueError("Cannot display chart of type {}".format(chart_type))

        return graph
github jupyter-incubator / sparkmagic / autovizwidget / autovizwidget / plotlygraphs / piegraph.py View on Github external
def render(df, encoding, output):
        if encoding.x is None:
            with output:
                print("\n\n\nPlease select an X axis.")
                return

        try:
            values, labels = PieGraph._get_x_values_labels(df, encoding)
        except TypeError:
            with output:
                print("\n\n\nCannot group by X selection because of its type: '{}'. Please select another column."
                      .format(df[encoding.x].dtype))
                return
        except (ValueError, DataError):
            with output:
                print("\n\n\nCannot group by X selection. Please select another column."
                      .format(df[encoding.x].dtype))
                if df.size == 0:
                    print("\n\n\nCannot display a pie graph for an empty data set.")
                return

        max_slices_pie_graph = conf.max_slices_pie_graph()
        with output:
            # There's performance issues with a large amount of slices.

autovizwidget

AutoVizWidget: An Auto-Visualization library for pandas dataframes

BSD-3-Clause
Latest version published 9 days ago

Package Health Score

82 / 100
Full package analysis