TutteInstitute / datamapplot

Creating beautiful plots of data maps
MIT License
664 stars 41 forks source link

Unexpected text label behaviour when using search (points get filtered, labels do not) #38

Open iblind opened 1 month ago

iblind commented 1 month ago

I was using the search functionality to filter out points in the plot, but realized that while the points were being filtered, the labels for the clusters were not. Here is an example:

image

The expected baseline behaviour, to me, would be for these to be filtered out as well. I've fixed this locally in the HTML once the plot has been generated, but if this sort of functionality is desirable, I can take a stab at a branch and submitting a pull request.

Regardless, thanks for the amazing work on the library so far, it's been tremendously helpful in my work!

lmcinnes commented 1 month ago

Filtering the labels was not the expected default in that retaining them can be useful for providing some reference for where in the space you are looking. I can see the value in filtering them though, and I would definitely be very receptive if you wanted to look at making that an option that could be enabled.

On that front I have been doing quite a bit of work refactoring selection handling (and other things) lately, so if you were interested in implementing such functionality I would suggest holding off for a week or two until I can get the refactored changes merged into main.

iblind commented 1 month ago

Perf, I'll keep an eye out for the new release and will aim to jump in afterwards.

lmcinnes commented 2 weeks ago

The big update is done so you are welcome to have a crack at optionally having labels show dependent on selection...