Files
wibosim/server/public/js/logos.js
T
db9979andClaude Opus 5.5 214c6c9e0b Umbau: toten Code entfernt – ungenutzte Exporte, Importe und Variablen
Nirgends benutzte Exporte: ETF_SYMBOLS, ONB_BY_ID (samt BY_ID), outlookWord,
OUTLOOK_LABEL, storyFor, ART_NAMES, delistedLine, inboxFolders, showFormer,
poolSvg, catOf, portraitOpen, splashOpen. Ungenutzte Importnamen in 10
Client-Modulen, CLASS_ORDER (trade.js), known (stage.js), TAU (wheat.js),
p (mcp.js) und die lokale Bindung energyFeed (index.js, ctx.energyFeed bleibt).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018i4GUhQVoPUusUzxgxLWkK
2026-12-05 12:41:12 +00:00

342 lines
30 KiB
JavaScript
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.
// Logos der fiktiven Firmen und Anlageklassen: je eine Bildmarke auf farbiger Platte (40er-Raster).
// Die Symbole werden bei Bedarf einmal in ein verstecktes SVG-Sprite geschrieben und per <use> eingebunden –
// so bleibt das Markup in Listen klein. Börsenneulinge (IPO) bekommen eine Marke aus dem Logo-Pool ihrer Branche
// (logopool.js, vergeben vom Server) oder – ist der Pool erschöpft – ein deterministisch erzeugtes Logo.
// Alle Marken sind für WiBoSim erfunden.
import { POOL, isPoolKey, SECTOR_COLORS, SECTOR_GLYPH } from './logopool.js';
const W = '#fff';
const plate = (c) => `<rect width="40" height="40" rx="10" fill="${c}"/>`;
const edge = (light) => `<rect x=".5" y=".5" width="39" height="39" rx="9.5" fill="none" stroke="${light ? '#000' : '#fff'}" stroke-opacity="${light ? '.1' : '.14'}"/>`;
const st = (w, c = W, o = 1) => `fill="none" stroke="${c}" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round"${o < 1 ? ` stroke-opacity="${o}"` : ''}`;
const fo = (c = W, o = 1) => `fill="${c}"${o < 1 ? ` fill-opacity="${o}"` : ''}`;
/** ETF-Marke: Ring aus vier Segmenten (der Korb) mit Kürzel */
function etfMark(t) {
const r = 12.5, c = 2 * Math.PI * r, seg = c / 4, gap = 2.2;
const ring = [1, 0.75, 0.5, 0.3].map((o, i) => `<circle cx="20" cy="20" r="${r}" ${st(4.2, W, o).replace('stroke-linecap="round"', 'stroke-linecap="butt"')} stroke-dasharray="${(seg - gap).toFixed(2)} ${(c - seg + gap).toFixed(2)}" stroke-dashoffset="${(-i * seg).toFixed(2)}" transform="rotate(-90 20 20)"/>`).join('');
return `${ring}<text x="20" y="${t.length > 1 ? 23.6 : 24.4}" text-anchor="middle" font-family="system-ui,-apple-system,'Segoe UI',Roboto,sans-serif" font-size="${t.length > 1 ? 10 : 12}" font-weight="800" fill="#fff">${t}</text>`;
}
// [Plattenfarbe, Bildmarke, helle Platte?]
const MARKS = {
// ---------------------------------------------------------------- Aktien
// Novalith: schlanker Monolith als Prisma
NVLT: ['#4F46E5', `<path ${fo()} d="M20 6.5 27.5 10.5 20 14.5 12.5 10.5z"/><path ${fo(W, 0.78)} d="M12.5 11.6 19.4 15.3V33.8L12.5 29.6z"/><path ${fo(W, 0.48)} d="M27.5 11.6 20.6 15.3V33.8l6.9-4.2z"/>`],
// Quantbit: Ring mit Bit-Quadrat als Q
QBIT: ['#0F766E', `<circle cx="19" cy="19" r="9" ${st(4.2)}/><circle cx="19" cy="19" r="2.6" ${fo(W, 0.6)}/><rect x="24.5" y="24.5" width="8" height="8" rx="1.8" ${fo()}/>`],
// Helion: Sonne über dem Horizont
HLIO: ['#EA580C', `<path ${fo()} d="M11.5 24.5a8.5 8.5 0 0 1 17 0z"/><path ${st(2.6)} d="M20 8.5v3M9.2 13.2l2.1 2.1M30.8 13.2l-2.1 2.1M5.5 24.5h29"/><path ${st(2.6, W, 0.7)} d="M11 29.5h18"/><path ${st(2.6, W, 0.45)} d="M15.5 34h9"/>`],
// Voltwerk: Blitz im Motorring
VOLT: ['#18181B', `<circle cx="20" cy="20" r="13" ${st(2.2, '#FACC15', 0.45)}/><path fill="#FACC15" d="M22.5 6.5 12.5 22h7l-3 11.5 11-15.5h-7l2-11.5z"/>`],
// Rheinbank: Dach über dem Fluss
RHBK: ['#1E3A8A', `<path ${st(3.2)} d="M9 17.5 20 9.5l11 8"/><path ${st(2.6)} d="M9 23.5q2.75-2.6 5.5 0t5.5 0 5.5 0 5.5 0"/><path ${st(2.6, W, 0.6)} d="M9 29.5q2.75-2.6 5.5 0t5.5 0 5.5 0 5.5 0"/>`],
// Medexa: vier Blätter als X
MEDX: ['#059669', `<g transform="rotate(45 20 20)"><rect x="16.4" y="6.5" width="7.2" height="11.5" rx="3.6" ${fo()}/><rect x="16.4" y="22" width="7.2" height="11.5" rx="3.6" ${fo()}/><rect x="22" y="16.4" width="11.5" height="7.2" rx="3.6" ${fo(W, 0.62)}/><rect x="6.5" y="16.4" width="11.5" height="7.2" rx="3.6" ${fo(W, 0.62)}/></g>`],
// Kaufrausch: Tragetasche mit Funkeln
KRMA: ['#E11D48', `<path ${st(2.6)} d="M15.5 15v-2.5a4.5 4.5 0 0 1 9 0V15"/><path ${fo()} d="M10.5 15h19l-1.4 16.3a2.2 2.2 0 0 1-2.2 2H14.1a2.2 2.2 0 0 1-2.2-2z"/><path fill="#E11D48" d="M20 19.2c.5 3 1.6 4.1 4.6 4.6-3 .5-4.1 1.6-4.6 4.6-.5-3-1.6-4.1-4.6-4.6 3-.5 4.1-1.6 4.6-4.6z"/>`],
// Stahlhafen: Doppel-T-Träger in Perspektive
STHL: ['#475569', `<path ${fo()} d="M9 8.5h22v4.6h-8.2v13.8H31v4.6H9v-4.6h8.2V13.1H9z"/><path fill="#475569" fill-opacity=".3" d="M22.8 13.1 31 8.5v4.6zM22.8 26.9 31 31.5v-4.6z"/>`],
// Aegis: Schild mit Winkeln
AEGS: ['#4D5B2E', `<path ${fo(W, 0.16)} ${st(2.6).replace('fill="none" ', '')} d="M20 6.5 31 10.5v8.3c0 7-4.6 12.4-11 14.2-6.4-1.8-11-7.2-11-14.2v-8.3z"/><path ${st(3.2)} d="M14 16.5l6 4.5 6-4.5"/><path ${st(3.2, W, 0.6)} d="M15 22.5l5 3.7 5-3.7"/>`],
// Grünhain: Blatt mit H₂-Perlen
GRNH: ['#2F9E44', `<path ${fo()} d="M9.5 30C9.5 17.5 16.5 9.5 30.5 9.5c0 13.5-7.5 20.5-21 20.5z"/><path ${st(2, '#2F9E44')} d="M10 29.5l13-13"/><circle cx="27.5" cy="27" r="3" ${fo(W, 0.75)}/><circle cx="32" cy="32" r="1.9" ${fo(W, 0.55)}/>`],
// Pixelhain: Pixelbaum
PIXL: ['#7C3AED', (() => {
const s = 4.6, g = 0.9, x0 = 20 - 2.5 * s - 2 * g, y0 = 7.5;
const px = (c, r, o = 1) => `<rect x="${(x0 + c * (s + g)).toFixed(2)}" y="${(y0 + r * (s + g)).toFixed(2)}" width="${s}" height="${s}" rx="1" ${fo(W, o)}/>`;
return [px(2, 0), px(1, 1), px(2, 1), px(3, 1, 0.65), px(0, 2), px(1, 2), px(2, 2, 0.65), px(3, 2), px(4, 2, 0.65), px(2, 3), px(2, 4, 0.65)].join('');
})()],
// Sensorik Nordwerk: Messwellen
SNSR: ['#0891B2', `<circle cx="12" cy="28" r="3.2" ${fo()}/><path ${st(2.8)} d="M12 20a8 8 0 0 1 8 8"/><path ${st(2.8, W, 0.72)} d="M12 14a14 14 0 0 1 14 14"/><path ${st(2.8, W, 0.45)} d="M12 8a20 20 0 0 1 20 20"/>`],
// Nordwind: Windrad über Wellen
NRDW: ['#075985', `<path ${st(2.4)} d="M20 18v13"/><g ${fo()}><path d="M20 16.5c-1.6-2.7-1.9-6.4-.7-9.6a1.4 1.4 0 0 1 1.7 0c.9 3.3.6 6.6-1 9.6z"/><path transform="rotate(120 20 16.6)" d="M20 16.5c-1.6-2.7-1.9-6.4-.7-9.6a1.4 1.4 0 0 1 1.7 0c.9 3.3.6 6.6-1 9.6z"/><path transform="rotate(240 20 16.6)" d="M20 16.5c-1.6-2.7-1.9-6.4-.7-9.6a1.4 1.4 0 0 1 1.7 0c.9 3.3.6 6.6-1 9.6z"/></g><circle cx="20" cy="16.6" r="2" fill="#075985" stroke="#fff" stroke-width="1.6"/><path ${st(2.2, W, 0.55)} d="M8 33.5q3-2.4 6 0t6 0 6 0 6 0"/>`],
// Radler Mobility: Rad in Bewegung
RADL: ['#A3E635', `<circle cx="23" cy="20" r="9.2" ${st(3.2, '#1A2E05')}/><circle cx="23" cy="20" r="2.4" fill="#1A2E05"/><path ${st(2.6, '#1A2E05')} d="M5.5 15.5h5M4.5 20.5h6M6.5 25.5h4"/>`, true],
// Kessler Zulieferwerke: Zahnrad mit Nabe
ZULF: ['#57534E', `<path ${fo()} fill-rule="evenodd" d="M17.6 8.3 18 5.2h4l.4 3.1 3 1.2 2.5-1.9 2.8 2.8-1.9 2.5 1.2 3 3.1.4v4l-3.1.4-1.2 3 1.9 2.5-2.8 2.8-2.5-1.9-3 1.2-.4 3.1h-4l-.4-3.1-3-1.2-2.5 1.9-2.8-2.8 1.9-2.5-1.2-3-3.1-.4v-4l3.1-.4 1.2-3-1.9-2.5 2.8-2.8 2.5 1.9zM20 15a5 5 0 1 0 0 10 5 5 0 0 0 0-10z"/><circle cx="20" cy="20" r="2.4" fill="#FB923C"/>`],
// Hanse Versicherung: Kogge
HNSA: ['#9F1239', `<path ${st(2.2)} d="M20 7v19"/><path ${fo()} d="M20 7l5 1.7L20 10.4z"/><path ${fo(W, 0.92)} d="M12.5 11.5h15c.9 3.8.9 7.6 0 11.5h-15c-.9-3.9-.9-7.7 0-11.5z"/><path ${fo()} d="M8 26.5h24l-3.6 6.5H11.6z"/>`],
// Fintaxo: doppelter Pfeil für schnelle Zahlungen
FNTX: ['#0B1220', `<path ${st(4.2, '#34D399', 0.55)} d="M11 12l8 8-8 8"/><path ${st(4.2, '#34D399')} d="M20 12l8 8-8 8"/>`],
// Biovara: Doppelhelix
BIOV: ['#C026D3', `<path ${st(1.8, W, 0.7)} d="M15.6 9.6h8.8M13.6 20h12.8M15.6 30.4h8.8"/><path ${st(2.8, W, 0.6)} d="M26 6.5c0 6.8-12 6.7-12 13.5S26 26.7 26 33.5"/><path ${st(2.8)} d="M14 6.5c0 6.8 12 6.7 12 13.5S14 26.7 14 33.5"/>`],
// Vitalis Generika: Kapsel
VITA: ['#0284C7', `<g transform="rotate(-45 19 21)"><path ${fo()} d="M14 16h5v10h-5a5 5 0 0 1 0-10z"/><path ${fo(W, 0.55)} d="M19.8 16H24a5 5 0 0 1 0 10h-4.2z"/></g><path ${st(2.2)} d="M29.5 7.5v6M26.5 10.5h6"/>`],
// Kronquell: Krone über der Quelle
BRAU: ['#B45309', `<path fill="#FEF3C7" d="M11 17.5 12.3 8.5l4.6 4L20 7l3.1 5.5 4.6-4L29 17.5z"/><path fill="#FEF3C7" d="M20 20.5c3.1 3.6 4.6 6.1 4.6 8.2a4.6 4.6 0 0 1-9.2 0c0-2.1 1.5-4.6 4.6-8.2z"/>`],
// Baukraft: Ziegel unter dem Dach
BAUW: ['#FBBF24', `<path ${st(2.8, '#1C1917')} d="M9 15 20 8.5 31 15"/><g fill="#1C1917"><rect x="15.6" y="17.5" width="8.8" height="4.6" rx=".9"/><rect x="10.8" y="23.4" width="8.6" height="4.6" rx=".9"/><rect x="20.6" y="23.4" width="8.6" height="4.6" rx=".9"/><rect x="6" y="29.3" width="8.6" height="4.6" rx=".9"/><rect x="15.7" y="29.3" width="8.6" height="4.6" rx=".9"/><rect x="25.4" y="29.3" width="8.6" height="4.6" rx=".9"/></g>`, true],
// Robotik Alpen: Roboterarm
ROBO: ['#2563EB', `<path ${st(3)} d="M8.5 32.5h12"/><path ${st(3.4)} d="M14.5 29.5 18.5 16l10.5-1"/><path ${st(2.4)} d="M29 15l3.5-3.5M29 15l3.5 3.5"/><g ${fo()}><circle cx="14.5" cy="29" r="3"/><circle cx="18.5" cy="16" r="3"/></g><g fill="#2563EB"><circle cx="14.5" cy="29" r="1.1"/><circle cx="18.5" cy="16" r="1.1"/></g>`],
// Orbitum: Planet mit Umlaufbahn
ORBT: ['#1E1B4B', `<circle cx="19" cy="21" r="7" ${fo()}/><g transform="rotate(-18 19 21)"><path ${st(4.4, '#1E1B4B')} d="M5 21a14 4.6 0 0 0 28 0"/><path ${st(2, W, 0.85)} d="M5 21a14 4.6 0 0 0 28 0M5 21a14 4.6 0 0 1 9.2-4.4M23.8 16.6A14 4.6 0 0 1 33 21"/></g><path fill="#FCD34D" d="M31 6.5c.4 2.4 1.1 3.1 3.5 3.5-2.4.4-3.1 1.1-3.5 3.5-.4-2.4-1.1-3.1-3.5-3.5 2.4-.4 3.1-1.1 3.5-3.5z"/>`],
// ---------------------------------------------------------------- Anlageklassen
// Gold: gestapelte Barren
GOLD: ['#2B2112', (() => {
const bar = (x, y) => `<path fill="#E8A317" stroke="#E8A317" stroke-width="1" stroke-linejoin="round" d="M${x} ${y + 6.5}l2.4-6.5h9.2l2.4 6.5z"/><path fill="#FDE68A" d="M${x + 2.75} ${y + 0.5}h8.5l.75 2h-10z"/>`;
return bar(5.5, 25) + bar(20.5, 25) + bar(13, 16.5);
})()],
// Rohöl: Fass mit Tropfen
OEL: ['#1F2937', `<path fill="#E5E7EB" d="M12.2 8.5h15.6c1.3 3.8 1.9 7.6 1.9 11.5s-.6 7.7-1.9 11.5H12.2c-1.3-3.8-1.9-7.6-1.9-11.5s.6-7.7 1.9-11.5z"/><path ${st(1.6, '#1F2937')} d="M10.8 14h18.4M10.8 26h18.4"/><path fill="#F59E0B" d="M20 15.6c2 2.5 3 4.1 3 5.5a3 3 0 0 1-6 0c0-1.4 1-3 3-5.5z"/>`],
// Erdgas: Flamme
GAS: ['#1D4ED8', `<path ${fo()} d="M20 33.5c-6 0-10-4.1-10-9.7 0-5 3.4-8.3 5.6-11.6.6 2.4 1.8 4.1 3.5 4.9.2-4.6 1.9-8.4 4.6-10.9.9 4.9 6.3 8.9 6.3 16.6 0 6.6-4.1 10.7-10 10.7z"/><path fill="#60A5FA" d="M20 33.5c-2.5 0-4.2-1.8-4.2-4.3 0-2.8 2.1-4.4 4.2-7 2.1 2.6 4.2 4.2 4.2 7 0 2.5-1.7 4.3-4.2 4.3z"/>`],
// Weizen: Ähre mit Körnern (Team Märkte)
WEIZ: ['#A16207', (() => {
const grain = (y, side, o = 1) => `<ellipse cx="${side < 0 ? 16.6 : 23.4}" cy="${y}" rx="2.6" ry="4.1" transform="rotate(${side < 0 ? -32 : 32} ${side < 0 ? 16.6 : 23.4} ${y})" ${fo('#FDE68A', o)}/>`;
return `<path ${st(2.2, '#FDE68A')} d="M20 34V10"/>${[13, 18.5, 24].map((y, i) => grain(y, -1, 1 - i * 0.12) + grain(y, 1, 0.88 - i * 0.12)).join('')}<ellipse cx="20" cy="8.6" rx="2.4" ry="3.8" ${fo('#FEF3C7')}/>`;
})()],
// WiboCoin: Münze mit W
WIBC: ['#2E1065', `<circle cx="20" cy="20" r="13" fill="#9333EA"/><circle cx="20" cy="20" r="10.6" ${st(1.4, '#E9D5FF', 0.55)}/><path ${st(2.8)} d="M13.2 15.2l3 10 3.8-7 3.8 7 3-10"/><path ${st(2)} d="M20 8.6v2.6M20 28.8v2.6"/>`],
// US-Dollar
USD: ['#14532D', `<circle cx="20" cy="20" r="12.5" ${st(2, '#BBF7D0', 0.7)}/><path ${st(2.7)} d="M24.4 15.6c-.8-1.6-2.4-2.4-4.4-2.4-2.5 0-4.3 1.3-4.3 3.2 0 4.5 9.1 2.5 9.1 7.1 0 2-1.9 3.3-4.8 3.3-2 0-3.7-.9-4.6-2.5M20 10.5v19"/>`],
// Anleihen: Wappen der Republik Wiborien
// ---------------------------------------------------------------- ab Version 0.25: Mid Caps
// Weitblick: Funkmast mit Wellen
WBTK: ['#BE123C', `<path ${st(2.6)} d="M20 15v18M15 33h10M16.5 33 20 15l3.5 18"/><circle cx="20" cy="13" r="2.6" ${fo()}/><path ${st(2.2, W, 0.8)} d="M13.5 9a9 9 0 0 0 0 8M26.5 9a9 9 0 0 1 0 8"/><path ${st(2.2, W, 0.5)} d="M9.5 6.5a13 13 0 0 0 0 13M30.5 6.5a13 13 0 0 1 0 13"/>`],
// Wohnwerk: drei Hausgiebel
WOHN: ['#B45309', `<path ${fo(W, 0.55)} d="M6 31V20l6-5 6 5v11z"/><path ${fo(W, 0.75)} d="M22 31V20l6-5 6 5v11z"/><path ${fo()} d="M12 32V17l8-7 8 7v15z"/><rect x="18" y="24" width="4" height="8" rx="1" fill="#B45309"/>`],
// Stadtwerke Verbund: Tropfen mit Blitz
STWK: ['#0369A1', `<path ${fo()} d="M20 6c5.5 7 9 11.5 9 16a9 9 0 0 1-18 0c0-4.5 3.5-9 9-16z"/><path fill="#0369A1" d="M21.5 15 16 24h4l-1.5 6 5.5-9h-4z"/>`],
// Frachtwerk: gestapelte Container
FRHT: ['#C2410C', `<rect x="7" y="21" width="12.5" height="9" rx="1.4" ${fo()}/><rect x="20.5" y="21" width="12.5" height="9" rx="1.4" ${fo(W, 0.7)}/><rect x="13.75" y="11" width="12.5" height="9" rx="1.4" ${fo(W, 0.85)}/><path ${st(1.4, '#C2410C')} d="M10.5 23v5M13.25 23v5M16 23v5M24 23v5M26.75 23v5M29.5 23v5"/>`],
// Chemiepark Rheinau: Erlenmeyerkolben mit Blase
CHMX: ['#4D7C0F', `<path ${fo()} d="M16.5 8h7v8.5l7.5 12.5a2.6 2.6 0 0 1-2.2 3.9H11.2A2.6 2.6 0 0 1 9 29l7.5-12.5z"/><path fill="#4D7C0F" d="M13 26h14l1.8 3.2H11.2z" fill-opacity=".45"/><circle cx="22.5" cy="24" r="1.6" fill="#4D7C0F"/><path ${st(2.2)} d="M15 8h10"/>`],
// Heilwerk: Kreuz im Herz
HLWK: ['#DC2626', `<path ${fo()} d="M20 32.5S7 25 7 15.8A6.3 6.3 0 0 1 20 12a6.3 6.3 0 0 1 13 3.8C33 25 20 32.5 20 32.5z"/><path fill="#DC2626" d="M18 14.5h4v4h4v4h-4v4h-4v-4h-4v-4h4z"/>`],
// Aurum Medien: Bildschirm mit Play-Dreieck
AURM: ['#A16207', `<rect x="6.5" y="9" width="27" height="18" rx="3" ${fo()}/><path fill="#A16207" d="M17.5 13.5v9l7.5-4.5z"/><path ${st(2.4)} d="M14 32h12M20 27v5"/>`],
// Feinmed: Pinzette und Punkt
FNMD: ['#0E7490', `<path ${st(3)} d="M12 8l7 22M28 8l-7 22"/><path ${st(3)} d="M19 30h2"/><circle cx="20" cy="13" r="3.2" ${fo(W, 0.7)}/>`],
// Feldkraft: Ähre
FLDK: ['#65A30D', `<path ${st(2.4)} d="M20 33V9"/><g ${fo()}><ellipse cx="16.3" cy="14" rx="2.6" ry="4.2" transform="rotate(-30 16.3 14)"/><ellipse cx="23.7" cy="14" rx="2.6" ry="4.2" transform="rotate(30 23.7 14)"/><ellipse cx="16.3" cy="21" rx="2.6" ry="4.2" transform="rotate(-30 16.3 21)"/><ellipse cx="23.7" cy="21" rx="2.6" ry="4.2" transform="rotate(30 23.7 21)"/></g><ellipse cx="20" cy="8.5" rx="2.2" ry="3.4" ${fo(W, 0.8)}/>`],
// ---------------------------------------------------------------- Small Caps
// Bastionix: Burgzinne als Schild
BSTX: ['#312E81', `<path ${fo()} d="M9 8h5v4h4V8h4v4h4V8h5v12c0 6.5-4.6 10.8-11 12.5C13.6 30.8 9 26.5 9 20z"/><path fill="#312E81" d="M18 19.5a2 2 0 1 1 4 0v4h-4z"/>`],
// Platinenbau: Leiterbahnen
PLTN: ['#166534', `<rect x="13" y="13" width="14" height="14" rx="2" ${fo()}/><path ${st(2)} d="M17 13V7M23 13V7M17 27v6M23 27v6M13 17H7M13 23H7M27 17h6M27 23h6"/><circle cx="20" cy="20" r="2.4" fill="#166534"/>`],
// Wellenreich: drei Wellen
WLLE: ['#1D4ED8', `<path ${st(3)} d="M7 14q3.25-4 6.5 0t6.5 0 6.5 0 6.5 0"/><path ${st(3, W, 0.75)} d="M7 21q3.25-4 6.5 0t6.5 0 6.5 0 6.5 0"/><path ${st(3, W, 0.5)} d="M7 28q3.25-4 6.5 0t6.5 0 6.5 0 6.5 0"/>`],
// Glasfaser Hügelland: Lichtleiter über Hügeln
GLSF: ['#7C3AED', `<path ${fo(W, 0.35)} d="M4 33c5-8 10-8 14-4 4-7 11-9 18-1v5z"/><path ${st(2.4)} d="M8 24C14 10 26 10 32 24"/><path ${st(2.4, W, 0.7)} d="M12 24c4-8 12-8 16 0"/><circle cx="20" cy="12.5" r="2.4" ${fo()}/>`],
// Quartierbau: Hochhäuser
QRTR: ['#9A3412', `<rect x="8" y="16" width="7" height="17" rx="1" ${fo(W, 0.7)}/><rect x="16.5" y="8" width="7" height="25" rx="1" ${fo()}/><rect x="25" y="13" width="7" height="20" rx="1" ${fo(W, 0.85)}/><path ${st(1.6, '#9A3412')} d="M18.5 12h3M18.5 16h3M18.5 20h3M18.5 24h3"/>`],
// Hallenwert: Lagerhalle mit Tor
HALW: ['#57534E', `<path ${fo()} d="M6 17 20 9l14 8v15H6z"/><rect x="13" y="21" width="14" height="11" fill="#57534E"/><path ${st(1.6)} d="M13 24.5h14M13 28h14"/>`],
// Brunnwerk: Tropfen im Kreis
BRWK: ['#0284C7', `<circle cx="20" cy="20" r="13" ${st(2.4, W, 0.5)}/><path ${fo()} d="M20 9.5c4 5 6.5 8.3 6.5 11.5a6.5 6.5 0 0 1-13 0c0-3.2 2.5-6.5 6.5-11.5z"/><path ${st(1.8, '#0284C7')} d="M17 21.5a3 3 0 0 0 3 3"/>`],
// Wärmenetz Süd: Flamme über Rohr
WMNT: ['#B91C1C', `<path ${fo()} d="M20 6c1.5 4.5 6.5 6.5 6.5 12.5a6.5 6.5 0 0 1-13 0c0-3 1.6-4.8 3.2-6.4.2 2 1 3.2 2.4 3.6C18.6 12.5 19 9 20 6z"/><rect x="7" y="28" width="26" height="5" rx="2.5" ${fo(W, 0.6)}/>`],
// Kanalfracht: Schiffsrumpf auf Wellen
KRFT: ['#155E75', `<path ${fo()} d="M7 21h26l-3.5 7h-19z"/><rect x="12" y="14" width="6" height="7" ${fo(W, 0.75)}/><rect x="19" y="11" width="7" height="10" ${fo(W, 0.9)}/><path ${st(2, W, 0.6)} d="M6 32q3.5-2.5 7 0t7 0 7 0 7 0"/>`],
// Luftfracht Ostkreuz: Flugzeug mit Paket
LFTX: ['#1E40AF', `<path ${fo()} d="M33 9.5 7 18.5l9 3.5 2 9 4.5-6.5 6 3.5z"/><path fill="#1E40AF" d="m16 22 10-8-7.5 9.5z"/>`],
// Paketbote: Paket mit Pfeil
PKTB: ['#CA8A04', `<path ${fo()} d="M20 7 32 13v14l-12 6-12-6V13z"/><path ${st(2, '#CA8A04')} d="M8 13l12 6 12-6M20 19v14"/><path ${st(2, '#CA8A04', 0.6)} d="M14 10l12 6"/>`],
// Streamwerk: Play im Ring
STRM: ['#BE185D', `<circle cx="20" cy="20" r="12.5" ${st(3)}/><path ${fo()} d="M17 14v12l9.5-6z"/>`],
// Funkhaus Abendstern: Stern mit Mikrofon-Bogen
ABST: ['#4C1D95', `<path ${fo()} d="M20 7l2.9 6.4 7 .7-5.2 4.7 1.5 6.9L20 22.2l-6.2 3.5 1.5-6.9-5.2-4.7 7-.7z"/><path ${st(2.4, W, 0.7)} d="M11 26a11 9 0 0 0 18 0M20 31v3"/>`],
// Verlagshaus Lindenblatt: aufgeschlagenes Buch mit Blatt
VRLG: ['#14532D', `<path ${fo()} d="M6 12c5-2 10-1.5 13.3 1.5V32C16 29 11 28.5 6 30z"/><path ${fo(W, 0.7)} d="M34 12c-5-2-10-1.5-13.3 1.5V32C24 29 29 28.5 34 30z"/><path fill="#14532D" d="M12.5 18c2.5-2 5-1.5 5.5 1-2.5 2-5 1.5-5.5-1z"/>`],
// Farbwerk Lackmann: Farbtropfen in drei Tönen
LACK: ['#0F172A', `<path fill="#F43F5E" d="M12 9c3 4 5 6.4 5 8.8a5 5 0 0 1-10 0C7 15.4 9 13 12 9z"/><path fill="#FACC15" d="M28 9c3 4 5 6.4 5 8.8a5 5 0 0 1-10 0c0-2.4 2-4.8 5-8.8z"/><path fill="#38BDF8" d="M20 18c3 4 5 6.4 5 8.8a5 5 0 0 1-10 0c0-2.4 2-4.8 5-8.8z"/>`],
// Salzstock Kalimont: Berg mit Kristall
KALI: ['#7F1D1D', `<path ${fo(W, 0.55)} d="M3 33 15 13l6 9 4-5 12 16z"/><path ${fo()} d="M20 8l5 5-5 9-5-9z"/><path ${st(1.4, '#7F1D1D')} d="M15 13h10M20 8v14"/>`],
// Glashütte Silberau: Facettenglas
SLBR: ['#475569', `<path ${fo(W, 0.45)} d="M13 7h14l3 8-10 18-10-18z"/><path ${fo()} d="M13 7h14l-7 8z"/><path ${fo(W, 0.75)} d="M10 15h20L20 33z"/>`],
// Pflegewerk: helfende Hand mit Herz
PFLG: ['#0D9488', `<path ${fo()} d="M6 25.5h7l7 4 9-5.5a2.3 2.3 0 0 0-2.3-4L21 22.5h-5.5l5.2-1.6a2.2 2.2 0 0 0-1.3-4.2L12 18.5H6z"/><path ${fo(W, 0.85)} d="M25 15.8S19.5 12.6 19.5 9a2.6 2.6 0 0 1 5.5-1 2.6 2.6 0 0 1 5.5 1c0 3.6-5.5 6.8-5.5 6.8z"/>`],
// Diagnostik Elbtal: Reagenzglas mit Pulslinie
DIAG: ['#0F766E', `<path ${fo()} d="M15 7h10v4h-1.5v16a3.5 3.5 0 0 1-7 0V11H15z"/><path fill="#0F766E" fill-opacity=".5" d="M16.5 20h7v7a3.5 3.5 0 0 1-7 0z"/><path ${st(2, W, 0.7)} d="M4 20h4l2-4 3 8 1.5-4H16M24 20h1.5l2-3 2 6 1.5-3H36"/>`],
// Osteon: Knochen
OSTE: ['#1E293B', `<path ${fo()} d="M12.5 8a4 4 0 0 1 4 4.6l7 7a4 4 0 1 1 3.3 6.4 4 4 0 1 1-6.4 3.3l-7-7A4 4 0 1 1 8 13.6a4 4 0 0 1 4.5-5.6z" transform="rotate(0)"/>`],
// Zellpfad: Zelle mit Kern auf einem Pfad
ZLPF: ['#9D174D', `<circle cx="20" cy="17" r="9.5" ${fo(W, 0.35)}/><circle cx="20" cy="17" r="9.5" ${st(2.2)}/><circle cx="21.5" cy="15.5" r="3.4" ${fo()}/><path ${st(2.4, W, 0.75)} d="M8 33c4-4 8 2 12-2s8 2 12-2"/>`],
// Solarfeld: Solarmodul unter Sonne
SOLR: ['#D97706', `<circle cx="27.5" cy="11" r="4.5" ${fo()}/><path ${fo(W, 0.9)} d="M6 31l4-12h18l-4 12z"/><path ${st(1.4, '#D97706')} d="M8 25h18M15.3 19l-2.6 12M21.3 19l-2.6 12"/>`],
// Möbelwerk Schwarzbach: Stuhl
MOEB: ['#78350F', `<path ${fo()} d="M12 7h5v14h12v4H12z"/><path ${st(2.8)} d="M13.5 25v8M27.5 25v8"/><path ${fo(W, 0.6)} d="M12 7h5v4h-5z"/>`],
// Gipfelstürmer: zwei Gipfel mit Fahne
GPFL: ['#15803D', `<path ${fo()} d="M3 33 15 12l7 11 4-6 11 16z"/><path fill="#15803D" d="m15 12 3.5 6-2 .5-1.5-2-1.5 2-2-.5z"/><path ${st(1.8)} d="M15 12V5"/><path fill="#FDE047" d="M15 5h6l-2 2 2 2h-6z"/>`],
// Ventilbau Odenwald: Ventilrad
VNTL: ['#334155', `<circle cx="20" cy="17" r="9" ${st(3)}/><path ${st(2.6)} d="M20 8v18M11 17h18"/><circle cx="20" cy="17" r="3" ${fo()}/><path ${fo(W, 0.7)} d="M14 29h12v4H14z"/>`],
// Boddenwerft: Bug mit Anker
BDWF: ['#1E3A8A', `<path ${st(2.6)} d="M20 9v20M14 14h12"/><circle cx="20" cy="7.5" r="2.5" ${st(2.2)}/><path ${st(2.6)} d="M9 22a11 11 0 0 0 22 0"/><path ${fo()} d="M6.5 22.5 9 19l3 3.5zM33.5 22.5 31 19l-3 3.5z"/>`],
// Nordring Ladenetz: Stecker mit Ring
NRLN: ['#047857', `<circle cx="20" cy="20" r="13" ${st(2.4, W, 0.45)}/><path ${fo()} d="M13.5 13h13v6a6.5 6.5 0 0 1-13 0z"/><path ${st(2.6)} d="M17 13V8M23 13V8M20 25.5V32"/>`],
// Mittelstandsbank Talheim: Säulen unter Giebel
MSBK: ['#1F2937', `<path ${fo()} d="M6 15 20 7l14 8z"/><path ${st(3)} d="M11 18v10M17 18v10M23 18v10M29 18v10"/><rect x="7" y="29" width="26" height="4" rx="1" ${fo()}/>`],
BOND: ['#172554', (() => {
const star = (x, y, r) => {
const p = [];
for (let i = 0; i < 10; i++) { const a = Math.PI / 5 * i - Math.PI / 2, rr = i % 2 ? r * 0.45 : r; p.push(`${(x + rr * Math.cos(a)).toFixed(2)} ${(y + rr * Math.sin(a)).toFixed(2)}`); }
return `M${p.join('L')}z`;
};
return `<path fill="#E5B84B" d="M20 6 30.5 9.8v8.6c0 7.2-4.4 12.6-10.5 14.6-6.1-2-10.5-7.4-10.5-14.6V9.8z"/><path fill="#172554" d="${star(15.4, 14.6, 2.3)}${star(20, 12.8, 2.3)}${star(24.6, 14.6, 2.3)}"/><path ${st(1.9, '#172554')} d="M13 20.5h14"/><path ${st(1.9, '#172554')} d="M13.5 24.6q1.6-1.5 3.25 0t3.25 0 3.25 0 3.25 0"/><path ${st(1.9, '#172554')} d="M15.6 28.6q1.1-1 2.2 0t2.2 0 2.2 0 2.2 0"/>`;
})()],
// Index WIBO-10
IDX: ['#0F172A', `<g fill="#3B82F6"><rect x="9" y="23" width="5.2" height="9" rx="1.2"/></g><rect x="17.4" y="19" width="5.2" height="13" rx="1.2" fill="#60A5FA"/><rect x="25.8" y="14" width="5.2" height="18" rx="1.2" fill="#93C5FD"/><path ${st(2.4)} d="M8 17.5l7.5-5.5 5 2.5L31 7.5"/><circle cx="31" cy="7.5" r="2" fill="#fff"/>`],
// ETFs (WiboInvest): Korb als Ring aus Segmenten, in der Mitte das Kürzel des Index bzw. der Branche
EW10: ['#1D4ED8', etfMark('10')],
EWMID: ['#0E7490', etfMark('M')],
EWSML: ['#0F766E', etfMark('S')],
EWALL: ['#334155', etfMark('A')],
ETECH: ['#6D28D9', etfMark('T')],
EBANK: ['#1E40AF', etfMark('B')],
EENGY: ['#B45309', etfMark('E')],
EHLTH: ['#047857', etfMark('G')],
};
const ALIAS = { WIB2: 'BOND', WIB10: 'BOND', 'WIBO-10': 'IDX' };
// ---------------------------------------------------------------- Generator für Börsenneulinge
const GEN_COLORS = ['#0F766E', '#1D4ED8', '#7C3AED', '#BE185D', '#B45309', '#047857', '#4338CA', '#0369A1', '#9D174D', '#3F6212', '#7E22CE', '#C2410C'];
function hash(s) { let h = 2166136261; for (const ch of String(s)) { h ^= ch.codePointAt(0); h = Math.imul(h, 16777619); } return h >>> 0; }
const GEN_SHAPES = [
`<circle cx="20" cy="20" r="12.5" ${st(2.4, W, 0.35)}/>`,
`<path ${fo(W, 0.16)} d="M20 5.5 34.5 20 20 34.5 5.5 20z"/>`,
`<path ${fo(W, 0.16)} d="M20 6.5l11.7 6.75v13.5L20 33.5 8.3 26.75v-13.5z"/>`,
`<path ${fo(W, 0.14)} d="M40 0v30a10 10 0 0 1-10 10H0z"/>`,
`<path ${st(2.4, W, 0.28)} d="M4 30 30 4M10 36 36 10"/>`,
`<circle cx="20" cy="20" r="13" ${fo(W, 0.16)}/>`,
];
// Grundformen mit Branchensymbol: die Form liegt hinter dem Monogramm, das Symbol sitzt unten rechts in einer Plakette
const GEN_SHAPES_SEC = [
`<circle cx="17" cy="17" r="12.5" ${st(2.2, W, 0.3)}/>`,
`<path ${fo(W, 0.15)} d="M17 3.5 30.5 17 17 30.5 3.5 17z"/>`,
`<path ${fo(W, 0.15)} d="M17 4.5l11.3 6.5v13L17 30.5 5.7 24V11z"/>`,
`<path ${fo(W, 0.13)} d="M0 0h26a14 14 0 0 1-14 14H0z"/>`,
`<path ${st(2.2, W, 0.24)} d="M-2 22 22-2M-2 32 32-2"/>`,
`<rect x="4.5" y="4.5" width="25" height="25" rx="7" ${fo(W, 0.15)}/>`,
];
const FONT = `font-family="system-ui,-apple-system,'Segoe UI',Roboto,sans-serif"`;
const monogram = (sym, name) => (String(name || sym).normalize('NFD').replace(/[^A-Za-z0-9]/g, '')[0] ?? '?').toUpperCase();
/**
* Deterministisches Logo aus Symbol (und Name, Branche): Farbe, Form und Monogramm.
* Mit bekannter Branche: Farbe aus der Branchenfamilie und das Branchensymbol in einer kleinen Plakette.
*/
export function genMark(sym, name = '', sector = '') {
const ch = monogram(sym, name);
const fam = SECTOR_COLORS[sector];
if (fam?.length && Object.hasOwn(SECTOR_GLYPH, sector)) {
const h = hash(`${sym}|${name}|${sector}`);
const color = fam[h % fam.length];
const shape = GEN_SHAPES_SEC[(h >>> 8) % GEN_SHAPES_SEC.length];
return [color, `${shape}<text x="17" y="24.2" text-anchor="middle" ${FONT} font-size="19" font-weight="800" fill="#fff">${ch}</text>`
+ `<circle cx="29" cy="29" r="9" fill="#fff"/><circle cx="29" cy="29" r="7.4" fill="${color}"/><g transform="translate(23.2 23.2) scale(.29)">${SECTOR_GLYPH[sector]}</g>`];
}
const h = hash(sym);
const color = GEN_COLORS[h % GEN_COLORS.length];
const shape = GEN_SHAPES[(h >>> 8) % GEN_SHAPES.length];
return [color, `${shape}<text x="20" y="27.2" text-anchor="middle" ${FONT} font-size="20" font-weight="800" fill="#fff">${ch}</text>`];
}
// ---------------------------------------------------------------- Zuordnung Symbol → Marke
/** Herkunft der Angaben zu Börsenneulingen: (sym) → {name, sector, mark} (aus Ticker bzw. Börsengang) */
let srcOf = () => null;
let nameOf = () => '';
const infoOf = (sym) => { const i = srcOf(sym) ?? {}; return { name: i.name ?? nameOf(sym) ?? '', sector: i.sector ?? '', mark: i.mark ?? null }; };
/** Unternehmensanleihen (z. B. NVLT5, HLIO10) tragen die Marke ihres Emittenten – auch eine Pool-Marke */
const issuerOf = (sym) => {
const m = /^([A-Z]{4})\d{1,2}$/.exec(String(sym));
if (!m) return null;
return Object.hasOwn(MARKS, m[1]) || isPoolKey(srcOf(m[1])?.mark) ? m[1] : null;
};
const keyOf = (sym) => ALIAS[sym] ?? issuerOf(sym) ?? sym;
/** Bekannte Bildmarke? (sonst Pool oder Generator) */
export const hasMark = (sym) => Object.hasOwn(MARKS, keyOf(sym));
/**
* Plattenfarbe, Bildmarke, helle Platte – feste Marke, Pool-Marke (o.mark oder aus der Quelle) oder Generator.
* @param {{mark?: string|null, sector?: string}} [o]
*/
function resolve(sym, name = '', o = {}) {
const k = keyOf(sym);
if (Object.hasOwn(MARKS, k)) return MARKS[k];
const info = o.mark !== undefined || o.sector !== undefined ? { name, sector: o.sector ?? '', mark: o.mark ?? null } : { ...infoOf(k), ...(name ? { name } : {}) };
if (isPoolKey(info.mark)) return POOL[info.mark];
return genMark(k, info.name || name, info.sector);
}
/** Vollständiges SVG-Innenleben (viewBox 0 0 40 40) einer Marke – auch für Übersicht und Tests */
export function markSvg(sym, name = '', o = {}) {
const [c, body, light] = resolve(sym, name, o);
return plate(c) + body + edge(light);
}
const hexRgb = (c) => c.replace('#', '').match(/../g).map((x) => parseInt(x, 16));
/** Farbe c Richtung t mischen (f = 0…1) */
export const mixColor = (c, t, f) => { const a = hexRgb(c), b = hexRgb(t); return `#${a.map((v, i) => Math.round(v + (b[i] - v) * f).toString(16).padStart(2, '0')).join('')}`; };
/**
* Marke mit Glanz: Platte mit Farbverlauf, Glanzlicht oben, leichter Schatten unter der Bildmarke.
* u: eindeutiges Präfix für die Verweise im Dokument. o: {mark, sector} für Börsenneulinge (sonst aus der Quelle).
*/
export function glossSvg(sym, name = '', u = 'g', o = {}) {
const [c, body, light] = resolve(sym, name, o);
return `<defs><linearGradient id="${u}-p" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${mixColor(c, '#ffffff', 0.26)}"/><stop offset=".55" stop-color="${c}"/><stop offset="1" stop-color="${mixColor(c, '#000000', 0.3)}"/></linearGradient>`
+ `<filter id="${u}-s" x="-20%" y="-20%" width="140%" height="150%"><feDropShadow dx="0" dy="1.1" stdDeviation=".9" flood-color="#000" flood-opacity="${light ? '.18' : '.32'}"/></filter>`
+ `<clipPath id="${u}-c"><rect width="40" height="40" rx="10"/></clipPath></defs>`
+ `<rect width="40" height="40" rx="10" fill="url(#${u}-p)"/>`
+ `<ellipse cx="14" cy="2" rx="30" ry="14" fill="#fff" opacity="${light ? '.28' : '.15'}" clip-path="url(#${u}-c)"/>`
+ `<g filter="url(#${u}-s)">${body}</g>${edge(light)}`;
}
/** Markenfarbe (z. B. für Akzente) */
export const markColor = (sym, name = '', o = {}) => resolve(sym, name, o)[0];
// ---------------------------------------------------------------- Sprite
let sprite = null;
const made = new Set();
const safe = (x) => String(x).replace(/[^A-Za-z0-9_-]/g, '_');
/** Sprite-Kennung: bei Börsenneulingen mit Pool-Marke bzw. Branche, damit eine neue Zuordnung ein neues Symbol bekommt */
function idOf(sym) {
const k = keyOf(sym);
if (Object.hasOwn(MARKS, k)) return `lg-${safe(k)}`;
const i = infoOf(k);
return isPoolKey(i.mark) ? `lg-${safe(i.mark)}` : `lg-${safe(sym)}${i.sector ? `-${safe(i.sector)}` : ''}`;
}
function ensure(sym, name) {
const id = idOf(sym);
if (made.has(id) || typeof document === 'undefined') return id;
if (!sprite) {
sprite = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
sprite.setAttribute('class', 'logo-sprite');
sprite.setAttribute('aria-hidden', 'true');
// Gemeinsamer Beschnitt für den Lichtstreifen der 3D-Kacheln (eine feste Kennung statt einer je Logo,
// sonst ändert jedes Zeichnen das HTML und ganze Listen würden neu aufgebaut)
sprite.innerHTML = '<defs><clipPath id="lg-k3d"><rect width="40" height="40" rx="10"/></clipPath></defs>';
document.body.prepend(sprite);
}
sprite.insertAdjacentHTML('beforeend', `<symbol id="${id}" viewBox="0 0 40 40">${glossSvg(sym, name, id)}</symbol>`);
made.add(id);
return id;
}
/** Namensquelle für Börsenneulinge (Monogramm aus dem Firmennamen) */
export function setLogoNames(fn) { nameOf = fn; }
/** Quelle für Börsenneulinge: (sym) → {name, sector, mark} – Pool-Marke bzw. Branche für den Generator */
export function setLogoSource(fn) { srcOf = fn; }
/** Ab dieser Größe erscheint das Logo als 3D-Kachel (dunkle Unterkante, Lichtstreifen) */
const BIG = 32;
/**
* Logo als kleines SVG (dekorativ – der Name steht daneben). Große Logos (ab 32 px) als 3D-Kachel.
* @param {string} sym Symbol (z. B. NVLT, GOLD, WIBO-10)
* @param {{size?: number, cls?: string, name?: string, label?: string}} [o]
*/
export function logo(sym, { size = 24, cls = '', name, label } = {}) {
if (!sym) return '';
const id = ensure(sym, name ?? infoOf(keyOf(sym)).name);
const a11y = label ? ` role="img" aria-label="${String(label).replace(/[&<>"]/g, '')}"` : ' aria-hidden="true"';
if (size >= BIG) {
const c = markColor(sym, name ?? '');
return `<svg class="tlogo l3d${cls ? ` ${cls}` : ''}" width="${size}" height="${Math.round(size * 43 / 40)}" viewBox="0 0 40 43"${a11y} focusable="false">`
+ `<rect y="3" width="40" height="40" rx="10" fill="${mixColor(c, '#000000', 0.5)}"/><use href="#${id}"/>`
+ `<g class="l3d-shine" clip-path="url(#lg-k3d)"><rect x="-14" y="-6" width="8" height="54" fill="#fff" opacity=".35"/></g></svg>`;
}
return `<svg class="tlogo${cls ? ` ${cls}` : ''}" width="${size}" height="${size}" viewBox="0 0 40 40"${a11y} focusable="false"><use href="#${id}"/></svg>`;
}
/** Alle festen Marken (für die Übersicht) */
export const MARK_SYMBOLS = Object.keys(MARKS);
export { POOL_KEYS, POOL_SECTORS, POOL_SECTOR, isPoolKey } from './logopool.js';