Skip to content

Commit 44beacb

Browse files
authored
Merge pull request #59 from NGO-Algorithm-Audit/feature/styling-layout-tweaks-markdown
Change spacing in DistributionReport and SyntheticData components, en…
2 parents 573e62b + 465b00c commit 44beacb

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

src/components/DistributionReport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const DistributionReport = (
9595
return column != 'realOrSynthetic';
9696
});
9797
return (
98-
<div className="flex flex-col gap-6">
98+
<div className="flex flex-col gap-4">
9999
{distributionReportProps.reports.map(
100100
(report: DistributionReport, indexReport: number) => {
101101
if (report.reportType === 'heading' && report.headingKey) {

src/components/TooltipWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function TooltipWrapper({
2929
<InfoIcon className="size-3.5 ml-1" />
3030
</TooltipTrigger>{' '}
3131
&nbsp;
32-
<TooltipContent className="max-w-[400px] p-2">
32+
<TooltipContent className="tooltip-content max-w-[400px] p-2">
3333
<MarkdownWithTooltips className="text-gray-800 markdown">
3434
{tooltipContent}
3535
</MarkdownWithTooltips>

src/components/rehype-info-tooltip.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function rehypeInfoTooltip() {
1717
return (tree: Node) => {
1818
visit(tree, 'element', (node: ElementNode) => {
1919
if (node.properties?.tooltip) {
20-
console.log('Found tooltip in node:', node.properties.tooltip);
2120
// Create a custom component that will be rendered by react-markdown
2221
const tooltipNode: Element = {
2322
type: 'element',
@@ -30,7 +29,6 @@ export function rehypeInfoTooltip() {
3029

3130
// Replace the current node with the tooltip node
3231
Object.assign(node, tooltipNode);
33-
console.log('Updated node:', JSON.stringify(node, null, 2));
3432
}
3533
});
3634
};

src/index.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@
1010
}
1111

1212
ul {
13-
@apply list-disc list-inside;
13+
@apply pl-[20px] list-disc;
1414
}
15+
16+
p {
17+
@apply mb-3;
18+
}
19+
}
20+
21+
.tooltip-content {
22+
@apply p-4;
1523
}
1624

1725
.showonprint .chart-container {

src/locales/en.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export const en = {
6666
demo: {
6767
heading: 'Information about demo dataset',
6868
description:
69-
'A subset of the [Law School Admission Bar](https://www.kaggle.com/datasets/danofer/law-school-admissions-bar-passage)* dataset is used as a demo. Synthetic data will be generated for the following variables:\n \n&nbsp;&nbsp;\n',
69+
'A subset of the [Law School Admission Bar](https://www.kaggle.com/datasets/danofer/law-school-admissions-bar-passage)* dataset is used as a demo. Synthetic data will be generated for the following variables:',
7070
'post.description':
71-
'The CART method is used to generate the synthetic data. CART generally produces high quality synthetic data, but might not work well on datasets with categorical variables with 20+ categories. Use Gaussian Copula in those cases.\n \n&nbsp;&nbsp;\n\n*The original paper can be found [here](https://files.eric.ed.gov/fulltext/ED469370.pdf)\n \n&nbsp;&nbsp;\n',
71+
'The CART method is used to generate the synthetic data. CART generally produces high quality synthetic data, but might not work well on datasets with categorical variables with 20+ categories. Use Gaussian Copula in those cases.\n \n*The original paper can be found [here](https://files.eric.ed.gov/fulltext/ED469370.pdf)',
7272
'data.column.Variable_name': 'Variable name',
7373
'data.sex': 'sex',
7474
'data.race1': 'race1',
@@ -158,24 +158,24 @@ export const en = {
158158
bivariateText:
159159
'The figures below display the differences in value frequency for a combination of variables. For comparing two categorical variables, bar charts are plotted. For comparing a numerical and a categorical variables, a so called [violin plot](https://en.wikipedia.org/wiki/Violin_plot) is shown. For comparing two numercial variables, a [LOESS plot](https://en.wikipedia.org/wiki/Local_regression) is created. For all plots holds: the synthetic data is of high quality when the shape of the distributions in the synthetic data equal the distributions in the real data.',
160160
moreInfo:
161-
'&nbsp;&nbsp;\n \n \n \nDo you want to learn more about synthetic data?\n \n \n \n- [python-synthpop on Github](https://github.com/NGO-Algorithm-Audit/python-synthpop)\n- [local-first web app on Github](https://github.com/NGO-Algorithm-Audit/local-first-web-tool/tree/main)\n- [Synthetic Data: what, why and how?](https://royalsociety.org/-/media/policy/projects/privacy-enhancing-technologies/Synthetic_Data_Survey-24.pdf)\n- [Knowledge Network Synthetic Data](https://online.rijksinnovatiecommunity.nl/groups/399-kennisnetwerk-synthetischedata/welcome) (for Dutch public organizations)\n- [Synthetic data portal of Dutch Executive Agency for Education](https://duo.nl/open_onderwijsdata/footer/synthetische-data.jsp) (DUO)\n- [CART: synthpop resources](https://synthpop.org.uk/resources.html)\n- [Gaussian Copula - Synthetic Data Vault](https://docs.sdv.dev/sdv)',
161+
'Do you want to learn more about synthetic data?\n \n \n \n- [python-synthpop on Github](https://github.com/NGO-Algorithm-Audit/python-synthpop)\n- [local-first web app on Github](https://github.com/NGO-Algorithm-Audit/local-first-web-tool/tree/main)\n- [Synthetic Data: what, why and how?](https://royalsociety.org/-/media/policy/projects/privacy-enhancing-technologies/Synthetic_Data_Survey-24.pdf)\n- [Knowledge Network Synthetic Data](https://online.rijksinnovatiecommunity.nl/groups/399-kennisnetwerk-synthetischedata/welcome) (for Dutch public organizations)\n- [Synthetic data portal of Dutch Executive Agency for Education](https://duo.nl/open_onderwijsdata/footer/synthetische-data.jsp) (DUO)\n- [CART: synthpop resources](https://synthpop.org.uk/resources.html)\n- [Gaussian Copula - Synthetic Data Vault](https://docs.sdv.dev/sdv)',
162162
missingData: `For Missing At Random (MAR) and Missing Not At Random (MNAR) data,
163163
we recommend to impute the missing data. For Missing Completely At Random (MCAR), we recommend to remove the missing data. See the info box for more information. {tooltip:syntheticData.missingDataTooltip}More info about MCAR, MAR, and MNAR{/tooltip}`,
164164
missingDataTooltip: `MCAR, MAR, and MNAR are terms used to describe different mechanisms of missing data:
165165
166-
1. **MCAR (Missing Completely At Random)**:
166+
**1. MCAR (Missing Completely At Random)**:
167167
- The probability of data being missing is completely independent of both observed and unobserved data.
168168
- There is no systematic pattern to the missingness.
169169
- Example: A survey respondent accidentally skips a question due to a printing error.
170170
- Recommendation: remove missing data.
171171
172-
2. **MAR (Missing At Random)**:
172+
**2. MAR (Missing At Random)**:
173173
- The probability of data being missing is related to the observed data but not the missing data itself.
174174
- The missingness can be predicted by other variables in the dataset.
175175
- Example: Students' test scores are missing, but the missingness is related to their attendance records.
176176
- Recommendation: impute missing data.
177177
178-
3. **MNAR (Missing Not At Random)**:
178+
**3. MNAR (Missing Not At Random)**:
179179
- The probability of data being missing is related to the missing data itself.
180180
- There is a systematic pattern to the missingness that is related to the unobserved data.
181181
- Example: Patients with more severe symptoms are less likely to report their symptoms, leading to missing data that is related to the severity of the symptoms.

src/routes/SyntheticData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default function SyntheticDataGeneration() {
153153

154154
<div
155155
className={cn(
156-
'flex flex-2 w-full h-[min-content] xl:h-full xl:min-h-[100%] flex-col rounded-xl gap-6 bg-slate-50 p-4',
156+
'flex flex-2 w-full h-[min-content] xl:h-full xl:min-h-[100%] flex-col rounded-xl gap-4 bg-slate-50 p-4',
157157
loading && 'overflow-hidden'
158158
)}
159159
>

0 commit comments

Comments
 (0)