I think it would be easier to insert svg paths rather than rects or circles. It's pretty flexible and you'll be able to add just about any shape you can think of to the force graph.
The following code draws a star. http://jsfiddle.net/UkeMS/
<svg> <path d=" m 100 100 l 23 12 l -4 -26 l 19 -19 l -27 -4 l -11 -23 l -12 23 l -27 4 l 19 19 l -4 26 l 24 -12 "/> </svg>
Just remember to declare the paths using relative coordinates with lowercase letters (as above) as opposed to absolute coordinates using uppercase letters.
- add different shapes to d3 force layout
- Different shapes according to data in D3 force layout
- Add text label to d3 node in Force layout
- How do i add two different shapes to D3 forced directed graph based on shape field value?
- D3: move circle between two different g elements in force layout
- How to add text to Cluster Force Layout bubbles
- Is there a way to add different shapes depending on different data to my force-directed graph?
- d3.js Force Chart online now app with different symbol shapes
- d3: Optionally add child elements based on node content in force layout
- Add labels to nodes in Hobbelt's "Group/Bundle Nodes" D3 force layout example?
- How to specify 3 different custom colors for 3 nodes in D3 force layout on load
- Add and remove the class in the link d3 force layout
- Can't add labels to d3js force layout network visualization
- How to add hypertext link to Cluster Force Layout circle
- D3 force layout shall add nodes and links when clicking a node
- add text inside a rect in force layout graph d3.js
- How to add node labels to Bounded Force Layout (D3 v4)?
- Add labels to force layout where data is only client side (D3)
- how to add title to d3js bubble chart with force layout
- add text inside a rect in force layout graph d3.js REACTJS
- d3: Optionally add child elements based on node content in force layout - when filter is not the solution
- Is there a way to zoom into a D3 force layout graph?
- Fix Node Position in D3 Force Directed Layout
- How to make force layout graph in D3.js responsive to screen/browser size
- Calm down initial tick of a force layout
- D3 force directed layout with bounding box
- Add text label to d3 node in Force directed Graph and resize on hover
- Simple graph of nodes and links without using force layout
- d3.js force layout auto zoom/scale after loading
- Add text/label onto links in D3 force directed graph
More Query from same tag
- D3 circle pack - Adding labels to nodes
- D3 to create same image with different data
- D3: How to set symbols insted of points in a ScatterPlot
- d3.js - What is the purpose of selectAll that returns non-existing element
- d3js make zoom work on line chart
- D3 Multiline Chart with transition
- Setting up links in d3 force layout
- Pushing D3.js output through fabric.js for IE8 support?
- How do I externalise my Data
- Adding an image with C3.js
- how to align text and labels in D3
- Using json in d3
- d3 js nodes as images
- Draw an arc between two points
- Add 'view finder' to a stacked area chart
- Can I represent a hierarchy in d3 without nesting DOM elements?
- D3js: Dropdown update in bar chart
- Plotting Lat/Long on map - D3.js v4
- d3.js functions not working with div id
- Draw a vertical band at the maximum value of a single-stream streamgraph in d3js that respects the bounds of curve?
- D3.js bar chart colors not shown in print out but displayed on browser
- D3 force layout by node size
- How to add a drop shadow to dc.js bar chart rects
- Drawing sequence logos in D3
- Line with nested json attributes
- How to get target element in drag n drop d3 v4?
- d3js axis dates start and end value only
- Extract array from one json variable