diff --git a/index.html b/index.html index 142316d9..dc39e1dd 100644 --- a/index.html +++ b/index.html @@ -7798,10 +7798,10 @@ - + - + diff --git a/modules/dynamic/editors/cultures-editor.js b/modules/dynamic/editors/cultures-editor.js index 07b58cae..0433a0f0 100644 --- a/modules/dynamic/editors/cultures-editor.js +++ b/modules/dynamic/editors/cultures-editor.js @@ -630,7 +630,7 @@ function togglePercentageMode() { async function showHierarchy() { if (customization) return; - const HeirarchyTree = await import("../hierarchy-tree.js"); + const HeirarchyTree = await import("../hierarchy-tree.js?v=15062022"); const getDescription = culture => { const {name, type, rural, urban} = culture; diff --git a/modules/dynamic/editors/religions-editor.js b/modules/dynamic/editors/religions-editor.js index 381212d6..debd4d53 100644 --- a/modules/dynamic/editors/religions-editor.js +++ b/modules/dynamic/editors/religions-editor.js @@ -533,7 +533,7 @@ function togglePercentageMode() { async function showHierarchy() { if (customization) return; - const HeirarchyTree = await import("../hierarchy-tree.js"); + const HeirarchyTree = await import("../hierarchy-tree.js?v=15062022"); const getDescription = religion => { const {name, type, form, rural, urban} = religion; diff --git a/modules/dynamic/hierarchy-tree.js b/modules/dynamic/hierarchy-tree.js index 73b9f173..5380dd6c 100644 --- a/modules/dynamic/hierarchy-tree.js +++ b/modules/dynamic/hierarchy-tree.js @@ -64,17 +64,32 @@ export function open(props) { function appendStyleSheet() { const styles = /* css */ ` + + #hierarchyTree { + display: flex; + flex-direction: column; + justify-content: space-between; + } + + #hierarchyTree > svg { + height: 100%; + } + #hierarchyTree_selectedOrigins > button { margin: 0 2px; } - .hierarchyTree_selectedButton { + .hierarchyTree_selectedOrigins { + margin-right: 15px; + } + + .hierarchyTree_selectedOrigin { border: 1px solid #aaa; background: none; padding: 1px 4px; } - .hierarchyTree_selectedButton:hover { + .hierarchyTree_selectedOrigin:hover { border: 1px solid #333; } @@ -88,6 +103,10 @@ function appendStyleSheet() { color: #333; } + #hierarchyTree_originSelector { + display: none; + } + #hierarchyTree_originSelector > form > div { padding: 0.3em; margin: 1px 0; @@ -149,8 +168,8 @@ function insertHtml() { . Abbreviation: Origins: - - + +
@@ -324,6 +343,7 @@ function updateTree() { function selectElement(d) { const dataElement = d.data; + if (d.id == 0) return; const node = nodes.select(`g[data-id="${d.id}"]`); nodes.selectAll("g").style("outline", "none"); @@ -457,6 +477,8 @@ function handleNodeExit(d) { } function dragToReorigin(from) { + if (from.id == 0) return; + dragLine.attr("d", `M${from.x},${from.y}L${from.x},${from.y}`); d3.event.on("drag", () => { diff --git a/versioning.js b/versioning.js index ba8f7187..55a16f9b 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.86.07"; // generator version, update each time +const version = "1.86.08"; // generator version, update each time { document.title += " v" + version;