diff --git a/browser/src/StructuralVariantPage/__snapshots__/StructuralVariantPage.spec.tsx.snap b/browser/src/StructuralVariantPage/__snapshots__/StructuralVariantPage.spec.tsx.snap index b94a02f50..faf72b64a 100644 --- a/browser/src/StructuralVariantPage/__snapshots__/StructuralVariantPage.spec.tsx.snap +++ b/browser/src/StructuralVariantPage/__snapshots__/StructuralVariantPage.spec.tsx.snap @@ -403,7 +403,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with a complex varian Genetic Ancestry Group Frequencies @@ -499,7 +499,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with a complex varian
@@ -1108,7 +1108,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with interchromosomal
@@ -1717,7 +1717,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with interchromosomal
@@ -2308,7 +2308,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with non-interchromos
@@ -2899,7 +2899,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with non-interchromos
@@ -3488,7 +3488,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with non-interchromos
@@ -4079,7 +4079,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with non-interchromos
@@ -4652,7 +4652,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1 with non-interchromos
@@ -5848,7 +5848,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with a compl
@@ -6457,7 +6457,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with interch
@@ -7066,7 +7066,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with interch
@@ -7657,7 +7657,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with non-int
@@ -8248,7 +8248,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with non-int
@@ -8837,7 +8837,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with non-int
@@ -9428,7 +9428,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with non-int
@@ -10001,7 +10001,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_controls with non-int
@@ -11197,7 +11197,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with a comp
@@ -11806,7 +11806,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with interc
@@ -12415,7 +12415,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with interc
@@ -13006,7 +13006,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with non-in
@@ -13597,7 +13597,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with non-in
@@ -14186,7 +14186,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with non-in
@@ -14777,7 +14777,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with non-in
@@ -15350,7 +15350,7 @@ exports[`StructuralVariantPage with dataset gnomad_sv_r2_1_non_neuro with non-in
{ return af.toPrecision(4) } -type OwnPopulationsTableProps = { - columnLabels?: { - ac?: string - an?: string - af?: string - } - populations: { +type Population = { + id: string + name: string + ac: number + an: number + ac_hemi?: number + ac_hom?: number + subpopulations?: { name: string ac: number an: number ac_hemi?: number ac_hom?: number - subpopulations?: { - name: string - ac: number - an: number - ac_hemi?: number - ac_hom?: number - }[] }[] +} + +type PopulationsTableProps = { + columnLabels?: { + ac?: string + an?: string + af?: string + } + populations: Population[] showHemizygotes?: boolean showHomozygotes?: boolean initiallyExpandRows?: boolean @@ -93,8 +106,6 @@ type OwnPopulationsTableProps = { type PopulationsTableState = any -type PopulationsTableProps = OwnPopulationsTableProps & typeof PopulationsTable.defaultProps - export class PopulationsTable extends Component { static defaultProps = { columnLabels: {}, @@ -258,6 +269,23 @@ export class PopulationsTable extends Component { + // First item gets a strong border to make header stand out + if (i === 0) { + return 'strong-border' + } + + const isPreviousRowSexSpecific = i > 0 && isSexSpecificPopulation(pops[i - 1]) + const isCurrentRowSexSpecific = isSexSpecificPopulation(pop) + + // Don't render border in between total XX/XY rows + if (isPreviousRowSexSpecific && isCurrentRowSexSpecific) { + return undefined + } + + return 'border' + } + return ( @@ -269,7 +297,7 @@ export class PopulationsTable extends Component {renderedPopulations.map((pop, i) => ( - - 0 && - isSexSpecificPopulation(pop) && - !isSexSpecificPopulation(renderedPopulations[i - 1]) - ? 'border' - : undefined - } - > + + {this.renderPopulationRowHeader(pop)} {expandedPopulations[pop.name] && } @@ -339,7 +359,7 @@ export class PopulationsTable extends Component @@ -355,10 +375,10 @@ export class PopulationsTable extends Component{renderPopAF(subPop.af)} ))} - + ))} - + diff --git a/browser/src/VariantPage/__snapshots__/GnomadPopulationsTable.spec.tsx.snap b/browser/src/VariantPage/__snapshots__/GnomadPopulationsTable.spec.tsx.snap index 64e7c406f..e06a561cc 100644 --- a/browser/src/VariantPage/__snapshots__/GnomadPopulationsTable.spec.tsx.snap +++ b/browser/src/VariantPage/__snapshots__/GnomadPopulationsTable.spec.tsx.snap @@ -3,7 +3,7 @@ exports[`GnomadPopulationsTable with a dataset of exac has no unexpected changes 1`] = ` [
Overall{pop.ac}
Total
@@ -97,10 +97,10 @@ exports[`GnomadPopulationsTable with a dataset of exac has no unexpected changes - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -425,9 +423,7 @@ exports[`GnomadPopulationsTable with a dataset of exac has no unexpected changes - + @@ -632,17 +628,17 @@ exports[`GnomadPopulationsTable with a dataset of exac has no unexpected changes - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -1103,10 +1099,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_cnv_r4 has no unexpecte - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -1560,9 +1554,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_cnv_r4 has no unexpecte - + @@ -1767,10 +1759,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_cnv_r4 has no unexpecte - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -2224,9 +2214,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_cnv_r4 has no unexpecte - + @@ -2431,10 +2419,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1 has no unexpected - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -2808,9 +2794,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1 has no unexpected - + @@ -3018,17 +3002,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1 has no unexpected - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + @@ -3532,10 +3516,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_controls has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -3909,9 +3891,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_controls has no un - + @@ -4119,17 +4099,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_controls has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -4633,10 +4613,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_cancer has no - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -5010,9 +4988,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_cancer has no - + @@ -5220,17 +5196,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_cancer has no - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -5734,10 +5710,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_neuro has no u - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -6111,9 +6085,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_neuro has no u - + @@ -6321,17 +6293,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_neuro has no u - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -6835,10 +6807,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_topmed has no - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -7212,9 +7182,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_topmed has no - + @@ -7422,17 +7390,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r2_1_non_topmed has no - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -7936,10 +7904,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3 has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -8399,9 +8365,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3 has no unexpected ch - + @@ -8606,17 +8570,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3 has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -9206,10 +9170,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_controls_and_biobank - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -9669,9 +9631,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_controls_and_biobank - + @@ -9876,17 +9836,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_controls_and_biobank - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -10476,10 +10436,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_cancer has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -10939,9 +10897,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_cancer has no un - + @@ -11146,17 +11102,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_cancer has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -11746,10 +11702,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_neuro has no une - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -12209,9 +12163,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_neuro has no une - + @@ -12416,17 +12368,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_neuro has no une - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -13016,10 +12968,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_topmed has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -13479,9 +13429,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_topmed has no un - + @@ -13686,17 +13634,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_topmed has no un - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -14286,10 +14234,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_v2 has no unexpe - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -14749,9 +14695,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_v2 has no unexpe - + @@ -14956,17 +14900,17 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r3_non_v2 has no unexpe - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -15556,10 +15500,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4 has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -16013,9 +15955,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4 has no unexpected ch - + @@ -16220,10 +16160,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4 has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + @@ -16677,9 +16615,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4 has no unexpected ch - + @@ -16884,10 +16820,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4_non_ukb has no unexp - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -17341,9 +17275,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4_non_ukb has no unexp - + @@ -17548,10 +17480,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4_non_ukb has no unexp - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -18005,9 +17935,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_r4_non_ukb has no unexp - + @@ -18212,10 +18140,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1 has no unexpect - - + + - + @@ -18458,7 +18384,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1 has no unexpect @@ -18626,10 +18552,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1_controls has no - - + + - + @@ -18872,7 +18796,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1_controls has no @@ -19040,10 +18964,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1_non_neuro has n - - + + - + @@ -19286,7 +19208,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r2_1_non_neuro has n @@ -19454,10 +19376,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r4 has no unexpected - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -19911,9 +19831,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r4 has no unexpected - + @@ -20118,10 +20036,10 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r4 has no unexpected - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + @@ -20575,9 +20491,7 @@ exports[`GnomadPopulationsTable with a dataset of gnomad_sv_r4 has no unexpected - +
+
@@ -79,17 +79,17 @@ exports[`local ancestry populations table has no unexpected changes 1`] = ` - - + + - - + +
European @@ -170,17 +170,17 @@ exports[`local ancestry populations table has no unexpected changes 1`] = `
European @@ -287,7 +287,7 @@ exports[`local ancestry populations table has no unexpected changes 1`] = `
@@ -898,17 +898,17 @@ exports[`VariantPage with the dataset "gnomad_r3" has no unexpected changes 1`] - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -10838,17 +10838,17 @@ exports[`VariantPage with the dataset "gnomad_r3_controls_and_biobanks" has no u - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -20781,17 +20781,17 @@ exports[`VariantPage with the dataset "gnomad_r3_non_cancer" has no unexpected c - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -30724,17 +30724,17 @@ exports[`VariantPage with the dataset "gnomad_r3_non_neuro" has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -40667,17 +40667,17 @@ exports[`VariantPage with the dataset "gnomad_r3_non_topmed" has no unexpected c - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -50610,17 +50610,17 @@ exports[`VariantPage with the dataset "gnomad_r3_non_v2" has no unexpected chang - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -60381,17 +60381,17 @@ exports[`VariantPage with the dataset exac has no unexpected changes 1`] = ` - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -68352,17 +68352,17 @@ exports[`VariantPage with the dataset gnomad_r2_1 has no unexpected changes 1`] - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -78416,17 +78416,17 @@ exports[`VariantPage with the dataset gnomad_r2_1_controls has no unexpected cha - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -88480,17 +88480,17 @@ exports[`VariantPage with the dataset gnomad_r2_1_non_cancer has no unexpected c - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -98544,17 +98544,17 @@ exports[`VariantPage with the dataset gnomad_r2_1_non_neuro has no unexpected ch - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -108608,17 +108608,17 @@ exports[`VariantPage with the dataset gnomad_r2_1_non_topmed has no unexpected c - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +