Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-4081

Update SVG libraries used by IGB to export images

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Situation: We've recently had several requests to export images in IGB as SVGs. While IGB does have the ability to export images as SVG, the libraries used are quite old and there are some weird artifacts that show up in the SVG images (see IGBF-2649).

      Task: Update the libraries used for SVG image export in IGB. This may require stripping out the current SVG library usage and using a newer one (something like this: https://github.com/jfree/jfreesvg).

        Attachments

        1. new_barbWire.png
          new_barbWire.png
          124 kB
        2. new.png
          new.png
          178 kB
        3. old_BarbWire.png
          old_BarbWire.png
          125 kB
        4. old.png
          old.png
          180 kB
        5. PranavTest.svg
          1.54 MB

          Issue Links

            Activity

            Hide
            pbhatia1 Pranav Bhatia added a comment - - edited

            Replaced the freehep library to jfree.

            Attached is a screenshot of an SVG output using the newly integrated library.

            PranavTest.svg

            Link to branch - https://bitbucket.org/pranavbhatia1999/integrated-genome-browser/branch/IGBF-3971

            Please review.

            Show
            pbhatia1 Pranav Bhatia added a comment - - edited Replaced the freehep library to jfree. Attached is a screenshot of an SVG output using the newly integrated library. PranavTest.svg Link to branch - https://bitbucket.org/pranavbhatia1999/integrated-genome-browser/branch/IGBF-3971 Please review.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Tested Pranav's branch on Mac.

            Exported main view, main view with labels, whole frame, and sliced view images from Pranav's branch and IGB 10.1.0. I compared the images using inkscape. On Pranav's branch the images look much better as there are no longer overlapping parts.

            For example, here is the old version of IGB:

            Here is the new version:

            I would like to see a couple of changes in the commit before it is ready for a PR:

            • Set your IDE to not fix whitespace issues in files you are editing.
              • I recommend creating a new branch off of main (name it IGBF-4081) and reimplement your changes as this will be easier than trying to fix the whitespaces.
            • Use the jfreesvg artifact for Java 11 and higher: <artifactId>org.jfree.svg</artifactId>
            • You should not need to add javax.xml.bind. We are using jakarta.xml.bind. See stackoverflow for more info.
            • Replace all imports of freehep with jfreesvg. If everything is working, commit, then see if you can identify if any of the imports of jfreesvg can be removed.
            • Remove unneeded freehep lines of code instead of commenting them out.
            Show
            nfreese Nowlan Freese added a comment - - edited Tested Pranav's branch on Mac. Exported main view, main view with labels, whole frame, and sliced view images from Pranav's branch and IGB 10.1.0. I compared the images using inkscape. On Pranav's branch the images look much better as there are no longer overlapping parts. For example, here is the old version of IGB: Here is the new version: I would like to see a couple of changes in the commit before it is ready for a PR: Set your IDE to not fix whitespace issues in files you are editing. I recommend creating a new branch off of main (name it IGBF-4081 ) and reimplement your changes as this will be easier than trying to fix the whitespaces. Use the jfreesvg artifact for Java 11 and higher: <artifactId>org.jfree.svg</artifactId> See the jfreesvg github for more info: https://github.com/jfree/jfreesvg MVN repository for jfreesvg: https://mvnrepository.com/artifact/org.jfree/org.jfree.svg You should not need to add javax.xml.bind. We are using jakarta.xml.bind. See stackoverflow for more info. Replace all imports of freehep with jfreesvg. If everything is working, commit, then see if you can identify if any of the imports of jfreesvg can be removed. Remove unneeded freehep lines of code instead of commenting them out.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Note from Paige on tickets we may be able to close after testing with the new SVG library:

            IGBF-1106 - Make sure saved SVG files can be opened in popular image editing tools (e.g., Adobe Illustrator) on Mac
            IGBF-2649 - This can be completed once Pranav’s ticket is closed.
            DB-84 - “”
            IGBD-437 - “”

            Show
            nfreese Nowlan Freese added a comment - - edited Note from Paige on tickets we may be able to close after testing with the new SVG library: IGBF-1106 - Make sure saved SVG files can be opened in popular image editing tools (e.g., Adobe Illustrator) on Mac IGBF-2649 - This can be completed once Pranav’s ticket is closed. DB-84 - “” IGBD-437 - “”
            Hide
            pbhatia1 Pranav Bhatia added a comment - - edited

            Worked on the suggested improvements.

            Link to branch - https://bitbucket.org/pranavbhatia1999/integrated-genome-browser/branch/IGBF-4081

            Show
            pbhatia1 Pranav Bhatia added a comment - - edited Worked on the suggested improvements. Link to branch - https://bitbucket.org/pranavbhatia1999/integrated-genome-browser/branch/IGBF-4081
            Show
            pbhatia1 Pranav Bhatia added a comment - PR: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/1060
            Hide
            nfreese Nowlan Freese added a comment -

            Tested on Mac and Windows using the main branch installer. SVG files look good on both systems.

            Closing ticket.

            Show
            nfreese Nowlan Freese added a comment - Tested on Mac and Windows using the main branch installer. SVG files look good on both systems. Closing ticket.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Note that there are some visual differences between the old SVG library and the new SVG library. For example, the "barb wire" in IGB does not always appear correctly with the new SVG library, though I do not see this as an issue.
            Old:

            New:

            Show
            nfreese Nowlan Freese added a comment - - edited Note that there are some visual differences between the old SVG library and the new SVG library. For example, the "barb wire" in IGB does not always appear correctly with the new SVG library, though I do not see this as an issue. Old: New:

              People

              • Assignee:
                pbhatia1 Pranav Bhatia
                Reporter:
                nfreese Nowlan Freese
              • Votes:
                0 Vote for this issue
                Watchers:
                Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: