简体   繁体   中英

Distribute objects evenly along a curved path in d3

Is it possible to use a path generated like this to place objects?

var line = d3.svg.line()
    .x(function(d) { return d.x; })
    .y(function(d) { return d.y; })
    .interpolate("basis");

The goal is to achieve an even distribution of objects along the path like this:

在此处输入图片说明

D3 doesn't provide anything to do that; you'd have to compute the positions of the circles yourself. You may find this demo helpful for determining points along a path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM