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

Add svg and png export to trackscheme panels #306

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

stefanhahmann
Copy link
Collaborator

@stefanhahmann stefanhahmann commented May 23, 2024

I recently added the functionality to export the content of the lineage classification dendrogram to SVG/PNG files, cf.: https://github.com/mastodon-sc/mastodon-deep-lineage/releases/tag/mastodon-deep-lineage-0.2.0

After this was released, I was asked by a user, if this could be added as a functionality to the track scheme windows as well.

This PR adds exactly this functionality to all TrackScheme Panels and the BDV Panel. It also adds a generic ExportUtils class that can be re-used in all plugin projects to achieve similar behavior in different components.

* Convenience method to retrieve the first spot of a branch spot
* getTagSetNames, which return the names of the tag sets in the model
* getTagValue(), which returns the value of a branchSpot within a specified tag set
* unit tests for the 2 new methods are contained
…getFirstSpot() methods

Previously the methods created refs that the caller could not release
@tinevez
Copy link
Contributor

tinevez commented May 24, 2024

This is great! And it looks much simpler that the batik export in TrackMate's TrackScheme.

If possible I would like to keep the right-click button for interactions with the data on the panel, as in the other views. Could you put the command in the JMenu?

@stefanhahmann
Copy link
Collaborator Author

stefanhahmann commented May 24, 2024

This is great! And it looks much simpler that the batik export in TrackMate's TrackScheme.

Please do not overestimate the capabilities of this. This function only paints the contents of the current view to the SVG/PNG file, i.e. it will not be complete, if the trackscheme as seen on the screen is not completely inside the window.

Thus, it would be more honest, if the entry would say "Export current TrackScheme view to SVG/PNG".

Would you still like to have it?

It may nevertheless be useful for some use cases.

If possible I would like to keep the right-click button for interactions with the data on the panel, as in the other views. Could you put the command in the JMenu?

I was also thinking about this. I decided for the right click, since this would offer the highest re-usability with the lineage classification dialog, where I also have it on the right click. However, putting it in the menu should not be too much effort. Would you see it in the File, Window or View menu?

@tinevez
Copy link
Contributor

tinevez commented May 24, 2024

Please do not overestimate the capabilities of this. This function only paints the contents of the current view to the SVG/PNG file, i.e. it will not be complete, if the trackscheme as seen on the screen is not completely inside the window.>
Thus, it would be more honest, if the entry would say "Export current TrackScheme view to SVG/PNG".
Would you still like to have it?

Yes.
What about Export current view to SVG/PNG ?

I was also thinking about this. I decided for the right click, since this would offer the highest re-usability with the lineage classification dialog, where I also have it on the right click. However, putting it in the menu should not be too much effort. Would you see it in the File, Window or View menu?

I would say File, after a separator.

@stefanhahmann stefanhahmann force-pushed the add_svg_png_export_to_trackschemepanels branch from b45d180 to 7cb9feb Compare May 24, 2024 15:58
@stefanhahmann
Copy link
Collaborator Author

Yes. What about Export current view to SVG/PNG ?

Agreed.

I would say File, after a separator.

It's now in the File menu of the TrackSchemePanels and the BDV View.

@tinevez
Copy link
Contributor

tinevez commented May 24, 2024

Maybe there is a way to add it to all views automatically. Can I have a go at it?

@stefanhahmann
Copy link
Collaborator Author

Maybe there is a way to add it to all views automatically. Can I have a go at it?

Yes, sure.

I was not sure, if it makes sense to have it in all views (e.g. table view?) and if it works well in all views (e.g. grapher -> svg might be problematic). Otherwise, I would have tried as well.

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

Successfully merging this pull request may close these issues.

None yet

2 participants