0

In d3, we find the d attribute of a path of a pie chart by feeding pie datum to it, which contains the startAngle and endAngle. I would like to do some transitions in a JS framework, which requires me knowing the current startAngle and endAngle, but all I have is a path element, and the d attribute. Is there an implemented way to find the startAngle and endAngle from the d attribute?

BlackMath
  • 932
  • 7
  • 24
  • 1
    You'll find out that reverse engineering that is very complicated: https://github.com/d3/d3-shape/blob/289b6ca78ba2fdde523737651866405ec6035587/src/arc.js#L87. It would be better finding another approach. – Gerardo Furtado Jan 14 '22 at 03:32
  • Are the paths straight? https://stackoverflow.com/questions/42159032/how-to-find-angle-between-two-straight-lines-paths-on-a-svg-in-javascript/42159152 – SmokeyShakers Jan 14 '22 at 17:00

0 Answers0