score:1
Accepted answer
you should update the cx and cy values in your zoom function:
function zoom() {
svg.select(".x.axis").call(xaxis);
svg.select(".y.axis").call(yaxis);
svg.selectall(".dot")
.attr("cx", function (d) {
return xscale(d.lng);
})
.attr("cy", function (d) {
return yscale(d.alt);
});
}
Source: stackoverflow.com
Related Query
- Points change position on zoom in D3 scatterplot
- D3.js - How to change position of labels on zoom
- D3 v4 Scatterplot chart data points are not updating on zoom
- How do I change the legend position in a NVD3 chart?
- D3 Scatterplot with thousands of data points
- d3.js click and apply zoom and pan to distribute points located inside a targeted division to the triggered subdivisions
- In d3 is it possible to dynamically change where a path position starts for tweening?
- d3.js change zoom behavior to semantic zoom
- Get mouse position in SVG co-ordinates after zoom
- Resize points based on zoom
- DC.js scatterPlot ordinal axis tick position
- D3: Map Zoom scaled by points
- D3 change zoom and pan gestures
- How do I get the d3 svg points to stay in their correct position on the leaflet map when zooming?
- D3v6 zoom causing wrong pointer position
- d3 change and update axis domain scatterplot
- How do I change the speed of the zoom in D3
- How do you change the interpolation for a zoom behavior in d3.js
- D3 scatter plot - visible points outside the chart after zoom
- How can I dynamically change the position and the size of direction arrows on a directed d3.js force layout?
- C3.js change label position of Line Chart Y axis to center up of Y axis
- In a d3 scatterplot using data from a csv file, how do i draw lines connecting related points when the mouse is over a point?
- Leaflet: How to get pixel position of a lat lng after zoom, before zoom begins
- d3.js change position of tick label on pannable graph
- how to change zoom.translateExtent after declaring zoom
- d3 ordinal x-axis, change label order and shift data position
- Not all d3 points are showing in correct position on leaflet map
- Change class of a D3 map's tooltip with mouse position
- Translate zoom after domain change
- D3: How to set symbols insted of points in a ScatterPlot
More Query from same tag
- How to show data with small value on c3.js Donut
- How to update labels using selection.join in D3?
- Fix node position based on another value in d3.js
- How to install & run colororacle?
- D3 Error: NotFoundError: Node was not found
- d3 selectAll: count results
- d3.js bar chart new data adding onto bars,
- DC.js DataTable not showing as it should
- D3: Select SVG attribute and change it
- Syntax for axis transition in svg/d3
- DC.js Ordering with filters
- using "dy" attribute in d3 to align labels with ticks
- D3 mouse events touch events i.e. click -> supported touch event
- Logic for static triangular plot
- Bars are going beyond the chart range in d3 bar chart
- How to transition a path in d3.js
- Read json data in d3.js
- Having trouble drawing lines in d3js
- d3, data .enter, different groups
- Chaining transitions
- D3 collapsible trees without flare.json
- d3.js - Tooltips only shows the first properties values of the data object
- D3 - flare not showing all data
- hide/Show Grid lines using a button D3
- d3 drag jumping to other position when clicked - origin?
- Accessing CSV Data with D3.js using Django
- cant access like `d3.svg(), d3.scale()` and some others properties in d3js with angular2
- Bar chart that doesn't start at zero
- SVG: drawing inside a child element
- How to assign javascript variables in a scalable way