Skip to content

Commit 8cb577c

Browse files
authored
Group Genmapper Colors (#2891)
* Enhance D3.js Genmap Visualization and CSS Adjustments - Updated CSS to prevent static fill color for node text, allowing dynamic color assignment via JavaScript. - Reduced font size for node titles and adjusted max-width for better text fitting. - Introduced constants for node dimensions in JavaScript to improve maintainability and prevent text clipping. - Added functions for calculating text color based on background luminance to ensure better contrast and readability. * Refactor genmap status color resolution into ensureStatusColor helper Eliminates ~9 duplicate inline status color resolution blocks across both render paths by extracting a shared ensureStatusColor() helper. Removes redundant .style('fill') calls and stale CSS comments.
1 parent 45779ae commit 8cb577c

3 files changed

Lines changed: 145 additions & 151 deletions

File tree

dt-groups/genmap-d3.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,16 @@
7070
/* Node Text */
7171
.group-genmap-chart .node text {
7272
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
73-
fill: #333;
7473
pointer-events: none;
7574
text-anchor: middle;
7675
dominant-baseline: middle;
7776
}
7877

7978
/* Node Title - truncated text */
8079
.group-genmap-chart .node .node-title {
81-
font-size: 11px;
80+
font-size: 9px;
8281
font-weight: 500;
83-
fill: #333;
84-
max-width: 56px; /* Slightly less than node width for padding */
82+
max-width: 68px; /* Slightly less than node width (72px) for padding */
8583
}
8684

8785
/* Node Generation Text */
@@ -336,7 +334,7 @@
336334
}
337335

338336
.group-genmap-chart .node text {
339-
font-size: 10px;
337+
font-size: 9px;
340338
}
341339

342340
.genmap-popover {

0 commit comments

Comments
 (0)