Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions jig-core/src/main/resources/templates/assets/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const dom = {
getClearRelatedFilterButton: () => document.getElementById('clear-related-filter'),
getDiagramDirectionRadios: () => document.querySelectorAll('input[name="diagram-direction"]'),
getDiagramDirectionRadio: () => document.querySelector('input[name="diagram-direction"]'),
getTransitiveReductionToggle: () => document.getElementById('transitive-reduction-toggle'),
getMutualDependencyList: () => document.getElementById('mutual-dependency-list'),
getDiagram: () => document.getElementById('package-relation-diagram'),
getDocumentBody: () => document.body,
Expand Down Expand Up @@ -1155,27 +1156,13 @@ function setupDiagramDirectionControl(context) {
}

function setupTransitiveReductionControl(context) {
const container = dom.getDiagramDirectionRadio()?.parentNode?.parentNode;
if (!container) return;

const controlContainer = document.createElement('div');
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = 'transitive-reduction-toggle';
const checkbox = dom.getTransitiveReductionToggle();
if (!checkbox) return;
checkbox.checked = context.transitiveReductionEnabled;
checkbox.addEventListener('change', () => {
context.transitiveReductionEnabled = checkbox.checked;
renderDiagramAndTable(context);
});

const label = document.createElement('label');
label.htmlFor = checkbox.id;
label.textContent = '推移簡約';
label.style.marginLeft = '4px';

controlContainer.appendChild(checkbox);
controlContainer.appendChild(label);
container.appendChild(controlContainer);
}

// 初期化
Expand Down
7 changes: 7 additions & 0 deletions jig-core/src/main/resources/templates/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ <h1>パッケージ概要</h1>
</label>
</div>
<div class="control-row">
<label class="control-label" for="transitive-reduction-toggle">推移簡約:</label>
<label class="radio-label">
<input type="checkbox" id="transitive-reduction-toggle" checked>
有効
</label>
</div>
</details>

<pre id="package-relation-diagram" class="mermaid"></pre>
Expand Down