mirror of
https://github.com/hansjone/netx.git
synced 2026-10-14 03:20:48 +08:00
Hide white React Flow edge-label backgrounds on the topology canvas.
Disable labelShowBg for straight edges and suppress the default SVG textbg so link numbers render as text only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
83acb5eef1
commit
4a0918ab44
2 changed files with 17 additions and 9 deletions
|
|
@ -6876,6 +6876,8 @@ pre {
|
|||
flex: 1;
|
||||
min-height: 0;
|
||||
background: var(--topo-canvas-bg, #0f172a);
|
||||
--xy-edge-label-background-color: transparent;
|
||||
--xy-edge-label-color: #e2e8f0;
|
||||
}
|
||||
|
||||
.topo-canvas:fullscreen,
|
||||
|
|
@ -7190,22 +7192,27 @@ pre {
|
|||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.react-flow__edge-textbg {
|
||||
fill: #0f172a;
|
||||
.topo-canvas .react-flow__edge-textbg {
|
||||
fill: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.react-flow__edge-text {
|
||||
fill: #cbd5e1;
|
||||
.topo-canvas .react-flow__edge-text {
|
||||
fill: #e2e8f0;
|
||||
font-size: 11px;
|
||||
paint-order: stroke;
|
||||
stroke: rgba(15, 23, 42, 0.85);
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
.topo-edge-label {
|
||||
font-size: 11px;
|
||||
color: #e2e8f0;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
background: transparent !important;
|
||||
border: 0 !important;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
padding: 0 !important;
|
||||
box-shadow: none !important;
|
||||
white-space: nowrap;
|
||||
text-shadow:
|
||||
0 0 3px rgba(15, 23, 42, 0.95),
|
||||
|
|
|
|||
|
|
@ -597,7 +597,8 @@ function resolveEdgeStyle(
|
|||
function withEdgeVisual(edge: Edge, defaults: EdgeDefaults): Edge {
|
||||
const data = (edge.data || {}) as EdgeStyleData;
|
||||
const style = resolveEdgeStyle(data, defaults);
|
||||
return { ...edge, style, markerEnd: undefined };
|
||||
// RF EdgeText defaults labelShowBg=true with a white rect — keep digits only.
|
||||
return { ...edge, style, markerEnd: undefined, labelShowBg: false };
|
||||
}
|
||||
|
||||
function graphToFlow(
|
||||
|
|
@ -3385,7 +3386,7 @@ export function TopologyPage() {
|
|||
edgeTypes={edgeTypes}
|
||||
onlyRenderVisibleElements
|
||||
connectionMode={ConnectionMode.Loose}
|
||||
defaultEdgeOptions={{ type: "straight" }}
|
||||
defaultEdgeOptions={{ type: "straight", labelShowBg: false }}
|
||||
proOptions={{ hideAttribution: true }}
|
||||
minZoom={0.05}
|
||||
maxZoom={4}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue