-
Notifications
You must be signed in to change notification settings - Fork 306
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
base: master
Are you sure you want to change the base?
Changes from 30 commits
8e2c23d
2417ba0
bcfb7cf
a9ea625
b414342
464f523
d268e97
cfb9cfa
bb6a23a
dd69002
6d17f27
053e820
9a918e4
656f8a6
686b745
31e99e3
a1bf41c
25eaddb
25c6e27
0406033
e8a276f
7400e58
91a4e90
c6746a1
de23d79
358cc4e
60dd7cc
b7e7633
9cbdc87
bf3af8a
89807b1
7fe7bee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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 { | ||
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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In SingleCellStore, add the types for the different properties that are now |
||
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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the type for |
||
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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the type for |
||
this.currentTooltipData = value; | ||
} | ||
setMap(value: { [key: string]: string }) { | ||
this.map = value; | ||
} | ||
setDynamicWidth(value: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the type for |
||
this.dynamicWidth = value; | ||
} | ||
setIncreaseCount(value: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the type for |
||
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[]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the type for |
||
this.selectedSamples = value; | ||
} | ||
setDropdownOptions(value: any[]) { | ||
this.dropdownOptions = value; | ||
} | ||
setIsReverse(value: any) { | ||
this.isReverse = value; | ||
} | ||
setInitialWidth(value: any) { | ||
this.initialWidth = value; | ||
} | ||
setHeading(value: any) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For |
||
this.heading = value; | ||
} | ||
setIsHovered(value: boolean) { | ||
console.log('Setting isHovered:', value); // Add logging here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove logging |
||
this.isHovered = value; | ||
} | ||
setHoveredSliceIndex(value: any) { | ||
console.log( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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[]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the type for |
||
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; |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done