Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gsoc 2024 single cell tab- stackedBar,piechart and bar plots added #4921

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8e2c23d
Single-cell-tab-and-BarChart-added
SURAJ-SHARMA27 May 24, 2024
2417ba0
pie-chart-added
SURAJ-SHARMA27 May 25, 2024
bcfb7cf
Merge branch 'cBioPortal:master' into GSoC-2024-Single-Cell
SURAJ-SHARMA27 May 29, 2024
a9ea625
table-tooltip-added
SURAJ-SHARMA27 May 29, 2024
b414342
tooltip-enable-button-added
SURAJ-SHARMA27 May 31, 2024
464f523
downloading-options-added
SURAJ-SHARMA27 Jun 2, 2024
d268e97
download-functionality-enabled
SURAJ-SHARMA27 Jun 3, 2024
cfb9cfa
reusable-downloadUtils.ts-made
SURAJ-SHARMA27 Jun 4, 2024
bb6a23a
resizable-data-table
SURAJ-SHARMA27 Jun 4, 2024
dd69002
stacked-bar-plot-added-E2E
SURAJ-SHARMA27 Jun 11, 2024
6d17f27
NA-counts-@-barplot
SURAJ-SHARMA27 Jun 11, 2024
053e820
adjusted-code-for-newly-added-data
SURAJ-SHARMA27 Jun 15, 2024
9a918e4
Height,searching_issuefixed
SURAJ-SHARMA27 Jun 20, 2024
656f8a6
stacked-Bar-axes-tooltip-fix
SURAJ-SHARMA27 Jun 23, 2024
686b745
axes-labels-added,select-component-fixed
SURAJ-SHARMA27 Jun 24, 2024
31e99e3
patient-view-page-linked
SURAJ-SHARMA27 Jun 24, 2024
a1bf41c
select_sample_ID_dropdown_fixed
SURAJ-SHARMA27 Jun 25, 2024
25eaddb
sorting_functionality_new_features_added_&_minor_fixes
SURAJ-SHARMA27 Jun 26, 2024
25c6e27
enhancements-made
SURAJ-SHARMA27 Jun 29, 2024
0406033
svg_issue_fixed
SURAJ-SHARMA27 Jul 1, 2024
e8a276f
tooltip_issue_fixed
SURAJ-SHARMA27 Jul 1, 2024
7400e58
tooltip_issue_fixed_2
SURAJ-SHARMA27 Jul 1, 2024
91a4e90
stacked_bar_dropdown
SURAJ-SHARMA27 Jul 1, 2024
c6746a1
custom_databin_functionality_added
SURAJ-SHARMA27 Jul 3, 2024
de23d79
custom_Databin_decimal
SURAJ-SHARMA27 Jul 4, 2024
358cc4e
log-statements-removed
SURAJ-SHARMA27 Jul 17, 2024
60dd7cc
made-singleCellStore
SURAJ-SHARMA27 Jul 21, 2024
b7e7633
stacked-bar-tooltip-fixed
SURAJ-SHARMA27 Jul 22, 2024
9cbdc87
stacked-bar-tooltip-fixed-2
SURAJ-SHARMA27 Jul 22, 2024
bf3af8a
min-height-validation_added
SURAJ-SHARMA27 Jul 28, 2024
89807b1
generalized_download,colors_removed_logs
SURAJ-SHARMA27 Jul 31, 2024
7fe7bee
type-added-for-all-props
SURAJ-SHARMA27 Aug 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
741 changes: 741 additions & 0 deletions src/pages/SingleCell/BarChart.tsx

Large diffs are not rendered by default.

1,168 changes: 1,168 additions & 0 deletions src/pages/SingleCell/HomePage.tsx

Large diffs are not rendered by default.

549 changes: 549 additions & 0 deletions src/pages/SingleCell/PieChart.tsx

Large diffs are not rendered by default.

393 changes: 393 additions & 0 deletions src/pages/SingleCell/PieToolTip.tsx

Large diffs are not rendered by default.

219 changes: 219 additions & 0 deletions src/pages/SingleCell/SingleCellStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
import { makeAutoObservable } from 'mobx';

interface Option {
value: string;
label: string;
description: string;
profileType: string;
genericAssayType: string;
dataType: string;
genericAssayEntityId: string;
patientLevel: boolean;
}
interface ChartInfo {
name: string;
description: string;
profileType: string;
genericAssayType: string;
dataType: string;
genericAssayEntityId: string;
patientLevel: boolean;
}
interface Entity {
stableId: string;
}
interface DataBin {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataBin is defined as an export type in StudyViewUtils.tsx, you should import it from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

id: string;
count: number;
end?: number;
start?: number;
specialValue?: string;
}
interface gaData {
uniqueSampleKey: string;
uniquePatientKey: string;
molecularProfileId: string;
sampleId: string;
patientId: string;
studyId: string;
value: string;
genericAssayStableId: string;
stableId: string;
}

