Skip to content

Commit 4169a17

Browse files
committed
パッケージ概要のノードにツールチップを追加
1 parent 3af7372 commit 4169a17

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

jig-core/src/main/resources/templates/assets/package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,9 @@ function renderPackageDiagram(filterFqn, mode) {
513513
const addNodeLines = nodeId => {
514514
const label = nodeLabelById.get(nodeId);
515515
lines.push(`${nodeId}["${escapeMermaidText(label)}"]`);
516-
lines.push(`click ${nodeId} filterPackageDiagram`);
517516
const fqn = diagramNodeIdToFqn.get(nodeId);
517+
const tooltip = fqn ? escapeMermaidText(fqn) : '';
518+
lines.push(`click ${nodeId} filterPackageDiagram "${tooltip}"`);
518519
if (fqn && parentFqns.has(fqn)) {
519520
lines.push(`class ${nodeId} parentPackage`);
520521
}

jig-core/src/main/resources/templates/assets/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,21 @@ main table.fields thead {
199199
pre.mermaid {
200200
font-size: 0;
201201
}
202+
/* Mermaidのツールチップ表示を調整 */
203+
/* ツールチップ自体がおまけ機能的な位置付けらしい。 */
204+
.mermaidTooltip {
205+
position: absolute;
206+
z-index: 10;
207+
padding: 4px 8px;
208+
border: 1px solid #aaa;
209+
border-radius: 4px;
210+
background: #f2f2f2;
211+
color: #111;
212+
font-size: 12px;
213+
line-height: 1.4;
214+
pointer-events: none;
215+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
216+
}
202217

203218
label {
204219
cursor: pointer;

0 commit comments

Comments
 (0)