## How to create an “overlapping interest chart” with Javascript or Python

I’m trying to create a chart that looks more-or-less like this:

Doing this manually in Inkscape is… ok, but I’d like to put this into a git repo to allow others to add their interests and even add new people. I’m thinking that this needs to be defined as data and rendered with software. As my team and I are proficient in Python & Javascript, these are my go-to tools.

There’s a lot of information and even handy libraries online for creating venn diagrams, but in all the cases I’ve found so far, you’re operating on the circles and adjusting the sizes & overlap directly. Critical to this task is the ability to add those interests: `Dogs`, `Cats`, `Cars`, etc. and have the sizes of the circles change automatically to fit what’s inside.

Surely this is a thing already right? Can someone please point me in the right direction? I’m even happy to go with some online tool that will do the job. My primary need is to be able to specify this stuff as data.

## Lint checker for overlapping or conflicting patterns, especially when defining functions

In building a system like Mathics (or anything as large a Mathematica) there are lots of functions function definitions. I would like to sanity check or lint check the pattern in the function signatures to look for obvious mistakes.

I realize solving the general problem is intractable if maybe even uncomputable/undecidable. So I am just looking for common mistakes of the kind that are likely to be made.

One kind of mistake is if the same rule is given twice:

``````F(x_) = 1
F(y_) = 10
``````

Assume that the above assignments are available in a List of some sort. Of suppose instead of using `Set` directly this the Set is done indirectly in a magical `SetIfNotConflict` function. Here this would look like:

``````SetIfNotConflict(x_, 1)
SetIfNotConflict(y_, 10)
``````

For the above, I would expect a warning that these two rules match the same thing.

Consider another kind of situation:

``````F(x_Integer) = 10
F(x_) = "x"
``````

This is okay (in Mathics) because the first rule is more specific than the second one. If the rules were switched around though, this could be a problem because pattern matching would try the more generic rule and match that before matching the more specific rule.

I don’t know if this has something in Mathematica that corresponds. So if not, just skip that.

## info visualisation – Displaying overlapping user data reflecting the status of an inventory in a horizontal stacked bar chart

I have an app in which users can track items. The app will flag when there are issues with items:

Warnings (orange UI colour)

• Low stock
• Expiring this month

Problems (red UI colour)

Items may have both a warning and a problem (e.g. an item with low stock that is expired).

There is a simple summary chart to summarise their inventory to the user.

This summarises 15 items; 1 has only a problem, 3 have only a warning, and 2 have both. The rest have no issues. Here the items with both are shown with overlapping orange and red lines. I am concerned that it looks confusing to have a separate number for the combined section, even though the numbers all add to the total.

Another option is to simplify it and show any items that have a problem as red (including those that also have a warning), and then show in orange those that only have warnings.

I think this is simpler and easier to see at a glance, but does not convey the full information. This might be acceptable as problems (red) are likely to be of more interest to the user than warnings (orange).

I would be grateful for advice on which provides the best user experience, or ways in which either could be improved.

## info visualisation – Best way to display overlapping user data in a stacked bar chart

I have an app in which users can track items. The app will flag when there are issues with items:

Warnings (orange UI colour)

• Low stock
• Expiring this month

Problems (red UI colour)

Items may have both a warning and a problem (e.g. an item with low stock that is expired).

There is a simple summary chart to summarise their inventory to the user.

This summarises 15 items; 1 has only a problem, 3 have only a warning, and 2 have both. The rest have no issues. Here the items with both are shown with overlapping orange and red lines. I am concerned that it looks confusing to have a separate number for the combined section, even though the numbers all add to the total.

Another option is to simplify it and show any items that have a problem as red (including those that also have a warning), and then show in orange those that only have warnings.

I think this is simpler and easier to see at a glance, but does not convey the full information. This might be acceptable as problems (red) are likely to be of more interest to the user than warnings (orange).

I would be grateful for advice on which provides the best user experience.

## design – How to properly implement Rest Controllers to handle overlapping entities?

I have:

• A User entity.
• A Poll entity.

Relationship: User creates polls.

Use-case:
When an arbitrarily user is clicked his/her profile is loaded and shown.
The profile includes a list of polls created by the clicked user.

Which of the following api calls is the proper usage of such a use-case?

Between The Lines:
I currently have a UserController & a PollController.

PollController has:

• getPolls()
• createPoll()
• getPollById()

UserController has functions related to the user, handles api calls starting with /api/users/…

I am trying to figure out which controller should handle the request to get polls by a user.

## design patterns – Is it a good/bad practice to create overlapping types?

Here’s a simple example: an API returns a list of possible options with the following structure:

``````{
"familystatus": (
{
"Id": 1,
"Name": "single"
},
{
"Id": 2,
"Name": "married"
}
),
"gender": (
{
"Id": 1,
"Name": "male"
},
{
"Id": 2,
"Name": "female"
}
)
}
``````

Which translates to Typescript (as example) into something like:

``````export interface Table {
familyStatus: LookupSelection();
gender: LookupSelection();
}

export interface LookupSelection {
id: number;
name: string;
}
``````

When I want to display those options in a list, the separation of concern principle would force me to define a different type:

``````export interface SelectboxOption {
id: any;
name: string;
}
``````

So it happens to be that both server response and the client code overlap (so I can directly bind the server result into my client model), but it could as well be different (i.e. `SelectboxOption` had `label` and `code` instead of `id` and `name`.)

• Should I forcibly design my client-oriented model to overlap the server model? (Less code and adds “transparency” – but unclear and breaks common principles)
• Should I use in-class converters (make `SelectboxOption` a class with a constructor, for example)? (Fail-safe but not as clean as other options)
• Should I make a converter class? (Most explicit but feels redundant)

Either way I go, it feels like breaking a law.

Thanks!

## algorithms – Merging all adjacent and overlapping rectangles in a grid to bigger rectangles

I have a 𝑛×𝑚
rectangular grid of cells, and a set 𝑅 of rectangles within this grid. Each rectangle is a subset of the cells. (Alternatively, you can think of them as axis-aligned rectangles where each of the four corners has integer coordinates.) Some of these rectangles overlap and some of these rectangles are adjacent. I want to merge adjacent rectangles to bigger rectangles if possible and remove overlaps.

So my output set should have bigger non overlapping rectangles instead of small adjacent or overlapping rectangles. The number of rectangles in the output set should be minimized. The output set need not be a subset of input set.
Is there any approximate or exact algorithm for this problem.

## algorithms – Reconstruction of a target string from a large set of overlapping reads

Consider a short string r as a read from a string S if r is converted from a substring of S by at most k swaps at random locations, where a swap is an operation that switch two adjacent characters, i.e., string s_1s_2…s_i s_{i+1}…s_n is one swap away from the string s_1s_2…s_{i+1} s_{i}…s_n. Two reads are called overlapping if the substrings to which they are converted are overlapping. Given the input of k << |r|, devise an algorithm to reconstruct a target string S from a large set of overlapping reads of S.

## Is a point inside a graphics group composed of multiple Polygons and FilledCurves, not all overlapping?

I have many thousands of points, and I want to check if they are inside a GraphicsGroup that is composed of many Polygons and FilledCurves, similar to GeoWithin but without having to make tedious cloud inquiries.

I get RegionMember Errors and besides I suspect RegionMember is too smart to do a simple 2D numerical True/False test efficiently.

I’ve done this once many years ago by counting if a line from the point to infinity crossed all of the polygon segments an even or odd number of times, but would expect Mathematica to have an function already.