11import { t } from 'i18next' ;
2- import Markdown from 'react-markdown' ;
32import { Fragment } from 'react/jsx-runtime' ;
43import ErrorBoundary from './ErrorBoundary' ;
54import DistributionBarChart from './graphs/DistributionBarChart' ;
@@ -10,6 +9,7 @@ import { createHeatmapdata } from './createHeatmapdata';
109import ViolinChart from './graphs/ViolinChart' ;
1110import GroupBarChart from './graphs/GroupBarChart' ;
1211import SimpleTable from './SimpleTable' ;
12+ import { MarkdownWithTooltips } from './MarkdownWithTooltips' ;
1313
1414interface CorrelationMatrixProps {
1515 heatmapData : {
@@ -34,8 +34,12 @@ function CorrelationMatrix(props: CorrelationMatrixProps) {
3434 ) ;
3535}
3636
37+ interface DataRow {
38+ [ key : string ] : string | number | boolean ;
39+ }
40+
3741function countCategory2ForCategory1 (
38- data : Record < string , any > [ ] ,
42+ data : DataRow [ ] ,
3943 category1 : string ,
4044 category2 : string ,
4145 column1 : string ,
@@ -106,12 +110,12 @@ export const DistributionReport = (
106110 }
107111 if ( report . reportType === 'text' && report . textKey ) {
108112 return (
109- < Markdown
113+ < MarkdownWithTooltips
110114 key = { indexReport }
111115 className = "-mt-2 text-gray-800 markdown"
112116 >
113117 { t ( report . textKey , report . params ) }
114- </ Markdown >
118+ </ MarkdownWithTooltips >
115119 ) ;
116120 }
117121
@@ -143,7 +147,7 @@ export const DistributionReport = (
143147 'text'
144148 ) {
145149 return (
146- < Markdown
150+ < MarkdownWithTooltips
147151 key = { index }
148152 className = "-mt-2 text-gray-800 markdown"
149153 >
@@ -152,7 +156,7 @@ export const DistributionReport = (
152156 '' ,
153157 content . params
154158 ) }
155- </ Markdown >
159+ </ MarkdownWithTooltips >
156160 ) ;
157161 }
158162 }
@@ -172,7 +176,7 @@ export const DistributionReport = (
172176 'text'
173177 ) {
174178 return (
175- < Markdown
179+ < MarkdownWithTooltips
176180 key = { index }
177181 className = "-mt-2 text-gray-800 markdown"
178182 >
@@ -181,7 +185,7 @@ export const DistributionReport = (
181185 '' ,
182186 content . params
183187 ) }
184- </ Markdown >
188+ </ MarkdownWithTooltips >
185189 ) ;
186190 } else if (
187191 content . contentType ===
@@ -282,11 +286,18 @@ export const DistributionReport = (
282286 ) {
283287 const data = realData . reduce (
284288 (
285- acc : Record < string , any > ,
286- row : Record < string , any >
289+ acc : Record <
290+ string ,
291+ Record < string , number >
292+ > ,
293+ row : DataRow
287294 ) => {
288- const category = row [ column ] ;
289- const category2 = row [ column2 ] ;
295+ const category = row [
296+ column
297+ ] as string ;
298+ const category2 = row [
299+ column2
300+ ] as string ;
290301 if ( ! acc [ category ] ) {
291302 acc [ category ] = { } ;
292303 }
@@ -433,14 +444,16 @@ export const DistributionReport = (
433444 const categories = Array . from (
434445 new Set ( [
435446 ...realData . map (
436- ( d : any ) => d [ column ]
447+ ( d : DataRow ) =>
448+ d [ column ] as string
437449 ) ,
438450 ] )
439451 ) ;
440452 const categories2 = Array . from (
441453 new Set ( [
442454 ...realData . map (
443- ( d : any ) => d [ column2 ]
455+ ( d : DataRow ) =>
456+ d [ column2 ] as string
444457 ) ,
445458 ] )
446459 ) ;
@@ -522,15 +535,15 @@ export const DistributionReport = (
522535 ) }
523536 content = {
524537 < div >
525- < Markdown className = "py-4 markdown" >
538+ < MarkdownWithTooltips className = "py-4 markdown" >
526539 { t (
527540 'syntheticData.bivariateText' ,
528541 {
529542 samples :
530543 syntheticData . length ,
531544 }
532545 ) }
533- </ Markdown >
546+ </ MarkdownWithTooltips >
534547 { charts }
535548 </ div >
536549 }
@@ -616,15 +629,15 @@ export const DistributionReport = (
616629 ) }
617630 content = {
618631 < >
619- < Markdown className = "py-4 markdown" >
632+ < MarkdownWithTooltips className = "py-4 markdown" >
620633 { t (
621634 'syntheticData.univariateText' ,
622635 {
623636 samples :
624637 syntheticData . length ,
625638 }
626639 ) }
627- </ Markdown >
640+ </ MarkdownWithTooltips >
628641 { Object . keys (
629642 realData [ 0 ]
630643 ) . map (
0 commit comments