@@ -140,6 +140,7 @@ export interface IEntityStatistics {
140140 header : string ;
141141 statistic : TStatistic ;
142142 dictionary : TEntityStatisticsDictionary ;
143+ withDownload ?: boolean ;
143144}
144145
145146const resizableCardCommonsSettings = {
@@ -151,6 +152,15 @@ const resizableCardCommonsSettings = {
151152 } ,
152153 withHandle : false ,
153154} ;
155+ const resizableCardCommonsWithoutDownloadSettings = {
156+ closeHandle : false ,
157+ downloadSettings : {
158+ png : false ,
159+ svg : false ,
160+ tsv : false ,
161+ } ,
162+ withHandle : false ,
163+ } ;
154164
155165const pieChartCommonsSettings = {
156166 margin : {
@@ -222,7 +232,9 @@ const applyFilter = ({ data, filter }: TStatisticBarChart | TStatisticPieChart,
222232
223233const LEGEND_ITEM_HEIGHT = 18 ;
224234
225- const getStatisticLayouts = ( statistic : TStatistic , dictionary : TEntityStatisticsDictionary ) => {
235+ type getStatisticLayouts = { statistic : TStatistic ; dictionary : TEntityStatisticsDictionary ; withDownload ?: boolean } ;
236+
237+ const getStatisticLayouts = ( { dictionary, statistic, withDownload = true } : getStatisticLayouts ) => {
226238 const phenotypesData = applyFilter ( statistic . phenotype , 'label' ) ;
227239 const mondoData = applyFilter ( statistic . mondo , 'label' ) ;
228240 const downSyndromeStatusData = applyFilter ( statistic . downSyndromeStatus ) ;
@@ -231,6 +243,10 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
231243 const dataCategoryData = applyFilter ( statistic . dataCategory ) ;
232244 const dataTypeData = applyFilter ( statistic . dataType ) ;
233245
246+ const resizableCardSettings = withDownload
247+ ? resizableCardCommonsSettings
248+ : resizableCardCommonsWithoutDownloadSettings ;
249+
234250 return [
235251 // Phenotypes (HPO) (Vertical Bar Chart)
236252 {
@@ -318,7 +334,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
318334 data : [ phenotypesData ] ,
319335 headers : [ 'Value' , 'Count' ] ,
320336 } }
321- { ...resizableCardCommonsSettings }
337+ { ...resizableCardSettings }
322338 />
323339 ) ,
324340 id : 'phenotypes' ,
@@ -416,7 +432,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
416432 data : [ mondoData ] ,
417433 headers : [ 'Value' , 'Count' ] ,
418434 } }
419- { ...resizableCardCommonsSettings }
435+ { ...resizableCardSettings }
420436 />
421437 ) ,
422438 id : 'mondo' ,
@@ -556,7 +572,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
556572 tsvSettings = { {
557573 data : [ statistic . demography . sex , statistic . demography . race , statistic . demography . ethnicity ] ,
558574 } }
559- { ...resizableCardCommonsSettings }
575+ { ...resizableCardSettings }
560576 />
561577 ) ,
562578 id : 'demography' ,
@@ -626,7 +642,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
626642 tsvSettings = { {
627643 data : [ downSyndromeStatusData ] ,
628644 } }
629- { ...resizableCardCommonsSettings }
645+ { ...resizableCardSettings }
630646 />
631647 ) ,
632648 id : 'down_syndrome' ,
@@ -696,7 +712,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
696712 tsvSettings = { {
697713 data : [ sampleTypeData ] ,
698714 } }
699- { ...resizableCardCommonsSettings }
715+ { ...resizableCardSettings }
700716 />
701717 ) ,
702718 id : 'sample_type' ,
@@ -766,7 +782,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
766782 tsvSettings = { {
767783 data : [ sampleAvailabilityData ] ,
768784 } }
769- { ...resizableCardCommonsSettings }
785+ { ...resizableCardSettings }
770786 />
771787 ) ,
772788 id : 'sample_availability' ,
@@ -879,7 +895,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
879895 tsvSettings = { {
880896 data : [ dataCategoryData ] ,
881897 } }
882- { ...resizableCardCommonsSettings }
898+ { ...resizableCardSettings }
883899 />
884900 ) ,
885901 id : 'data-category' ,
@@ -992,7 +1008,7 @@ const getStatisticLayouts = (statistic: TStatistic, dictionary: TEntityStatistic
9921008 tsvSettings = { {
9931009 data : [ dataTypeData ] ,
9941010 } }
995- { ...resizableCardCommonsSettings }
1011+ { ...resizableCardSettings }
9961012 />
9971013 ) ,
9981014 id : 'data-type' ,
@@ -1038,8 +1054,9 @@ const EntityStatistics = ({
10381054 statistic,
10391055 title,
10401056 titleExtra,
1057+ withDownload = true ,
10411058} : IEntityStatistics ) : React . ReactElement => {
1042- const defaultLayouts = getStatisticLayouts ( statistic , dictionary ) ;
1059+ const defaultLayouts = getStatisticLayouts ( { dictionary , statistic, withDownload } ) ;
10431060 const layouts = serialize ( defaultLayouts ) ;
10441061
10451062 return (
0 commit comments