react-d3-speedometer icon indicating copy to clipboard operation
react-d3-speedometer copied to clipboard

Allow simultaneous display of segment and stop labels

Open jacktreg opened this issue 1 year ago • 2 comments

Exposes a new Prop to ReactSpeedometer called showStopsAndCustomSegmentLabels. This Prop is not required and defaults to false to maintain existing behavior for users on earlier versions.

The logic simply allows the _renderLabels function to continue if this Prop is set to true. Previously, if isCustomLabelsPresent && isCustomLabelsValid evaluated to true the function would strictly render the custom segment labels and then exit, skipping the logic to render the segment stop labels.

jacktreg avatar Dec 13 '24 15:12 jacktreg

Thank you for the PR! I will take a look when time permits and merge this into master if it looks fine. Tests might be required and I will see if I'm able to add them for this change.

palerdot avatar Dec 14 '24 03:12 palerdot

Couple of things might make this PR more easier to review and merge

  • Adding an example to storybook for this particular behaviour, so that it can both act as a documentation and gives visual feedback
  • Tests. There is an existing test suite with cypress, and it would be great if there is a test for the PR.

If not, I will consider adding these myself for merging to master.

palerdot avatar Dec 14 '24 03:12 palerdot