Beeswarm – an HTML Tool using Python


Accepting the challenge to build an HTML tool in Alteryx (in my case, with the Python engine), I settled for something I’ve been missing from the reporting tools (even with the added Plotly features):

A simple way to create a swarmplot. I was hoping to be using the PyBeeswarm module, that offered multiple ways of jittering the data, but it seems to not be updated anymore so, instead, created a wrapper for seaborn.swarmplot, which, additionally, allows for an overlay with violin plots or box plots.

The packaged tool is here (.yxi installer) and a sample workflow here. 
icon of the Beeswarm tool showing the python icon and a

Bringing the tool to the canvas, connecting it to the data stream and running the workflow once (so that the tool becomes aware of the fields available upstream) will bring the configuration window with the options to configure.

configuration window - select measures, categorical to split, color,
overlays,
etc.

Configuration of the BeeSwarm Tool

  • Required items:
    1. At least one numeric measure
  • Optional:
    1. Other measures.
    2. One categorical variable to split the dots.
    3. A column to specify the color.
    4. Settings for the graph (Despine or not – and then trim it or not, Show/Hide Legends).
    5. Select overlay: None, Boxplot, Violinplot.

Swarmplot without color source

When a column with the color information is not provided, colors are assigned randomly.

The current version doesn’t accept a color column when no key is added (it will color the different measures randomly). Click here to open the video if it’s not playing embedded

Swarmplot with a color source

Colors are assigned as specified Click here to open the video if it’s not playing embedded

Sample Outputs Using Iris dataset. Different overlays with Despine and Trim ON.
Sample Outputs Using Iris dataset. Different overlays with Despine and Trim ON.

Sample Workflow with different tool settings.

Workflow where the tool is used with multiple
configurations. Click on the image to download.
Workflow where the tool is used with multiple configurations. Click on the image to download.

Thanks for reading!

This post is crossposted from archived.dsmdaviz.com

Back to blog