startPadAngle and endPadAngle

Open
#207 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Read src/arc.js and trace how padAngle affects the arc geometry. The issue proposes separate start and end padding, defaulting to the existing padAngle, but notes that the geometry requires mathematical work. Done means the new parameters support independent values and preserve the stated default behavior.

Written by the indexing model from the issue text.

Description

Dear All,

I would like to implement two optional parameters for the function arc().

At the moment arc().padAngle(x) create a symetric padding on each side of the arc sector. I have posted on d3 slack about my issue and I think it would be worth implement a solution at the source level. (notice the last comment on this stakOverflow post that bumped into the same problem).

Basically, I would like to modify the arc.js of d3-shape to be able to specify something like :

const arc = d3.arc()
    .innerRadius(0)
    .outerRadius(100)
    .startAngle(0)
    .endAngle(Math.PI / 2)
    .startPadAngle(0.03)
    .endPadAngle(0)

by default startPadAngle and endPadAngle should be equal to padAngle if not specified.

I have been giving a quick try in the source code here for exemple, but I don't understand all the mathematics... any help ?

Thanks!

Dominant language
JavaScript
Stars
2.5k
Forks
307
Avg merge
4h 16m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from d3/d3-shape

All issues in d3/d3-shape

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.