Files
quartier/maquette/pictos-xl.ts
T
Jules NényandClaude Opus 5.5 b1a31730f3 Lot ⑥b étape C : les lieux du territoire, une seule couche par type, des pictogrammes dessinés en SVG, une légende qui met un type en avant
- content/xl-types.md (13 types, ≤ 16 ; pictogramme et teinte vérifiés au build) et maquette/pictos-xl.ts (13 dessins au trait de pictos.js).
- content/xl-epingles.md : colonne « couche » remplacée par « type », plus « commune » et « position » ; trois lieux publics de la base (Puydarrieux, Bagnères-de-Bigorre ×2), Pau sortie, aucune personne.
- Type « personne » : prénom seul, ni adresse ni lien, posé au centre de Bagnères-de-Bigorre (REGROUPEMENT), sinon le build s'arrête.
- Épingles en divIcon (boutons de 44 px), keyboard: false sur les marqueurs, un seul arrêt de tabulation et les flèches ; panneau d'un lieu ; légende en panneau bas ; Échap rend le focus.
- tests/xl-epingles.test.ts repris dans tests/xl-v1.test.ts (9 cas).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWGVn2UNwGqueVvbjxnWNc
2026-11-11 10:46:54 +01:00

35 lines
4.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Les pictogrammes de la carte du territoire (lot ⑥b, 11/11/2026, retour de Jules du 07/11 : « une légende assez cool avec
// tous les différents logos : la maison de la nature, c'est un arbre ; l'hôpital, le symbole H ; le Végétal local du
// Conservatoire botanique, une feuille »). Dessinés ici en SVG, dans le trait de maquette/pictos.js (un rond blanc cerclé
// de la teinte, un dessin au trait de 2,4) ; aucune image, aucune police. Fichier pur : la table content/xl-types.md
// nomme un pictogramme de cette liste et une teinte de la palette (vérifié au build).
/** Les teintes permises : les clés de `COULEURS` (maquette/pictos.js ; un test vérifie qu'elles y sont toutes). */
export const TEINTES_XL = ['eau', 'vivant', 'energie', 'transport', 'quartier', 'habiter', 'faire', 'accueil', 'auj'] as const;
const t = (c: string) => `fill="none" stroke="${c}" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"`;
/** Le dessin de chaque pictogramme (viewBox 56 × 56, dans le rond), en fonction de la couleur du trait. */
export const PICTOS_XL: Readonly<Record<string, (c: string) => string>> = {
arbre: (c) => `<path d="M28 44V30" ${t(c)}/><path d="M28 31c-8 0-12-5-12-10 0-4 3-7 6-7 1-4 4-6 6-6s5 2 6 6c3 0 6 3 6 7 0 5-4 10-12 10z" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M28 36l-5-4M28 33l5-4" ${t(c)}/><path d="M19 44h18" ${t(c)}/>`,
h: (c) => `<rect x="15" y="15" width="26" height="26" rx="5" fill="${c}" fill-opacity=".14" stroke="${c}" stroke-width="2.4"/><path d="M22 20v16M34 20v16M22 28h12" fill="none" stroke="${c}" stroke-width="3.4" stroke-linecap="round"/>`,
feuille: (c) => `<path d="M15 41C15 25 25 15 42 14c0 17-10 27-27 27z" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M15 41l18-18M23 33h-5M29 27v-5M27 29h6" ${t(c)}/>`,
haie: (c) => `<path d="M10 40h36" ${t(c)}/><path d="M12 40c-1-6 2-11 7-11s8 5 7 11M24 40c-1-8 3-14 8-14s9 6 8 14M38 40c0-5 2-8 5-8" fill="${c}" fill-opacity=".16" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/>`,
goutte: (c) => `<path d="M28 13c6 9 11 15 11 21a11 11 0 0 1-22 0c0-6 5-12 11-21z" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M23 35a5 5 0 0 0 5 5" ${t(c)}/>`,
eclair: (c) => `<path d="M31 12L18 31h10l-3 13 13-19H28l3-13z" fill="${c}" fill-opacity=".2" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/>`,
panier: (c) => `<path d="M13 26h30l-4 15H17z" fill="${c}" fill-opacity=".16" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M20 26l5-10M36 26l-5-10M22 31v6M28 31v6M34 31v6" ${t(c)}/>`,
outil: (c) => `<path d="M18 40l14-14" fill="none" stroke="${c}" stroke-width="3.4" stroke-linecap="round"/><path d="M27 17l9-3 6 6-3 9-5-2-5-5z" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/>`,
livre: (c) => `<path d="M28 19c-4-3-9-4-14-3v22c5-1 10 0 14 3 4-3 9-4 14-3V16c-5-1-10 0-14 3z" fill="${c}" fill-opacity=".14" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M28 19v22" ${t(c)}/>`,
reseau: (c) => `<path d="M28 18l-10 18h20z" ${t(c)}/><circle cx="28" cy="17" r="5" fill="#fff" stroke="${c}" stroke-width="2.4"/><circle cx="17" cy="37" r="5" fill="#fff" stroke="${c}" stroke-width="2.4"/><circle cx="39" cy="37" r="5" fill="#fff" stroke="${c}" stroke-width="2.4"/>`,
mairie: (c) => `<path d="M13 24l15-9 15 9z" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/><path d="M17 27v11M23 27v11M33 27v11M39 27v11M12 41h32" ${t(c)}/>`,
drapeau: (c) => `<path d="M18 44V13" ${t(c)}/><path d="M18 14h20l-4 6 4 6H18z" fill="${c}" fill-opacity=".2" stroke="${c}" stroke-width="2.4" stroke-linejoin="round"/>`,
personne: (c) => `<circle cx="28" cy="21" r="6" fill="${c}" fill-opacity=".18" stroke="${c}" stroke-width="2.4"/><path d="M16 42c0-7 5-12 12-12s12 5 12 12" fill="${c}" fill-opacity=".14" stroke="${c}" stroke-width="2.4" stroke-linecap="round"/>`,
};
export const NOMS_PICTOS_XL = Object.keys(PICTOS_XL);
/** Le pictogramme complet : le rond blanc cerclé de la teinte, puis le dessin. `aria-hidden` : le texte est ailleurs. */
export function pictoXl(nom: string, couleur: string): string {
const d = PICTOS_XL[nom];
if (!d) throw new Error(`pictogramme « ${nom} » inconnu`);
return `<svg viewBox="0 0 56 56" aria-hidden="true" focusable="false"><circle cx="28" cy="28" r="25" fill="#fff" stroke="${couleur}" stroke-width="2.5"/>${d(couleur)}</svg>`;
}