Skip to content

Commit ef9a376

Browse files
committed
Refactor TooltipWrapper component to improve structure and enhance tooltip trigger functionality; update localization for missing data descriptions.
1 parent 1f8d714 commit ef9a376

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

src/components/TooltipWrapper.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { InfoIcon } from 'lucide-react';
21
import {
32
Tooltip,
43
TooltipContent,
@@ -9,30 +8,26 @@ import { MarkdownWithTooltips } from './MarkdownWithTooltips';
98

109
interface TooltipWrapperProps {
1110
tooltipContent: string;
11+
children: React.ReactNode;
1212
textBefore?: string;
1313
textAfter?: string;
14-
children: React.ReactNode;
1514
}
1615

1716
export function TooltipWrapper({
1817
tooltipContent,
18+
children,
1919
textBefore,
2020
textAfter,
21-
children,
2221
}: TooltipWrapperProps) {
2322
return (
24-
<div>
23+
<span>
2524
{textBefore}
26-
{children}
27-
2825
<TooltipProvider>
2926
<Tooltip>
30-
<TooltipTrigger
31-
onClick={event => {
32-
event.preventDefault();
33-
}}
34-
>
35-
<InfoIcon className="size-3.5 ml-1" />
27+
<TooltipTrigger asChild>
28+
<span className="border-b border-dotted border-gray-400 cursor-help">
29+
{children}
30+
</span>
3631
</TooltipTrigger>
3732
<TooltipContent className="tooltip-content max-w-[400px] p-2">
3833
<MarkdownWithTooltips className="text-gray-800 markdown">
@@ -42,6 +37,6 @@ export function TooltipWrapper({
4237
</Tooltip>
4338
</TooltipProvider>
4439
{textAfter}
45-
</div>
40+
</span>
4641
);
4742
}

src/locales/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export const en = {
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:
161161
'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)',
162-
missingData: `For Missing At Random (MAR) and Missing Not At Random (MNAR) data,
162+
missingData: `For {tooltip:syntheticData.missingDataTooltip}Missing At Random (MAR){/tooltip} and {tooltip:syntheticData.missingDataTooltip}Missing Not At Random (MNAR){/tooltip} data,
163163
we recommend to impute the missing data. For Missing Completely At Random (MCAR), we recommend to remove the missing data. {tooltip:syntheticData.missingDataTooltip}See the info box for more information{/tooltip}.`,
164164
missingDataTooltip: `MCAR, MAR, and MNAR are terms used to describe different mechanisms of missing data:
165165

0 commit comments

Comments
 (0)