class SingleCellStore {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SingleCellStore, add the types for the different properties that are now any

selectedOption: string = '';
entityNames: string[] = [];
molecularProfiles: Option[] = [];
chartInfo: ChartInfo = {
name: '',
description: '',
profileType: '',
genericAssayType: '',
dataType: '',
genericAssayEntityId: '',
patientLevel: false,
};
selectedEntity: Entity | null = null;
dataBins: DataBin[] | null = null;
chartType: string | null = null;
pieChartData: any[] = [];
tooltipEnabled: boolean = false;
downloadSvg: boolean = false;
downloadPdf: boolean = false;
downloadOption: string = '';
BarDownloadData: gaData[] = [];
stackEntity: string = '';
studyIdToStudy: string = '';
hoveredSampleId: any = [];
currentTooltipData: any = [];
map: { [key: string]: string } = {};
dynamicWidth: any = 0;
increaseCount: any = 0;
decreaseCount: any = 0;
resizeEnabled: boolean = false;
isHorizontal: boolean = false;
isVisible: boolean = false;
tooltipHovered: boolean = false;
selectedSamples: any[] = [];
dropdownOptions: any[] = [];
isReverse: any = false;
initialWidth: any = 0;
heading: any = '';
isHovered: boolean = false; // Changed to boolean and initialized to false
hoveredSliceIndex: number = -1; // Changed to number and initialized to -1
stableIdBin: any = '';
profileTypeBin: any = '';
databinState: any[] = [];

constructor() {
makeAutoObservable(this);
}

setSelectedOption(option: any) {
this.selectedOption = option;
}
setEntityNames(names: any) {
this.entityNames = names;
}
setMolecularProfiles(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the type for value in setSelectedOption, setEntityNames, setMolecularProfiles

this.molecularProfiles = value;
}
setChartInfo(value: ChartInfo) {
this.chartInfo = value;
}
setSelectedEntity(value: Entity | null) {
this.selectedEntity = value;
}
setDataBins(value: DataBin[] | null) {
this.dataBins = value;
}
setChartType(value: string | null) {
this.chartType = value;
}
setPieChartData(value: any) {
this.pieChartData = value;
}
setTooltipEnabled(value: any) {
this.tooltipEnabled = value;
}
setDownloadSvg(value: boolean) {
this.downloadSvg = value;
}
setDownloadPdf(value: boolean) {
this.downloadPdf = value;
}
setDownloadOption(value: string) {
this.downloadOption = value;
}
setBarDownloadData(value: gaData[]) {
this.BarDownloadData = value;
}
setStackEntity(value: string) {
this.stackEntity = value;
}
setStudyIdToStudy(value: string) {
this.studyIdToStudy = value;
}
setHoveredSampleId(value: any) {
this.hoveredSampleId = value;
}
setCurrentTooltipData(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the type for value in setHoveredSampleId and setCurrentTooltipData

this.currentTooltipData = value;
}
setMap(value: { [key: string]: string }) {
this.map = value;
}
setDynamicWidth(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the type for value

this.dynamicWidth = value;
}
setIncreaseCount(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the type for value

this.increaseCount = value;
}
setDecreaseCount(value: any) {
SURAJ-SHARMA27 marked this conversation as resolved.
Show resolved Hide resolved
this.decreaseCount = value;
}
setResizeEnabled(value: boolean) {
this.resizeEnabled = value;
}
setIsHorizontal(value: boolean) {
this.isHorizontal = value;
}
setIsVisible(value: boolean) {
this.isVisible = value;
}
setTooltipHovered(value: boolean) {
this.tooltipHovered = value;
}
setSelectedSamples(value: any[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the type for value

this.selectedSamples = value;
}
setDropdownOptions(value: any[]) {
this.dropdownOptions = value;
}
setIsReverse(value: any) {
this.isReverse = value;
}
setInitialWidth(value: any) {
this.initialWidth = value;
}
setHeading(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For setDropDwonOptions, setIsReverse, and setInitialWidth add the type for value

this.heading = value;
}
setIsHovered(value: boolean) {
console.log('Setting isHovered:', value); // Add logging here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging

this.isHovered = value;
}
setHoveredSliceIndex(value: any) {
console.log(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging

'Setting hoveredSliceIndex:',
value,
this.hoveredSliceIndex
); // Add logging here
this.hoveredSliceIndex = parseInt(value);
console.log('after setting', this.hoveredSliceIndex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove logging

}
setStableIdBin(value: any) {
this.stableIdBin = value;
}
setProfileTypeBin(value: any) {
this.profileTypeBin = value;
}
setDatabinState(value: any[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set the type for value in setStableIdBin, setProfileTypeBin, and setDatabinState

this.databinState = value;
}
increaseWidth() {
this.dynamicWidth += 10;
this.increaseCount += 1;
}
decreaseWidth() {
this.dynamicWidth = Math.max(this.dynamicWidth - 10, this.initialWidth);
this.decreaseCount += 1;
}
handleWidthChange(value: number) {
this.dynamicWidth = Math.max(value, this.initialWidth);
}
}

const singleCellStore = new SingleCellStore();
export default singleCellStore;
Loading
Loading