Semantics-Preserving Euler Diagram Renderer (Flask + D3)

Interactive visualization of set intersections using zones, a super-dual graph, ring layout, and smooth set curves.
Created by Noemi Gazdik and Greta Gyori. Kehlbeck et al., 2022.

Final result

Screenshot of the final Step 4 diagram (set curves + member labels).

Final set-curve diagram (Step 4)

Links

Purpose

This program visualizes a set system (e.g., attributes, groups, categories) by computing all observed set intersections (“zones”) and drawing one closed curve per set. The goal is to make the structure of overlaps easy to understand: which combinations exist, how they relate by inclusion, and where members belong.

Input format

Datasets are provided as CSV files. Each row is a member, with a name column and one column per set. Originally, we used 3 datasets from another paper (RectEuler), but they turned out to be very sparsed and hard to demonstrate the SPEULER logic of the paper. Therefore, we created two new datasets that are more suitable for demonstrating the logic. They have a total of 4 and 5 sets, respectively, and at least 1 member per zone. We also created a dataset with meaningful sets and members from the movie Avengers, as well as recreated the dataset from the paper based on the diagram they provided. An example of the structure is shown below:

name,A,B,C,D
m1,1,0,1,0
m2,0,1,1,0
m3,1,1,0,0

Datasets are stored in data/ and loaded by the Flask backend.

How the program works

Interactivity

The program is built with Flask (backend) and D3.js (frontend). Users can select datasets from a dropdown menu, and the diagram updates automatically. The users can also choose from a checklist which steps they would like to inspect.

Dataset and step selection dropdowns

Step 1 — Zone construction

Each member induces a set-combination signature (e.g., A|C, B|C|D). Members with identical signatures are grouped into one zone. The zone’s rank is the number of sets in its signature.

Step 1 screenshot: abstract description (zones)

Step 2 — Ring layout

Zones are placed on concentric rings by rank: rank 1 (single sets) on the outer ring, rank 2 on the next ring, etc. Angles are assigned to place a zone “between” its parent zones (immediate subsets), using circular averaging so that, for example, A|B is placed between A and B.

Step 2 screenshot: ring layout

Step 3 — Super-dual adjacency graph

A super-dual graph is built between zones that differ by exactly one set. An edge connects Z and Z U {S} and is annotated with the set S that was added. (Optionally, long edges can be filtered to reduce clutter.)

Step 3 screenshot: super-dual graph

Step 4 — Set boundary curves

For each set S, a closed curve is constructed from a collection of boundary evidence points:

The points are ordered (per set) around their centroid and connected with a closed spline to form the set boundary. Member labels are then placed inside their corresponding zone regions while avoiding overlaps and staying strictly within the region. If not all member names can be placed, a summary label is shown inside the zone (e.g., Name +N).

Step 4 screenshot: final set curves

How to run locally

cd bin
./run_local.sh   # macOS/Linux
run_local.bat    # Windows

Open:

http://127.0.0.1:5001/