training_extensions icon indicating copy to clipboard operation
training_extensions copied to clipboard

Add functionality to download training metrics graphs

Open andersendsa opened this issue 5 months ago • 1 comments

Summary

  • Implemented a "Download" button in the MetricGraph component to let users export training metrics graphs as PNG images.
  • Extracted SVG elements natively, drew them on a canvas, and triggered a PNG download directly, without introducing extra dependencies.

Closes: #5656

How to test

  1. Open the application UI and navigate to your project.
  2. Click on the Models tab in the main navigation menu.
  3. Select a trained model from the list to open the Model Details view.
  4. Click on the Training Metrics tab inside the details panel.
  5. You should see one or more line graphs (e.g., Training Loss, Validation Accuracy, etc.).
  6. Look at the top-right corner of any graph's container box. You should now see a new Download icon button.
  7. Click the Download button.
  8. Verify Download: A .png file (named based on the graph's title, e.g., training_loss_metrics.png) should be downloaded to your local machine.
  9. Verify Image Quality: Open the downloaded image file. Confirm that the graph is fully visible with a solid white background, and that all data lines, axes, and labels rendered correctly exactly as they appeared in the UI.

Checklist

  • [x] The PR title and description are clear and descriptive
  • [x] I have manually tested the changes
  • [x] All changes are covered by automated tests
  • [x] All related issues are linked to this PR (if applicable)
  • [ ] Documentation has been updated (if applicable)

andersendsa avatar Jun 25 '26 13:06 andersendsa

Hi @dwesolow, @jpggvilaca, @A-Artemis pls let me know if this pr needs any changes or if it is good to merge

andersendsa avatar Jun 25 '26 13:06 andersendsa

Hi @leoll2 could you pls trigger the checks again ?

andersendsa avatar Jul 29 '26 11:07 andersendsa

@andersendsa I tested the feature locally and there are evident problems with the generated image (missing data, poor formatting, ...). However, you say that you tested it and that everything is rendered correctly. Could you maybe share a screenshot of how the graphs look in your environment?

leoll2 avatar Jul 29 '26 12:07 leoll2

@andersendsa I tested the feature locally and there are evident problems with the generated image (missing data, poor formatting, ...). However, you say that you tested it and that everything is rendered correctly. Could you maybe share a screenshot of how the graphs look in your environment?

Hi @leoll2 sorry for the late reply I was busy in my university examinations I hadnt pushed the commit sorry for that here is the graph I am getting image

andersendsa avatar Aug 03 '26 16:08 andersendsa

Thanks for applying the fixes. To be honest, I'm a bit hesitant to accept the feature in its current state. While downloading graphs is certainly useful for researchers, the graphs themselves look a bit rough:

  • The units of measurement are absent.
  • Axis intervals are not aligned with the data points; they mark for example values like "2.8 epochs" which have no physical meaning.
  • Decimal precision is inconsistent
  • Text overlaps

Data visualization isn't just a matter of style, it is about presenting information in a digestible and credible way. If you are willing to improve the graphs in the aspects that I mentioned above, then I would be happy to eventually merge the PR, at the moment it's not "production-ready" yet.

leoll2 avatar Aug 03 '26 17:08 leoll2

Thanks for applying the fixes. To be honest, I'm a bit hesitant to accept the feature in its current state. While downloading graphs is certainly useful for researchers, the graphs themselves look a bit rough:

  • The units of measurement are absent.
  • Axis intervals are not aligned with the data points; they mark for example values like "2.8 epochs" which have no physical meaning.
  • Decimal precision is inconsistent
  • Text overlaps

Data visualization isn't just a matter of style, it is about presenting information in a digestible and credible way. If you are willing to improve the graphs in the aspects that I mentioned above, then I would be happy to eventually merge the PR, at the moment it's not "production-ready" yet.

Thank you for the feedback. I’d love to continue working on this PR and keep receiving reviews.

andersendsa avatar Aug 03 '26 17:08 andersendsa

@leoll2 pls let me know if any more changes are required image

andersendsa avatar Aug 05 '26 13:08 andersendsa

Thanks for the improvements, the feature now works as expected 😃

leoll2 avatar Aug 17 '26 07:08 leoll2

@andersendsa A few Eslint checks are failing and blocking this PR, would you check them?

https://github.com/open-edge-platform/geti/actions/runs/31010971233/job/95329949541?pr=6917

leoll2 avatar Aug 25 '26 12:08 leoll2

@andersendsa A few Eslint checks are failing and blocking this PR, would you check them?

https://github.com/open-edge-platform/geti/actions/runs/31010971233/job/95329949541?pr=6917

Hi @leoll2 I have fixed the failing checks could you pls trigger the checks ?

andersendsa avatar Aug 26 '26 07:08 andersendsa