- Implement ModuleBlockInterface for tree/user homepage embedding with configurable individual and generation settings - Make generation sliders reactive (auto-navigate on change) - Persist generation counts when clicking between persons - Expand chart to full viewport width and remaining height - Add German and Dutch translations for all custom strings - Pass translated labels to JS bio card tooltip via window.fullDiagramI18n - Use webtrees core translation keys where available - Increase default generations to 4, remove show siblings checkbox - Expose Chart class globally for block instantiation
34 lines
803 B
JavaScript
34 lines
803 B
JavaScript
/**
|
|
* Full Diagram — entry point.
|
|
*
|
|
* Reads embedded data from the page and initializes the chart.
|
|
*/
|
|
import Chart from "./lib/chart.js";
|
|
|
|
// Expose Chart class for block usage
|
|
window.FullDiagramChart = Chart;
|
|
|
|
async function init() {
|
|
const data = window.fullDiagramData;
|
|
const baseUrl = window.fullDiagramBaseUrl;
|
|
|
|
if (!data || !data.persons) {
|
|
console.error("Full Diagram: No tree data found.");
|
|
return;
|
|
}
|
|
|
|
try {
|
|
const chart = new Chart("#full-diagram-container", data, baseUrl);
|
|
await chart.render();
|
|
} catch (err) {
|
|
console.error("Full Diagram: Render failed", err);
|
|
}
|
|
}
|
|
|
|
// Initialize when DOM is ready
|
|
if (document.readyState === "loading") {
|
|
document.addEventListener("DOMContentLoaded", init);
|
|
} else {
|
|
init();
|
|
}
|