Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component | Donut: Half Donut Label Placement #9

Closed
wants to merge 1 commit into from

Conversation

curran
Copy link

@curran curran commented Dec 10, 2024

This PR contains a simple solution to the half donut label placement problem that also could be used in the general case of donuts. Thank you @rokotyan for this suggestion!

image

If we will ultimately be doing text size estimation/measuring, then the changes in the other PR

may not make sense to add yet.

Proposed plan:

  • Merge this PR to add the config options
  • Later do a separate PR that adds a more complex and robust solution that involves measuring/estimating the size of text

@curran curran force-pushed the donut-label-offsets branch from a9a59ca to aaa02bd Compare December 10, 2024 17:51
@curran curran changed the title Donut label offsets Component | Donut: Configurable central label offsets Dec 10, 2024
@curran curran force-pushed the donut-label-offsets branch from 4df0ae7 to 66f8c87 Compare December 10, 2024 18:13
@curran
Copy link
Author

curran commented Dec 10, 2024

Thanks @rokotyan for the feedback! I made the change, then edited the Git history so there's only one commit now.

If this looks good, feel free to merge and publish. Thanks!

@curran curran force-pushed the donut-label-offsets branch from 29dcbed to d16517b Compare December 11, 2024 16:31
@curran
Copy link
Author

curran commented Dec 11, 2024

@rokotyan It looks like somehow these changes made it into the 1.5.0-exaforce branch without this PR getting merged.

I made an additional change here.based on feedback from @jakubjosef , then squashed the commit as you mentioned I should always do, and I think now the git history is in a strange place.

I could do something like make a new PR with just the type change? It's pretty minor.

@curran
Copy link
Author

curran commented Dec 11, 2024

Also curious if I should merge my own PRs on this repo or let you do it @rokotyan , since it's usually tied to releases. Please let me know your preference. Thanks!

@jakubjosef
Copy link

jakubjosef commented Dec 11, 2024

It looks like somehow these changes made it into the 1.5.0-exaforce without this PR getting merged.

Nikita said in that Slack threat he published it from this PR.

Just fix this PR and Nikita will publish new version from it.

For some reason he doesn't want to merge it...

@curran
Copy link
Author

curran commented Dec 11, 2024

I mean in the commit history on the 1.5.0-exaforce branch, you can see that the earlier version of the commit for this PR made it into that branch somehow, regardless of the package publishing:

image

https://github.com/ExaForce/unovis/commits/1.5.0-exaforce/

I would have expected this PR to automatically get closed if the branch was merged, even if from CLI.

IMO there's a lot of overhead and confusion around "cleaning up" the commit history by squashing commits and force pushing branches. My preference would be to just let the commits stack up and leave the history intact, so that we can leverage all the various GitHub features like automatically merging PRs, and keeping the ability to view the before/after on specific commits, which are tied to the comment threads on the PRs. I think many of those features get broken when I do the force push on the branch, which is required to re-write the commit history with the really nice and clean commit messages.

@jakubjosef
Copy link

jakubjosef commented Dec 11, 2024

@curran It's easy - just maintain nice commit history on your own. Squash feature makes people lazy and just throwing random commits because "it would be eventually squashed". I'm sad we have this enforced for our main repo, but that's my personal opinion.

Also using force-push on feature branches is normal, I'm doing it multiple times a day - when you need to add something to existing commit you should use amend and force push - this way you can maintain clean history very easily.

@rokotyan
Copy link

@curran Let's discuss it on our sync on Friday. This puzzle has many pieces because we also want the same changes to be contributed to the main Unovis repo.

@rokotyan
Copy link

Currently I'm merging and releasing manually

@curran
Copy link
Author

curran commented Dec 11, 2024

This puzzle has many pieces because we also want the same changes to be contributed to the main Unovis repo.

Exactly! This is the pattern we need to figure out.

@curran
Copy link
Author

curran commented Dec 12, 2024

Current plan:

  • Pull in the text measuring logic from https://github.com/ExaForce/unovis/pull/8/files into here
  • Only trigger the automatic offsets if manual overrides not present
  • Align label and sub-label in left and right cases
  • Consider adding a new parameter like labelPadding for adding a bit of a gap with the automatic label placement

image

@curran curran force-pushed the donut-label-offsets branch from d16517b to e9e6c96 Compare December 12, 2024 18:55
@curran
Copy link
Author

curran commented Dec 12, 2024

Current status:

image image image image

@curran curran changed the title Component | Donut: Configurable central label offsets Component | Donut: Half Donut Label Placement Dec 12, 2024
@curran
Copy link
Author

curran commented Dec 12, 2024

Requesting re-review please @rokotyan . I think this could be ready to go. Thanks!

@rokotyan
Copy link

@curran The code looks elegant, I like it! I'm planning to run it tomorrow and if everything goes well, I'll release it

@curran curran changed the base branch from 1.5.0-exaforce to main December 13, 2024 15:35
@curran curran marked this pull request as draft December 13, 2024 15:57
@curran curran changed the base branch from main to 1.5.0-exaforce December 13, 2024 21:50
@curran
Copy link
Author

curran commented Dec 13, 2024

Closing in favor of #11

@curran curran closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants