📖 Table of Contents
🧮 What is upsetty? 
Python package for creating UpSet plots using Plotly.
🤔 What's an UpSet Plot?
An UpSet plot is a diagram used to quantitatively visualize sets and their interactions. They are particularly useful visuals for determining the overlap between different groups, as an alternative to Venn or Euler diagrams, which can become cluttered and hard to read with more than a few sets.
✨ Why create upsetty?
Currently, the number of tools to create UpSet plots is very limited. Indeed, many of the previous packages for creating these plots have been deprecated or are too verbose.
To that end, we offer upsetty as a lightweight, easy-to-use alternative for analyzing overlapping sets in Python.
🤩 Like this repository? Giving a ⭐️ really helps out!
🚀 Quickstart
⬇️ Installation
pip install upsetty
⚙️ Usage
from upsetty import Upset
To create an UpSet plot, we structure the data like this:
import pandas as pd
# create sample data ({'class_name': [boolean indicators]})
data = {
'Class A': [True, True, True, False, False, True],
'Class B': [True, True, True, True, True, False],
'Class C': [False, False, False, True, True, True]
}
# convert sample data dict to pd.DataFrame
df = pd.DataFrame(data)
Then, simply pass the DataFrame to the generate_plot method to create a Plotly figure of an UpSet plot.
# create UpSet figure
upset = Upset.generate_plot(df)
# show the figure
upset.show()
Using the sample data provided above, the output is pictured below:
You can also change the colors and sizing for various aspects of the plot by passing additional parameters to the generate_plot function like so:
upset = Upset.generate_plot(
# sample data
df,
# change category colors to a light blue, green, and yellow
categories_colors=['#3987CA', '#FFC300', '#39CA41'],
# change the category label color to a dark black
categorylabel_color='#2F2F2F',
# change the bar intersect color to a soft black
bar_intersect_color='#454545',
# change the marker line color to a soft black
markerline_color='#454545'
)
By default, the function expects a DataFrame with columns of all boolean values, indicating the presence of absence of a given class.
If you wish to compute set instersection based on some other value in your data, you can do so like this:
data = {
'Class A': [True, True, False, False, True, True, False],
'Class B': [True, False, True, False, True, False, True],
'Class C': [True, False, False, True, False, True, True],
# adding a column 'Value' of non-boolean numbers
'Value': [1, 2, 3, 4, 5, 6, 7]
}
df = pd.DataFrame(data)
upset = Upset.generate_plot(df, 'Value')
upset.show()
The code above will compute the sum of values for each subset within the classes, as depicted below.
📌 Future Plans
Auto-adjusting margins for variable class labels
Currently, the upsetty works best with 3-4 class labels. More or less than that causes the class labels to be misaligned. Future improvements will add capabilities for auto-adjusting the margins based on the number of class labels contained in the visual.
Intersection highlighting
The ability to highlight specific intersections would give the user a way to focus their visual on specific set interactions as opposed to the basic highlighting.
Intersection count makeup
The ability to show the makeups of the different classes in a set intersection count.
Metadata
Release files for upsetty 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| upsetty-0.1.3.tar.gz | 9.7 kB | Without provenance | Details for upsetty-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| upsetty-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for upsetty-0.1.3-py3-none-any.whl |
Total release size: 18.0 kB
Release files / upsetty-0.1.3.tar.gz
| Download URL | upsetty-0.1.3.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e22ac087afbbb988b64f381ba55b120351feb9742582aa9c0485622381126e73
|
|
BLAKE2b-256 checksum How to use checksums |
e0425a4c489c4b7616a13a06e7da710afc0a949f8adc1cf3bc17c34fe68e35a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / upsetty-0.1.3-py3-none-any.whl
| Download URL | upsetty-0.1.3-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33455ef81ced11d10f3a0542d11a027bed90206498c6dbba3df968db93c196a7
|
|
BLAKE2b-256 checksum How to use checksums |
3dad967931821f82a95349929ac41da8924cd06d7b5403d76898e6897b20a79d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for upsetty 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.