File tree Expand file tree Collapse file tree 4 files changed +50
-28
lines changed
Expand file tree Collapse file tree 4 files changed +50
-28
lines changed Original file line number Diff line number Diff line change @@ -256,33 +256,22 @@ def run():
256256 {'reportType': 'univariateDistributionSyntheticData'},
257257 {'reportType': 'bivariateDistributionSyntheticData'},
258258 {'reportType': 'correlationSyntheticData'},
259-
259+ {
260+ 'reportType': 'table',
261+ 'titleKey': 'syntheticData.diagnosticsTitle',
262+ 'showIndex' : False,
263+ 'data': json.dumps([
264+ {
265+ 'attribute': key,
266+ 'ks_stat': values['ks_stat'],
267+ 'p_value': values['p_value']
268+ }
269+ for key, values in results['distribution_results'].items()
270+ ])
271+ }
260272 ]
261273 }))
262274
263- # setResult(json.dumps({
264- # 'type': 'heatmap',
265- # 'real': real_data.corr().to_json(orient="records"),
266- # 'synthetic': synthetic_data.corr().to_json(orient="records")
267- # }))
268-
269- setResult(json.dumps(
270- {
271- 'type': 'heading',
272- 'headingKey': 'syntheticData.diagnosticsTitle'
273- }
274- ))
275- setResult(json.dumps({'type': 'table',
276- 'showIndex' : False,
277- 'data': json.dumps([
278- {
279- 'attribute': key,
280- 'ks_stat': values['ks_stat'],
281- 'p_value': values['p_value']
282- }
283- for key, values in results['distribution_results'].items()
284- ])}))
285-
286275 setResult(json.dumps(
287276 {
288277 'type': 'heading',
Original file line number Diff line number Diff line change @@ -9,12 +9,16 @@ import { Accordion } from './ui/accordion';
99import { createHeatmapdata } from './createHeatmapdata' ;
1010import ViolinChart from './graphs/ViolinChart' ;
1111import GroupBarChart from './graphs/GroupBarChart' ;
12+ import SimpleTable from './SimpleTable' ;
1213
1314interface DistributionReport {
1415 reportType : string ;
1516 headingKey ?: string ;
1617 textKey ?: string ;
1718 params ?: Record < string , string | number | boolean > ;
19+ data ?: string ;
20+ titleKey ?: string ;
21+ showIndex ?: boolean ;
1822}
1923export interface DistributionReportProps {
2024 dataTypes : string ;
@@ -60,6 +64,35 @@ export const DistributionReport = (
6064 </ Markdown >
6165 ) ;
6266 }
67+
68+ if ( report . reportType === 'table' ) {
69+ if ( ! report . data ) {
70+ return null ;
71+ }
72+ if ( ! report . titleKey ) {
73+ return null ;
74+ }
75+
76+ return (
77+ < div key = { indexReport } className = "mb-4" >
78+ < Accordion
79+ title = { t ( report . titleKey ) }
80+ content = {
81+ < div >
82+ < p > </ p >
83+ < SimpleTable
84+ data = { JSON . parse ( report . data ) }
85+ title = { t ( report . titleKey ) }
86+ showIndex = {
87+ report . showIndex ?? false
88+ }
89+ />
90+ </ div >
91+ }
92+ />
93+ </ div >
94+ ) ;
95+ }
6396 if (
6497 report . reportType === 'univariateDistributionRealData'
6598 ) {
Original file line number Diff line number Diff line change 139139 }
140140 },
141141 "heatmap" : {
142- "realdata" : " Correlation matrix of real data" ,
143- "syntheticdata" : " Absolute difference in correlation matrix, i.e., |real data - synthetic data|"
142+ "realdata" : " Correlation matrix of attached data" ,
143+ "syntheticdata" : " Absolute difference in correlation matrix, i.e., |attached data - synthetic data|"
144144 },
145145 "distribution" : {
146146 "distributionFor" : " Distribution for" ,
Original file line number Diff line number Diff line change 138138 }
139139 },
140140 "heatmap" : {
141- "realdata" : " Correlatie matrix van echte data" ,
142- "syntheticdata" : " Absoluut verschil in correlation matrix, m.a.w., |echte data - synthetische data|"
141+ "realdata" : " Correlatie matrix van gekoppelde data" ,
142+ "syntheticdata" : " Absoluut verschil in correlation matrix, m.a.w., |gekoppelde data - synthetische data|"
143143 },
144144 "distribution" : {
145145 "distributionFor" : " Distributie voor" ,
You can’t perform that action at this time.
0 commit comments