flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
184 stars 21 forks source link

One to Many Connections #172

Open OreFoX18 opened 3 months ago

OreFoX18 commented 3 months ago

Dear Fritz,

Thank you for your swift assistance with a previous issue regarding connecting points! Your guidance has been immensely helpful, and I truly appreciate your support.

I successfully implemented your suggestions into my dataset, and now the connections between points are visible. However, I've encountered a slight deviation from my intended outcome.

Shortly, in my dataset I've got around 42000 points which were ordered in clusters. Each cluster has one cluster representative and several or more cluster members. All the points are nicely positioned in 2D space using an algorithm. However, I have a particular requirement: I need to display connections exclusively between cluster members and their corresponding cluster representatives, omitting connections between cluster members themselves. I'm aware that one could specify the 6th value to change the order of how points are connected, but would that be helpful in my case where I want more connection lines to stem from one central point (cluster representative)?

For example: There are 10 points in one cluster (1 clust_rep + 9 clust_memb). The connections would be 1 -> 2, 1 -> 3, 1 -> 4, 1 ->5 etc.

I greatly value your expertise and look forward to your further insights.

Warm regards,

Haris

flekschas commented 3 months ago

That's unfortunately not supported out of the box. But since you only have 42K points, there's a workaround that should visually look identical: for each cluster member to cluster representative connection, duplication the representative point. Then for each member_i <> repr_i pair, choose a unique ID as the 5th element. This isn't elegant but at least it should work :)

See this notebook for a quick demo: https://observablehq.com/d/4cefcd24ce20e954

OreFoX18 commented 3 months ago

Thank you a lot for that idea. I will try it out! :D

Greetings, Haris

flekschas commented 2 months ago

FYI, I think I have a proper solution for one to many point connections. But I can't say when the feature will land as my time to work on this is a bit limited at the moment.