I don't have your code in entirety, but I think you are adding text INTO circles, and since circles are small, you don't see the text.
Now, your nodes are currently circles (I just suppose). If you want both circles and text for each node, your nodes should be svg g elements (g stands for "group"), and to each such g element you assign a circle and a text. More about that you can find here (code is included there too)
EDIT: Once you see labels, you will like to position them in a nice way in relation to nodes. Here is an almost official recommendation related to positioning labels to the nodes of a graph:
For vertical alignment, use the "dy" attribute:
by default, the baseline of the text is at the origin (bottom-aligned) a dy of .35em centers the text vertically a dy of .72em places the topline of the text at the origin (top-aligned)
em units is nice because it will scale automatically based on the font size. If you don't specify units, it defaults to pixels.
For horizontal alignment, use the "text-anchor" attribute:
the default is "start" (left-aligned for left-to-right languages) "middle" "end"
- Appending text to D3 force layout graph
- add text inside a rect in force layout graph d3.js
- add text inside a rect in force layout graph d3.js REACTJS
- How to make force layout graph in D3.js responsive to screen/browser size
- Add text label to d3 node in Force directed Graph and resize on hover
- Simple graph of nodes and links without using force layout
- Labels / text on the nodes of a D3 force directed graph
- D3 Force Layout Graph - Self linking node
- Add text label to d3 node in Force layout
- How can I show a graph using d3 force layout with initial positions set and no movement at all?
- Place pie charts on nodes of force directed layout graph in D3
- How to display a text when mouseover a node in D3 force layout
- D3 force layout graph with nodes positioned in a grid
- D3 force layout text label overlapping
- How to get the same node positions in d3's force layout graph
- How to stop a d3 force graph layout simulation?
- d3js (v4) canvas force layout with text on nodes
- How to add text to Cluster Force Layout bubbles
- how to generate a network graph with edge weight using D3.js force layout
- d3 force directed graph remove text cursor
- Nodes drawn randomly in Force Layout graph
- Changing nodes for images in d3.js force layout graph
- D3.js Force Layout - showing only part of a graph
- Breaking text from json into several lines for displaying labels in a D3 force layout
- D3 force directed graph moving text
- d3 force directed graph don't select text
- Text not showing as label in D3 force layout
- Can't append text to d3.js force layout nodes
- D3 JS - Force Graph - Doesn't restart layout after removing Node
- Adding OnClick event to D3 force layout graph
More Query from same tag
- D3.JS Bubble Chart - reset chart when reducing circle size
- nvd3 trigger event brushend
- Create scalable Y axis with customized ticks
- dc.js Remove clicked slice in PIE chart instead of grey out?
- Trying to transition d3v4 linegraph data from one dataset to a dataset with a different scale
- d3.js onclick and touch works erratically on topojson map
- d3js zooming in one direction, panning in both directions
- Problems converting shapefile to topojson with features
- D3 - Pie Chart & Force Directed Labels
- Limit the number of options a user can select in D3 dropdown menu
- d3 js know if an svg shape has a class
- d3 time scale - last bar on graph is appearing outside of the graph
- TypeScript type cast & D3.js errors
- How do I disable my zoom functionality in D3.js?
- How to update child elements when changing data?
- D3 scatterplot hot to manage domain and range properly?
- D3 donut chart based on seasons with fixed labels
- Unexpected behavior with d3.svg.line()?
- Return position during d3 transition
- Webpack error: Module has no exported member 'Rgb'
- d3.timeParse("%Y") : dates 1895 before are not labled correctly
- D3 event: Type definitions in version 6+
- Range of brush dc.js d3.js
- Bubble highlight feature in d3js bubble chart
- d3 - updating data doesnt cause a refresh
- WebCola Missing documentation
- is it prohibited to use transition interval same as redraw interval?
- Show missing values with dotted lines