Skip to content

Commit 954f65b

Browse files
committed
title bivariate charts "vs"
1 parent 4c31d63 commit 954f65b

File tree

2 files changed

+51
-65
lines changed

2 files changed

+51
-65
lines changed

src/components/DistributionReport.tsx

Lines changed: 50 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -257,24 +257,7 @@ export const DistributionReport = (
257257
return columnNames.map(
258258
(column2, indexcolumn2) => {
259259
const dataType2 = dataTypes[column2];
260-
if (
261-
//column === column2 ||
262-
indexcolumn1 >= indexcolumn2
263-
) {
264-
if (indexcolumn1 != indexcolumn2) {
265-
console.log(
266-
'skipped columns',
267-
column,
268-
column2,
269-
indexcolumn1,
270-
indexcolumn2,
271-
indexcolumn1 >=
272-
indexcolumn2,
273-
dataType,
274-
dataType2
275-
);
276-
}
277-
260+
if (indexcolumn1 >= indexcolumn2) {
278261
return null;
279262
}
280263

@@ -330,48 +313,55 @@ export const DistributionReport = (
330313
);
331314

332315
return (
333-
<div className="flex flex-row w-full overflow-auto gap-4">
334-
{categories.map(item => (
335-
<div
336-
key={item}
337-
className="flex flex-col"
338-
>
339-
<GroupBarChart
340-
yAxisLabel={
341-
'count'
342-
}
343-
title={`${column} = ${item}`}
344-
data={categories2.map(
345-
item2 => ({
346-
// count : number of times where item2 appears in the data for category2 and rows where category1 = item
347-
name: `${item2}`,
348-
values: [
349-
{
350-
name: 'real',
351-
value: countCategory2ForCategory1(
352-
realData,
353-
item,
354-
item2,
355-
column,
356-
column2
357-
),
358-
},
359-
{
360-
name: 'synth',
361-
value: countCategory2ForCategory1(
362-
syntheticData,
363-
item,
364-
item2,
365-
column,
366-
column2
367-
),
368-
},
369-
],
370-
})
371-
)}
372-
/>
373-
</div>
374-
))}
316+
<div>
317+
<h2 className="text-center font-bold mt-2 text-[12px]">
318+
{column} vs {column2}
319+
</h2>
320+
<div className="flex flex-row w-full overflow-auto gap-4">
321+
{categories.map(
322+
item => (
323+
<div
324+
key={item}
325+
className="flex flex-col"
326+
>
327+
<GroupBarChart
328+
yAxisLabel={
329+
'count'
330+
}
331+
title={`${column} = ${item}`}
332+
data={categories2.map(
333+
item2 => ({
334+
// count : number of times where item2 appears in the data for category2 and rows where category1 = item
335+
name: `${item2}`,
336+
values: [
337+
{
338+
name: 'real',
339+
value: countCategory2ForCategory1(
340+
realData,
341+
item,
342+
item2,
343+
column,
344+
column2
345+
),
346+
},
347+
{
348+
name: 'synth',
349+
value: countCategory2ForCategory1(
350+
syntheticData,
351+
item,
352+
item2,
353+
column,
354+
column2
355+
),
356+
},
357+
],
358+
})
359+
)}
360+
/>
361+
</div>
362+
)
363+
)}
364+
</div>
375365
</div>
376366
);
377367
}

src/components/graphs/ViolinChart.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,7 @@ const ViolinChart = ({
318318
.attr('text-anchor', 'middle')
319319
.style('font-size', '12px')
320320
.style('font-weight', 'bold')
321-
.text(
322-
`${t('distribution.distributionOf')} ${numericColumn} ${t(
323-
'distribution.by'
324-
)} ${categoricalColumn}`
325-
);
321+
.text(`${numericColumn} vs ${categoricalColumn}`);
326322

327323
// Add y-axis label
328324
svg.append('text')

0 commit comments

Comments
 (0)