Wiki/chardist: Difference between revisions
From Illustrations in German Translations of Mark Twain's Works
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
<div class="chart-container"> | <div class="chart-container"> | ||
<canvas id="lineChart"></canvas> | <canvas id="lineChart"></canvas> | ||
</div> | </div> | ||
<script> | <script> | ||
const canvas = document.getElementById('lineChart'); | const canvas = document.getElementById('lineChart'); | ||
if (!canvas) return; | |||
// | // ResizeObserver überwacht, wann der Canvas eine echte Größe bekommt | ||
const observer = new ResizeObserver(entries => { | |||
for (let entry of entries) { | |||
const {width, height} = entry.contentRect; | |||
if (width > 0 && height > 0) { | |||
observer.disconnect(); // Nur einmal starten | |||
startChart(); | |||
} | |||
} | |||
}); | |||
observer.observe(canvas); | |||
function startChart() { | function startChart() { | ||
mw.loader.load('https://cdn.jsdelivr.net/npm/chart.js', 'text/javascript', function() { | mw.loader.load('https://cdn.jsdelivr.net/npm/chart.js', 'text/javascript', function() { | ||
const ctx = canvas.getContext('2d'); | const ctx = canvas.getContext('2d'); | ||
| Line 83: | Line 65: | ||
}); | }); | ||
} | } | ||
</script> | |||
</html> | </html> | ||
Revision as of 18:36, 6 October 2025
Displayed in the chart below is the relative distribution of characters (top x-axis) across various illustrated editions of Adventures of Huckleberry Finn cataloged on this webpage. Each colored bar represents a different character, while the y-axis lists the editions in chronological order. At the bottom, the second x-axis shows the total number of illustrations in these editions.
Please note that many illustrations feature multiple characters. Therefore, adding the individual values of all characters appearing in a single edition will yield a number greater than 100%.