comic / grand-challenge.org

A platform for end-to-end development of machine learning solutions in biomedical imaging
https://grand-challenge.org
Apache License 2.0
167 stars 49 forks source link

Rework Component Interface Value representations #3364

Closed chrisvanrun closed 3 weeks ago

chrisvanrun commented 1 month ago

Currently, we have several slightly different not-so-nice, representations of component interface values (CIVs).

This PR contains a rework of these representations in the job detail pages for evaluation and algorithms. The ultimate goal is to extend its usage to the ArchiveItem detail page and ArchiveItem/DisplaySet list pages.

Current 'inline' view

New 'inline' view

Template tags

~Two template tags are introduced: civ and civ_inline. Each tag takes a component interface value as the only argument and renders an HTML representation of the CIV. The inline variant is meant for list-like representations where horizontal space is limited and relies on a modal—the regular one where there is plenty of horizontal space to render the CIV proper.~

A new template civ.html is introduced that accepts the arguments civ and display_inline. The display_inline is a switch that can be set to True and is meant for list-like representations where horizontal space is limited and relies on a modal—the regular one where there is plenty of horizontal space to render the CIV proper

Vega Lazy loading

In addition, this PR adds lazy loading for vega charts which is very much needed if viewing a list of CIVSets that output charts.

New Fixtures

CIVs are a crucial part of development now, and I think adding a bunch of test CIVs by hand is a lot of hassle. This, I think, plays a part in these representations flying under the radar. As such, this PR also introduces the scripts/component_interface_value_fixtures.py. This repeatable script creates an algorithm job that has an overabundance of different CIVs for quick development.

The screenshots are made based on this fixture.

chrisvanrun commented 4 weeks ago

A possibly important change I forgot to mention is the following:

CIVs' rendering on a detail page was selective: some types would show, but some would not. With this PR that changes and they are all shown. For instance, output images will have a download button. This did mean that the BOOL/STRING/FLOAT/INT(?) types used to be gathered in a single table:

long_format_old_render

Whereas they are now shown as individual items: Screenshot 2024-05-30 172449

IMHO this is fine as not many algorithms output multiple bool/strings.