Skip to content

Commit

Permalink
update data sources for run header metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey800 committed Nov 4, 2023
1 parent e9d1ee0 commit 84c458d
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions frontend/packages/data-portal/app/components/Run/RunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export function RunHeader() {
const { run } = useRunById()
const drawer = useDrawer()

const tiltSeries = run.tiltseries[0]

return (
<PageHeader
actions={
Expand Down Expand Up @@ -40,6 +42,7 @@ export function RunHeader() {
backToResultsLabel={run.dataset.title}
lastModifiedDate="2023-12-16"
metadata={[
// TODO fetch frames from API
{ key: i18n.frames, value: i18n.nFiles(0) },

{
Expand Down Expand Up @@ -84,15 +87,24 @@ export function RunHeader() {
data={[
{
label: i18n.tiltQuality,
values: ['20'],
values:
typeof tiltSeries.tilt_series_quality === 'number'
? [String(tiltSeries.tilt_series_quality)]
: [],
},
{
label: i18n.tiltRange,
values: ['-40 to 58'],
values:
typeof tiltSeries.tilt_min === 'number' &&
typeof tiltSeries.tilt_max === 'number'
? [String(tiltSeries.tilt_series_quality)]
: [],
},
{
label: i18n.tiltScheme,
values: ['Starting tilt to min then max'],
values: tiltSeries.tilting_scheme
? [tiltSeries.tilting_scheme]
: [],
},
]}
/>
Expand All @@ -105,12 +117,17 @@ export function RunHeader() {
values: ['10.00Å, 13.70Å'],
},
{
label: i18n.tiltRange,
values: ['-40 to 58'],
label: i18n.tomogramProcessing,
values: run.tomogram_stats
.flatMap((stats) => stats.tomograms)
.map((tomogram) => tomogram.processing),
},
{
label: i18n.tiltScheme,
values: ['Starting tilt to min then max'],
label: i18n.annotatedObjects,
inline: true,
values: run.annotation_stats
.flatMap((stats) => stats.annotations)
.map((annotation) => annotation.object_name),
},
]}
/>
Expand Down

0 comments on commit 84c458d

Please sign in to comment.