score:1
Accepted answer
for the first part of your question, one way to select the path is to add an id to id :
d3.json("http://mbostock.github.io/d3/talk/20111018/world-countries.json", function(collection) {
feature = svg.selectall("path")
.data(collection.features)
.enter().append("svg:path")
.attr("d", clip)
.attr("id", function(d) { return d.properties.name; }) ;
and then select the path like that :
var path = d3.select("#russia").node()
then you can select the first point with :
path.getpointatlength(0)
see this updated fiddle : http://jsfiddle.net/xqmevpjg/11/
Source: stackoverflow.com
Related Query
- D3: Animate circle along border of country on spinning globe
- D3JS - animate a circle along an svg path at a constant speed
- Trying to animate a circle along an arc path in D3.js (v3)
- D3.js animate a circle along x, y coordinates
- How to animate along a curved path using gravity
- How to animate an object along a GeoJSON path using d3.js?
- d3.js. Spinning globe with bars
- d3.js circle packing along a line
- d3: How to add border to a circle on an if-condition?
- Text along circles in a D3 circle pack layout
- moving a circle along a d3 path animating at varying speeds
- D3 animate marker along multiple paths with d3 nest group
- D3 - Center the globe to the clicked country
- How to animate a path along with its points in d3
- Generate multiple random paths and animate circles along paths
- Cannot hide labels 'behind' spinning D3 Globe
- How to get SVG circle to drag along SVG path?
- How to display country names on globe d3.js
- d3 on click on circle pause and resume transition of marker along line
- drag circle area rather than border
- Updating circle radius and animate it in d3.js
- Cannot hide cities behind spinning globe
- Cannot plot polyline on D3 spinning globe
- trying to rotate a globe in d3, centering on a particular country
- Mapping with D3: Feature clipping error in my spinning globe
- 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?
- d3 globe cuts off part of the earth when it goes to a particular country
- d3 globe with country hovers plus rotation/zoom from land
- Animate an external svg object along a simple line path in D3.js
- D3.js spread squares along circle with force
More Query from same tag
- Sales pipeline chart
- D3.js v4 - set padding for bar chart
- Typescript d3(Power BI)
- How to convert D3js V2 to V4?
- D3.js stacked bar chart with multiple levels?
- D3 Force directed Graph: Why don't the links appear and why is the simulation on the left?
- How do I hide the text labels in d3 when the nodes are too small?
- D3 change SVG dimensions on resize window
- 'Circle' is not coming for line in D3 Chart
- d3.js - draw stations and path on google map
- How to get the JSON path from element
- Argument of type is not assignable to string
- D3 - how to include č,š,ž letters in D3
- dc.js : how to change circle color on mouseover
- End arrow is missing while dragging node in dagre-d3
- Uncaught TypeError: Cannot read property 'startAngle'
- D3.js line plot pandas dataframe JSON
- Pass variable from Express to Client JavaScript
- How to hide outer ring in zoomable sunburst
- Remove the arrow of an edge
- d3js zooming in one direction, panning in both directions
- D3.js how to extract Y domain value from data array with multiple Y axis columns
- d3 node labeling: how to display JSON data formatted with HTML?
- D3 V6 - Zoom and Drag Functionality
- nvd3 line chart automatically setting fill opacity
- How to plot a directed Graph in R with networkD3?
- tableToJSON headers mismatch D3
- How do I center a donut chart inside an svg
- d3.js Node Position in Force Directed Graph following Search
- Data input format for heatmaps