refactor: complete migration to template-v2 architecture

- Remove legacy template.svg files from example/ and my-project/
- Simplify generator.js by removing generateHardcoded method (326→210 lines, -36%)
- Add strict template validation with clear error messages
- Remove all fallback mechanisms - template-v2.svg format now required
- Clean up tests: remove hardcoded generation tests, keep template-based tests
- Add comprehensive e2e tests (large datasets, edge cases, error handling)
- Update documentation: mark REFACTORING_PLAN.md complete, add TEMPLATE_V2_GUIDE.md
- All 56 tests passing (16 engine + 25 generator + 15 integration)

BREAKING CHANGE: Old template.svg format no longer supported. Must use template-v2.svg with <g id="*-template"> elements in defs section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-27 15:29:58 +01:00
parent b5c7c613de
commit c22a47f1ea
10 changed files with 936 additions and 517 deletions

View File

@@ -3,7 +3,7 @@
"description": "Neutrales Beispielprojekt f\u00fcr die Timeline Engine.",
"dataSource": "sample.csv",
"stylesheet": "style.css",
"svgTemplate": "template.svg",
"svgTemplate": "template-v2.svg",
"settings": {
"timelineMonths": 18
},

View File

@@ -1,50 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" style="background: linear-gradient(135deg, #f0f9f4 0%, #e6f7ea 100%);">
<defs>
<!-- Enhanced month indicator styling -->
<linearGradient id="monthHeaderGrad" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#2d8659;stop-opacity:0.15"/>
<stop offset="100%" style="stop-color:#4a9b6b;stop-opacity:0.08"/>
</linearGradient>
<!-- Drop shadow for month labels -->
<filter id="textShadow" x="-50%" y="-50%" width="200%" height="200%">
<feDropShadow dx="1" dy="1" stdDeviation="1.5" flood-color="#2d8659" flood-opacity="0.4"/>
</filter>
<!-- Subtle background grid pattern -->
<pattern id="bgGrid" width="40" height="40" patternUnits="userSpaceOnUse">
<rect width="40" height="40" fill="transparent"/>
<circle cx="20" cy="20" r="1" fill="#4a9b6b" opacity="0.1"/>
</pattern>
</defs>
<!-- Background with subtle pattern -->
<rect width="100%" height="100%" fill="url(#bgGrid)"/>
<!-- Enhanced month header background -->
<rect x="0" y="0" width="100%" height="130" fill="url(#monthHeaderGrad)" stroke="#2d8659" stroke-width="1" opacity="0.6"/>
<!-- Title area with visual indicator -->
<rect x="10" y="10" width="300" height="60" fill="#ffffff" stroke="#2d8659" stroke-width="2" rx="8" opacity="0.9"/>
<text x="20" y="35" fill="#2d8659" font-size="16" font-weight="bold" filter="url(#textShadow)">
📊 External Template Active
</text>
<text x="20" y="55" fill="#4a9b6b" font-size="11" font-weight="500">
Enhanced styling with prominent months ✨
</text>
<!-- Month indicators with enhanced styling -->
<g class="enhanced-months" transform="translate(0,0)">
<rect x="0" y="75" width="100%" height="55" fill="rgba(45, 134, 89, 0.05)" stroke="#4a9b6b" stroke-width="1"/>
{{MONTHS}}
</g>
<!-- Lane content -->
<g class="enhanced-lanes">
{{LANES}}
</g>
<!-- Decorative border -->
<rect x="1" y="1" width="calc(100% - 2)" height="calc(100% - 2)"
fill="none" stroke="#2d8659" stroke-width="2" rx="4" opacity="0.7"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB