Code Monkey home page Code Monkey logo

supervenn's People

Contributors

gecko984 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supervenn's Issues

Add utility to convert instersection size data to sets

Proper handling of intersection sizes as inputs requires a big refactoring #30

Meanwhile, it's easy to add a utility function that will take something like a dataframe like this


is_in_set_1  is_in_set_2  is_in_set_3  size
True         True         True         123
True         True         False        456
...

and generate dummy sets that will produce the desired diagram when passed to supervenn(). Something like this

from collections import defaultdict
sets = defaultdict(set)

idx = 0

for _, row in df.iterrows():
    flags = row.iloc[:-1]
    count = row.iloc[-1]
    items = range(idx, idx + count)
    for colname, bool_value in flags.iteritems():
        if bool_value:
            sets[colname].update(items)
    idx += count

Recommended parameters for visualizing supervenn with 9 large sets

I'm trying out supervenn on a dataset I'm working on and noticed some gnarly overlap in the ITEMS.

What are you recommended settings to visualize this?

from supervenn import supervenn
with plt.style.context("seaborn-white"):
    fig, ax = plt.subplots(figsize=(21,13))
    supervenn(sets, set_annotations, side_plots=True, ax=ax, chunks_ordering="occurence" )

image

[Feature request] Take in an `ax` object like seaborn, networkx, and other matplotlib wrappers

from supervenn import supervenn
sets = [{1, 2, 3, 4}, {3, 4, 5}, {1, 6, 7, 8}]
with plt.style.context("seaborn-white"):
    fig, ax = plt.subplots()
    supervenn(sets, side_plots=False, ax=ax)
# ---------------------------------------------------------------------------
# TypeError                                 Traceback (most recent call last)
# <ipython-input-61-9074a6cee262> in <module>
#       3 with plt.style.context("seaborn-white"):
#       4     fig, ax = plt.subplots()
# ----> 5     supervenn(sets, side_plots=False, ax=ax)

# ~/anaconda3/envs/soothsayer5_env/lib/python3.8/site-packages/supervenn/_plots.py in supervenn(sets, set_annotations, figsize, side_plots, chunks_ordering, sets_ordering, reverse_chunks_order, reverse_sets_order, max_bruteforce_size, seeds, noise_prob, side_plot_width, min_width_for_annotation, widths_minmax_ratio, side_plot_color, dpi, **kw)
#     323         effective_min_width_for_annotation = min_width_for_annotation
#     324 
# --> 325     plot_binary_array(
#     326         arr=composition_array,
#     327         row_annotations=set_annotations,

# TypeError: plot_binary_array() got multiple values for keyword argument 'ax'

Right now it's not practical to use these in a production setting because we can't integrate these into existing figures.

Question: Easy way to hide exclusive chunks

Hi, thanks for this great package! I was wondering if there is an easy way to hide exclusive chunks (i.e. chunks that exist only in a single set)?

It would be great have an option named "chunks_min_set_overlap" which defaults to 1, meaning that exclusive chunks are plotted and raising it to 2 would plot only the chunks present in at least two sets.

Background color of set-unique elements?

Is there / what is the difference between white and gray color of rows? - outside of the overlap chunks. If there is no difference, is there a way to assign a single color to the background, like all white or all grey? Thanks!

Text Styling

I am trying to achieve the following:

  1. Format the counts on the bottom and right of the figure, e.g. to add a thousand separator (25137 --> 25,137)
  2. Increase the height/padding of cells on the bottom row, so the counts do not overlap the borders
  3. Independently change the font size of the counts vs. the set names

Are these changes possible and if so, how?

image

Set elements' names visible in visualizations?

Hey, this is a cool package!

While maybe impractical for larger sets where numbers are best, is it possible to include elements' names in the visualization?

Given say a seven-set scenario with five elements in each, it might be helpful to actually be able to see the names of the elements that are unique or in common, rather than only have the anonymous "2" elements in common or unique.

Is that already possible?

Cheers,
Haakon

How to transform the super venn diagram to donut plot?

Hi,
I found the super venn diagram very helpful as it can handle data with many sets. Is it possible to have a function to stretch and bend the rectangular plot to a donut plot (circular)? Sometimes, a donut plot is visually more appealing. It doesn't require any rearrangement of the chunks or rows, maybe just changing from a Cartesian coordinate system to a ploar coordinate system.

Thanks!

Where can I find the resulting picture?

Perhaps I am doing something really stupid here, but I just wanted first to reproduce the very basic example first. I installed the package and created a python script with the following lines:

from supervenn import supervenn
sets = [{1, 2, 3, 4}, {3, 4, 5}, {1, 6, 7, 8}]
supervenn(sets, side_plots=False)

Now I run it - and nothing happens! The script just terminates and I am unable to find resulting picture anywhere. What am I doing wrong?

got multiple values for keyword argument 'row_heights'

Somehow the row_heights default value is set when the function is called. Rendering the if statement dealing with no given row_height useless. However, when i want to add a custom row_height it gives me this error: "TypeError: supervenn._plots.plot_binary_array() got multiple values for keyword argument 'row_heights'".
I think the issue is solvable by just deleting row 454.

Restriction on intersection degree

Is there a way to restrict the visualisation to a certain degree? For eg, I have 12 sets, visualising all of them together takes a lot of time and the graph is extremely dense to look at. Can I restrict the overlap degree to 3? That is, I'll see overlapts upto only 3 sets.

Setting the font size of the sets

Hey, great package!

I'm struggeling to set the font size of the names of the sets displayed in the middle of the bars. I manage to access the axis to set the size of x and y label.

How can I access the other text elements to set their size?

Typo in readme

Hi Fedor,

Thank you for this tool, it is very useful and well documented!

There is a typo error in the readme during the presentation of the min_width_for_annotation argument. The argument widths_minmax_ratio is used instead of min_width_for_annotation in the python code block.

before finding the optimal permutation of columns, break the sets into connected components

Call two sets connected, if they have at least one element in common.
Break the sets into connected components first. Each component will have its own chunks, and so each component's chunks can be rearranged separately.
Finding the connected components can be done using the DSU algorithm. We'll be making sets of sets. Start with all sets being a component on its own. Then take one element from each chunk and call union on all sets that this chunk contains

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.