I'm not JS savvy, but in HTML, you can put the image that comes as a squared image within the svg circle using the following code:
<svg width="100" height="100"> <defs> <pattern id="image" patternUnits="userSpaceOnUse" height="100" width="100"> <image x="0" y="0" height="100" width="100" xlink:href="http://i.imgur.com/7Nlcay7.jpg"></image> </pattern> </defs> <circle id='top' cx="50" cy="50" r="50" fill="url(#image)"/> </svg>
Hope this helps.
All credits go to Teo Inke
- D3.js: How can I put an image on the background of a circle with the remaining parts trimmed and make it resize along with the circle onclick?
- How can I bring a circle to the front with d3?
- How can I make the animation of a circle continous with hovering like this gif in d3.js?
- How to move shape background image with the shape in d3
- How can I connect a circle to a path with a line that is perpendicular to the x axis to create an "error line"?
- MultiBar chart with nvd3 / d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?
- How can I change the radius and opacity of a circle in d3?
- How can I start with all the nodes collapsed in d3js?
- How can I display a placeholder image in my SVG until the real image is loaded?
- How can I get the natural width and height of an svg image element?
- How can I set the position of a drop down list with D3.js?
- How can I make my lines spin with the globe?
- How can you color each circle in the D3 circle pack layout
- How can I put the Germany map on a svg in HTML? D3js
- Using d3 in meteor on windows 8.1, how can I display a world map, zoomed in on the US, with country borders and US state borders?
- How can I change the color of a circle created via d3 each time I click the mouse?
- How can I apply a clipPath in SVG with multiple paths and NOT clip out the area between the paths?
- How can I put a country name on the world map?
- how create a circle group a organization circle image and connect with curve line with D3.js?
- How can I detect panning and zooming by the user with d3 zoomBehavior?
- How can I set the background color of a svg element which contains a D3 heat map?
- how to fill hexagon with background image in d3js?
- How can you change the height of an x-axis with d3.js
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- D3: How can I cause the stroke of an SVG path generated with D3 to be clipped to the interior of the same path?
- How can I use the latest version of the d3 js library with Angular Dart?
- DC.js choropleth map chart CSS conflicting with colouring, no map showing. How can I turn off the fill:none?
- How can I put circles at each point of the x and y coordinate of my line chart?
- With d3.js, how can I use the same script to create 3 charts with 3 datasources?
More Query from same tag
- Access scale factor in d3's pack layout
- D3 hide .text element from node
- Visualising a custom map with QGIS and D3.js is harmed by the projection
- D3.js: How can I give the same style to Top and Right line of a grid with the same style than grid lines?
- D3 custom colors inside a single series of data
- D3 Relative Position Logic, Selections, and Translating
- Setting Max Length of Links in D3 Tree Layout
- How do I create a tree layout using JSON data in d3.v4 - without stratify()
- D3 - using strings for axis ticks
- D3 Spinning Globe: trouble incorporating zoom function
- I am learning D3.js but I don't get the same console output as tutorials
- function to calculate the parent size from children's size
- Restart d3 simulation on user input from range slider
- Guarantee the number of ticks in D3
- Fill a grid with empty rectangles in D3.js?
- D3.js: Passing a parameter to event handler
- Typescript/prototype directly onto d3 object and d3-context-menu
- <base> tag breaks SVG marker-end rendering
- d3.js: how to create "force-directed graph clusters"
- Hierarchical force diagram using D3.js
- d3.js axis labels not displaying in responsive bar chart
- Get all paths in JSON object
- How to properly apply a color gradient to an arc?
- How to relocate the labels on a zoomable map?
- D3 x-axis format based on zoom level
- While mousedown JS
- Append text to SVG `rect` rotated around origin in D3js
- Build system for JS applications - worth the effort?
- d3 - updating data doesnt cause a refresh