diff --git a/end-to-end-test/remote/screenshots/reference/coadread_tcga_pub_with_column_gaps_inserted_based_on_clinical_track_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/coadread_tcga_pub_with_column_gaps_inserted_based_on_clinical_track_element_chrome_1600x1000.png new file mode 100644 index 00000000000..79765d8fc49 Binary files /dev/null and b/end-to-end-test/remote/screenshots/reference/coadread_tcga_pub_with_column_gaps_inserted_based_on_clinical_track_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_driver_vs_vus_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_driver_vs_vus_element_chrome_1600x1000.png index 85467f2ca15..2f1120d7250 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_driver_vs_vus_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_driver_vs_vus_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_mutation_type_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_mutation_type_element_chrome_1600x1000.png index 0a41c6837bd..3794d63d6b8 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_mutation_type_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_dont_color_by_mutation_type_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_hide_vus_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_hide_vus_element_chrome_1600x1000.png index db09640ef1b..438ced0ecf5 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_hide_vus_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_hide_vus_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_gene_order,_then_set_sample_order_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_gene_order,_then_set_sample_order_element_chrome_1600x1000.png index 9e2c37f5ef3..46545d803d6 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_gene_order,_then_set_sample_order_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_gene_order,_then_set_sample_order_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_sample_order,_then_set_gene_order_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_sample_order,_then_set_gene_order_element_chrome_1600x1000.png index 6be92a68320..03f3de95438 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_sample_order,_then_set_gene_order_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_start_by_set_sample_order,_then_set_gene_order_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_including_all_genes_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_including_all_genes_element_chrome_1600x1000.png index 91059c4b8af..37c6665fda2 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_including_all_genes_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_including_all_genes_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_not_including_all_genes_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_not_including_all_genes_element_chrome_1600x1000.png index 36729f928dc..6040a8d6070 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_not_including_all_genes_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_gene_order,_not_including_all_genes_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_sample_order,_including_all_samples_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_sample_order,_including_all_samples_element_chrome_1600x1000.png index efecc211abe..893a23bb972 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_sample_order,_including_all_samples_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data,_then_set_sample_order,_including_all_samples_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data_element_chrome_1600x1000.png b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data_element_chrome_1600x1000.png index 7687b2d7784..bf7112b5ca9 100644 Binary files a/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data_element_chrome_1600x1000.png and b/end-to-end-test/remote/screenshots/reference/oncoprinter_example_data_element_chrome_1600x1000.png differ diff --git a/end-to-end-test/remote/specs/core/oncoprint.screenshot.spec.js b/end-to-end-test/remote/specs/core/oncoprint.screenshot.spec.js index e92a0c40b0a..d866200f882 100644 --- a/end-to-end-test/remote/specs/core/oncoprint.screenshot.spec.js +++ b/end-to-end-test/remote/specs/core/oncoprint.screenshot.spec.js @@ -139,6 +139,36 @@ describe('oncoprint screenshot tests', function() { var res = checkOncoprintElement('.oncoprintContainer'); assertScreenShotMatch(res); }); + it('coadread_tcga_pub with column gaps inserted based on clinical track', function() { + goToUrlAndSetLocalStorage( + `${CBIOPORTAL_URL}/results?Z_SCORE_THRESHOLD=2.0&cancer_study_id=coadread_tcga_pub&cancer_study_list=coadread_tcga_pub&case_ids=&case_set_id=coadread_tcga_pub_nonhypermut&clinicallist=CANCER_TYPE_DETAILED&gene_list=KRAS%20NRAS%20BRAF&gene_set_choice=user-defined-list&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=coadread_tcga_pub_gistic&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=coadread_tcga_pub_mutations&oncoprint_cluster_profile=&oncoprint_sortby=` + ); + waitForOncoprint(ONCOPRINT_TIMEOUT); + + const cancerTypeDetailedElements = getNthTrackOptionsElements(1); + setDropdownOpen( + true, + cancerTypeDetailedElements.button_selector, + cancerTypeDetailedElements.dropdown_selector, + 'Failed to open cancer type detailed track menu' + ); + browser.click( + `${cancerTypeDetailedElements.dropdown_selector} li:nth-child(9)` + ); // Click "show gaps" + browser.pause(100); // give time to sort and insert gaps + + // open minimap + browser.waitForExist('[data-test="ShowMinimapButton"]'); + browser.click('[data-test="ShowMinimapButton"]'); + + // zoom to fit + browser.waitForVisible('.oncoprint-zoomtofit-btn'); + browser.click('.oncoprint-zoomtofit-btn'); + browser.pause(100); // give time to rezoom + + const res = checkOncoprintElement('.oncoprintContainer'); + assertScreenShotMatch(res); + }); }); describe('track group headers', function() { diff --git a/src/pages/staticPages/tools/oncoprinter/Oncoprinter.tsx b/src/pages/staticPages/tools/oncoprinter/Oncoprinter.tsx index 0b480f69566..22ab125134b 100644 --- a/src/pages/staticPages/tools/oncoprinter/Oncoprinter.tsx +++ b/src/pages/staticPages/tools/oncoprinter/Oncoprinter.tsx @@ -285,13 +285,17 @@ export default class Oncoprinter extends React.Component< } }, onSetHorzZoom: (z: number) => { - this.oncoprint.setHorzZoom(z); + this.oncoprint.setHorzZoomCentered(z); }, onClickZoomIn: () => { - this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() / 0.7); + this.oncoprint.setHorzZoomCentered( + this.oncoprint.getHorzZoom() / 0.7 + ); }, onClickZoomOut: () => { - this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() * 0.7); + this.oncoprint.setHorzZoomCentered( + this.oncoprint.getHorzZoom() * 0.7 + ); }, onClickNGCHM: () => {}, // do nothing in oncoprinter mode }; diff --git a/src/shared/components/oncoprint/DeltaUtils.ts b/src/shared/components/oncoprint/DeltaUtils.ts index 2be69b2574e..2e88a8d32e1 100644 --- a/src/shared/components/oncoprint/DeltaUtils.ts +++ b/src/shared/components/oncoprint/DeltaUtils.ts @@ -1172,7 +1172,7 @@ function transitionClinicalTrack( rule_set_params.legend_label = nextSpec.label; rule_set_params.exclude_from_legend = !nextProps.showClinicalTrackLegends; rule_set_params.na_legend_label = nextSpec.na_legend_label; - const clinicalTrackParams = { + const clinicalTrackParams: UserTrackSpec = { rule_set_params, data: nextSpec.data, data_id_key: 'uid', @@ -1199,6 +1199,7 @@ function transitionClinicalTrack( target_group: CLINICAL_TRACK_GROUP_INDEX, onSortDirectionChange: nextProps.onTrackSortDirectionChange, custom_track_options: nextSpec.custom_options, + track_can_show_gaps: nextSpec.datatype === 'string', }; trackSpecKeyToTrackId[nextSpec.key] = oncoprint.addTracks([ clinicalTrackParams, diff --git a/src/shared/components/oncoprint/ResultsViewOncoprint.tsx b/src/shared/components/oncoprint/ResultsViewOncoprint.tsx index 37327fd8ec2..81a3779cbcf 100644 --- a/src/shared/components/oncoprint/ResultsViewOncoprint.tsx +++ b/src/shared/components/oncoprint/ResultsViewOncoprint.tsx @@ -882,13 +882,17 @@ export default class ResultsViewOncoprint extends React.Component< } }, onSetHorzZoom: (z: number) => { - this.oncoprint.setHorzZoom(z); + this.oncoprint.setHorzZoomCentered(z); }, onClickZoomIn: () => { - this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() / 0.7); + this.oncoprint.setHorzZoomCentered( + this.oncoprint.getHorzZoom() / 0.7 + ); }, onClickZoomOut: () => { - this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() * 0.7); + this.oncoprint.setHorzZoomCentered( + this.oncoprint.getHorzZoom() * 0.7 + ); }, }; } diff --git a/src/shared/components/oncoprint/controls/OncoprintControls.tsx b/src/shared/components/oncoprint/controls/OncoprintControls.tsx index 043af9077cf..e8318e2ef2f 100644 --- a/src/shared/components/oncoprint/controls/OncoprintControls.tsx +++ b/src/shared/components/oncoprint/controls/OncoprintControls.tsx @@ -1401,6 +1401,7 @@ export default class OncoprintControls extends React.Component< onClick={this.toggleShowMinimap} >