Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const CONFIG_KEYS_CAN_RERENDER = new Set<string>([
'hideEmptyNodeDataEntries',
'showSidePanelOnNodeSelection',
'maxEdgeLabelCharCount',
'svgTextRenderer',
]);

/**
Expand Down
9 changes: 7 additions & 2 deletions src/ui/src/components/visualizer/svg_text_renderer_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export class SvgTextRendererService {
.attr('y', (d) => this.getNodeLabelY(d))
.style('fill', (d) => this.getNodeLabelColor(d))
.style('font-size', (d) => this.getNodeLabelFontSize(d))
.style('font-weight', (d) => (isOpNode(d) ? 400 : 500));
.style('font-weight', (d) => (isOpNode(d) ? 400 : 500))
.style('font-family', '"Google Sans Text", Arial, Helvetica, sans-serif');
// Render multi-line text labels using tspans.
nodeLabelEnter.each((d, i, nodes) => {
const textElement = d3.select(nodes[i]);
Expand Down Expand Up @@ -234,7 +235,11 @@ export class SvgTextRendererService {
for (const row of rows) {
const textElement = nodeAttrsTable
.append('text')
.style('font-size', attrsTableFontSize);
.style('font-size', attrsTableFontSize)
.style(
'font-family',
'"Google Sans Text", Arial, Helvetica, sans-serif',
);

// Key Label
const keyLabel = row.keyLabelData;
Expand Down
10 changes: 10 additions & 0 deletions src/ui/src/components/visualizer/webgl_renderer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
box-sizing: border-box;
}

svg.svg-texts {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
user-select: none;
}

canvas.snapshot,
canvas.download-png {
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions src/ui/src/components/visualizer/webgl_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ export class WebglRenderer implements OnInit, OnChanges, OnDestroy {
20,
);
this.webglRendererThreejsService.setupThreeJs();
this.svgTextRendererService.init(this);

// Run outside Angular to not trigger change detection.
this.ngZone.runOutsideAngular(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class WebglRendererAttrsTableService {
private readonly visualizerThemeService: VisualizerThemeService = inject(
VisualizerThemeService,
);
private readonly attrsTableBgs = new WebglRoundedRectangles(
readonly attrsTableBgs = new WebglRoundedRectangles(
4,
this.visualizerThemeService,
);
Expand Down
Loading