Skip to content

Commit 3fcf576

Browse files
committed
fix: add hint tooltips for quadrant axes
1 parent 526c5db commit 3fcf576

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

app/components/Compare/FacetQuadrantChart.vue

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,58 @@ const config = computed<VueUiQuadrantConfig>(() => {
383383
})
384384
"
385385
/>
386+
387+
<foreignObject
388+
:x="0"
389+
:y="30"
390+
style="overflow: visible;"
391+
:width="svg.width"
392+
:height="12"
393+
>
394+
<div class="flex items-center justify-center gap-2">
395+
<TooltipApp interactive>
396+
<button
397+
data-dom-to-png-ignore
398+
type="button"
399+
class="i-lucide:info w-3.5 h-3.5 text-fg-muted cursor-help"
400+
:aria-label="$t('compare.quadrant_chart.explanation.tooltip_help_efficiency')"
401+
/>
402+
<template #content>
403+
<div class="flex flex-col gap-3">
404+
<p class="text-xs text-fg-muted">
405+
{{ $t('compare.quadrant_chart.explanation.efficiency') }}
406+
</p>
407+
</div>
408+
</template>
409+
</TooltipApp>
410+
</div>
411+
</foreignObject>
412+
413+
<foreignObject
414+
:x="svg.width - 40"
415+
:y="svg.height / 2 - 8"
416+
style="overflow: visible;"
417+
:width="20"
418+
:height="12"
419+
>
420+
<div class="flex items-center justify-center gap-2">
421+
<TooltipApp interactive>
422+
<button
423+
data-dom-to-png-ignore
424+
type="button"
425+
class="i-lucide:info w-3.5 h-3.5 text-fg-muted cursor-help"
426+
:aria-label="$t('compare.quadrant_chart.explanation.tooltip_help_adoption')"
427+
/>
428+
<template #content>
429+
<div class="flex flex-col gap-3">
430+
<p class="text-xs text-fg-muted">
431+
{{ $t('compare.quadrant_chart.explanation.adoption') }}
432+
</p>
433+
</div>
434+
</template>
435+
</TooltipApp>
436+
</div>
437+
</foreignObject>
386438
</template>
387439

388440
<template #menuIcon="{ isOpen }">

i18n/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,8 @@
12551255
},
12561256
"explanation": {
12571257
"tooltip_help": "Show scoring explanation",
1258+
"tooltip_help_adoption": "Show traction scoring explanation",
1259+
"tooltip_help_efficiency": "Show ergonomics scoring explanation",
12581260
"introduction": "The score is calculated by combining multiple signals into two axes:",
12591261
"adoption": "Traction: reflects usage and activity (downloads, freshness, likes)",
12601262
"efficiency": "Ergonomics: reflects footprint and quality (install size, dependencies, vulnerabilities, type support)",

i18n/locales/fr-FR.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,8 @@
12481248
},
12491249
"explanation": {
12501250
"tooltip_help": "Afficher l’explication du score",
1251+
"tooltip_help_adoption": "Afficher l'explication du score de popularité",
1252+
"tooltip_help_efficiency": "Afficher l'explication du score d'ergonomie",
12511253
"introduction": "Le score est calculé en combinant plusieurs signaux sur deux axes :",
12521254
"adoption": "Popularité : reflète l’utilisation et l’activité (téléchargements, fraîcheur, mentions)",
12531255
"efficiency": "Ergonomie : reflète l’empreinte et la qualité (taille d’installation, dépendances, vulnérabilités, support des types)",

i18n/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,6 +3769,12 @@
37693769
"tooltip_help": {
37703770
"type": "string"
37713771
},
3772+
"tooltip_help_adoption": {
3773+
"type": "string"
3774+
},
3775+
"tooltip_help_efficiency": {
3776+
"type": "string"
3777+
},
37723778
"introduction": {
37733779
"type": "string"
37743780
},

0 commit comments

Comments
 (0)