Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no way to unselect a point in the visualization plot #389

Open
bernstei opened this issue Nov 6, 2024 · 20 comments
Open

no way to unselect a point in the visualization plot #389

bernstei opened this issue Nov 6, 2024 · 20 comments

Comments

@bernstei
Copy link
Collaborator

bernstei commented Nov 6, 2024

If I want the projection plot to not have any points with a large red symbol, there's no way that I can find to go back to the state where no points are selected for viewing in the structure plot. If there is a way to reset, it should be made more obvious.

@ceriottm
Copy link
Contributor

ceriottm commented Nov 6, 2024

this is not supported, as there always is a selected structure.
if you need this to make a figure, when you save a figure in 2D it seems to be saving only the main trace, so you don't have the red dot. however in 3D it does save all traces, maybe this is something that can at least be made homogeneous.

@bernstei
Copy link
Collaborator Author

bernstei commented Nov 8, 2024

Is there a way to save in 2D given that I want a particular orientation in the 3D space that I'm viewing and selecting interactively, when the clusters line up just right? It's not necessarily in the plane of 2 of the PCA vectors.

@bernstei
Copy link
Collaborator Author

bernstei commented Nov 8, 2024

BTW, I think that sometimes you probably want the red dot (i.e.g if you're planning to show the map alongside the structure it corresponds to), and sometimes you don't (if you're not planning to show any structures, just the clustering).

@Luthaf
Copy link
Contributor

Luthaf commented Nov 11, 2024

When using chemiscope in jupyter with chemiscope.show, you can use mode="map" to only show the map/clustering. It has all the same options.

We could try to provide this (and mode="structure") as well on the website, we would mainly have to find a way to show this choice to the user.


Creating a new 2D projection from 3D data + camera orientation sounds like an interesting idea, but will require some work. A first step could be #74, allowing to save the camera orientation & reload it on the next view of the same dataset.

@Luthaf Luthaf pinned this issue Nov 11, 2024
@bernstei
Copy link
Collaborator Author

Let me see if I can get anywhere with the jupyter interface.

@bernstei
Copy link
Collaborator Author

I got it sort of working, but I don't understand the relationship between the ts files in the cloned repo and the python interface, which I'm gettin from pip. Should I expect recent changes, e.g. the tab10 palette, to be available in the python (jupyter) interface? Or would that require a new pypi release (and if so, any idea when that might happen)?

@Luthaf
Copy link
Contributor

Luthaf commented Nov 12, 2024

PyPI Releases correspond to tags on this repo, so tab10 it is not yet available there. I'll do a new release tomorrow to include it.

@bernstei
Copy link
Collaborator Author

chemiscope.show(..., mode="map") also picks one map point to be a large red dot, despite having no structure that it can correspond to.

Image

@ceriottm
Copy link
Contributor

chemiscope.show(..., mode="map") also picks one map point to be a large red dot, despite having no structure that it can correspond to.

Yeah, this is actually the intended behavior as you can select points and look at their properties in the info panel.
MAYBE we should hide the point when outputting a snapshot of the figure, as one would probably want to edit this further externally.

Overall, I think that all the stuff you're trying to do would be much better suited to be implemented in the jupyter interface (which is something we've been wanting to develop further anyway) rather than adding a bazillion options to the modals in the web version.

ATM my priority would be to address #388 which is a clear (and somewhat puzzling) bug. As soon as #386 is merged and I've a minute I'll try to look at that - although of course you're more than welcome to have a go at it yourself: given we now have some 21 symbols in the 3D interface, I would aim to have the same set of symbols as in 2D - either by adding even more, or by restricting the symbols in 2D, and make sure the legend works as it should.

@bernstei
Copy link
Collaborator Author

I have the jupyter interface working, so I'd be perfectly happy if these changes were only easily accessible that way. I'll see what, if anything, I can do for any of these open issues.

@Luthaf
Copy link
Contributor

Luthaf commented Nov 13, 2024

PyPI Releases correspond to tags on this repo, so tab10 it is not yet available there. I'll do a new release tomorrow to include it.

0.8.3 has been released on PyPI, it should contain the new palettes!

@bernstei
Copy link
Collaborator Author

bernstei commented Nov 13, 2024

I just updated, chemiscope.__version__ is showing 0.8.3, but I'm getting the same message from the jupyter interface. Any idea what I should investigate? Also, the error message is confusing - I thought the "palette" key in the dict is supposed to be a palette name, not a property.

Image

@Luthaf
Copy link
Contributor

Luthaf commented Nov 13, 2024

Did you restart juypter (not just the kernel)? It needs to load the new version of the chemiscope extension.

@bernstei
Copy link
Collaborator Author

I didn't, because I didn't realize the distinction between the imported chemiscope in the kernel vs. the extension that the server uses. Now it works, with the same legend symbol bug, but that's another story. Thanks for the quick update.

I still want to be able to unselect all the points (so there's no random arbitrary large red symbol) when exporting the bitmap (the original topic of this issue).

@Luthaf Luthaf unpinned this issue Nov 14, 2024
@bernstei
Copy link
Collaborator Author

Is there any chance you could suggest even a hacky workaround that'd remove the large red symbol for the selected environment when exporting to png? I'd like to use these outputs in a paper, just showing the clustering, and the red symbol is just confusing in that context.

@ceriottm
Copy link
Contributor

ceriottm commented Nov 19, 2024 via email

@bernstei
Copy link
Collaborator Author

bernstei commented Nov 19, 2024

Thanks @ceriottm - adding visible: 'legendonly' when creating the selected trace worked. I'd do a PR, but I'm guessing that sometimes people will want the selected marker shown, if they're also going to show the corresponding environment in the structure viewer, and I'm not sure how to add the UI to control that, so for now I'll just use it as a workaround when generating my figures.

@ceriottm
Copy link
Contributor

Thanks @ceriottm - adding visible: 'legendonly' when creating the selected trace worked. I'd do a PR, but I'm guessing that sometimes people will want the selected marker shown, if they're also going to show the corresponding environment in the structure viewer, and I'm not sure how to add the UI to control that, so for now I'll just use it as a workaround when generating my figures.

My personal viewpoint is that if you want to add snapshots of the structures, you'll do some manual editing anyway and then you can add the markers manually - then one can do a screenshot to use as reference, so IMO there is no need for an UI element, just as I wouldn't add a UI element to decide whether to output as vector or bitmap.

@bernstei
Copy link
Collaborator Author

bernstei commented Nov 19, 2024

In that case, do you want a PR? It really is just a single line.

[edited] correction - my workaround, which always turns off the selected marker, is 1 line. I'd have to understand the callback structure in the function that the "export to PNG" (and SVG) buttons trigger to figure out how to do it only while the exported image is being constructed. And so far that hasn't been obvious to me.

@ceriottm
Copy link
Contributor

In that case, do you want a PR? It really is just a single line.

[edited] correction - my workaround, which always turns off the selected marker, is 1 line. I'd have to understand the callback structure in the function that the "export to PNG" (and SVG) buttons trigger to figure out how to do it only while the exported image is being constructed. And so far that hasn't been obvious to me.

OK yeah I was hoping for an implementation that would only change the exported graphics, we definitely ALWAYS want the marker on in the interactive viewer (because of the info panel, also when showing only the map)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants