Looking for a Venn-Diagram

Hi

Im Looking for a Venn-Diagram if anyone has one available. cant find anything in the blocks, and Google isn’t providing any good results either.

The usecase is that I want to use a venn diagram to visualize our users, and how many from different segments are part of other segments. for example, we have users that take part of paid content and users who take part of free content. and I want a venn diagram to see how many take part of both types of content, or just one of them.

regards
Alex

Solved Solved
0 9 2,813
1 ACCEPTED SOLUTION

Unless you have 2 segments, Venn diagrams (Euler diagrams) aren’t easy to construct in general.

I’d say the most robust vis for showing set overlap with an arbitrary number of sets is a chord diagram, which we do have in our custom viz library

View solution in original post

9 REPLIES 9

Can you share your use cases with us? It sounds interesting!

sure, see edit 🙂

bumping this one

bumping again

bump once again

I think they only way to achieve it would be to take something like this: https://github.com/benfred/venn.js/ and make it compatible with Looker external visualisations

lizzy1
New Member

If you aren’t tied to circles you could do a stacked bar chart. Not sure what your data looks like underneath but I would probably do something like this:

  1. Make a derived table that is the user attributes I want. In this case something like:
    select userid,
    max(case when segment = 'Paid' then 1 else 0 end) as paid,
    max(case when segment = 'Free' then 1 else 0 end) as free,
    from {table}
    group by 1;;

  2. Make a dimension that is something like:
    dimension: customer_type {
    type: string
    sql: case when ${TABLE}.paid = 1 and ${TABLE}.free = 1 then 'Both'
    when ${TABLE}.paid = 1 and ${TABLE}.free = 0 then 'Paid Only'
    when ${TABLE}.paid = 0 and ${TABLE}.free=1 then 'Free Only' end;;
    }

  3. Make a measure that is count(distinct(userid))

  4. Build the stacked bar off that explore.

If you want the columns ordered in a certain way you can use the LookML Case instead of the SQL CASE WHEN to set the order. Here’s some documentation on that: https://help.looker.com/hc/en-us/articles/360023657833-Using-LookML-CASE-vs-SQL-CASE-WHEN

Unless you have 2 segments, Venn diagrams (Euler diagrams) aren’t easy to construct in general.

I’d say the most robust vis for showing set overlap with an arbitrary number of sets is a chord diagram, which we do have in our custom viz library

Hi,

Tried this out and it worked splendidly, thanks!

Top Labels in this Space
Top Solution Authors