Skip to content

IHasColormap and automatic Colorbar tick placement#1403

Merged
swharden merged 16 commits intomasterfrom
colorbar-ticks
Oct 24, 2021
Merged

IHasColormap and automatic Colorbar tick placement#1403
swharden merged 16 commits intomasterfrom
colorbar-ticks

Conversation

@swharden
Copy link
Member

@swharden swharden commented Oct 23, 2021

This PR creates IHasColormap which can be applied to Plottable objects to expose their colormap/limits to the Colorbar class, allowing the two to be connected. Logic was also added to the Colorbar class to automatically generate ticks.

Limitations: Ticks are generated for a target density (number of pixels per tick), evenly spaced-out between a min/max value, and are not intelligently chosen (e.g., round numbers). Tick placement/labeling can be refined in the future, perhaps in combniation with refactoring the TickCollection module which has been a to-do item for a long time #1028

image

resolves #1362

This interface will be implemented by plottables containing a colormap to expose their colors/values easier to the colorbar class
@swharden swharden linked an issue Oct 23, 2021 that may be closed by this pull request
Public properties were added to Colormap to define the value range defined by the color range
Now that the value range can be stored in the Colormap itself this interface does not need properties to hold these values
@swharden swharden marked this pull request as ready for review October 23, 2021 15:39
@swharden swharden requested a review from bclehmann October 23, 2021 15:39
@swharden
Copy link
Member Author

Hey @bclehmann, I know you've done a lot of work on heatmaps previously so I'd love your input on this strategy. I think it makes sense to connect heatmaps and colorbars this way, but another set of eyes on this would be great.

I don't want to fall off the deep end of calculating ideal/round tick positions right now, but I'll probably create an issue to work toward that after this gets merged.

Copy link
Member

@bclehmann bclehmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main architecture looks good, I had just a couple notes on the details.

@swharden swharden merged commit bb728f8 into master Oct 24, 2021
@swharden swharden deleted the colorbar-ticks branch October 24, 2021 02:27
@bclehmann
Copy link
Member

I see you merged it already @swharden, I was in the middle of a review. The comments were pretty small as it is.

@swharden
Copy link
Member Author

I see you merged it already @swharden, I was in the middle of a review. The comments were pretty small as it is.

Dang, I'm really sorry for merging this in too quick @bclehmann - I had your initial review up on my other monitor and saw all the comments were ~6 hours old and I addressed/resolved all of them but didn't give you a chance to review the changes/comments and give additional feedback and final approval.

I'll be more careful to move slower in the future 👍 Again, I really appreciate all your feedback here!

swharden added a commit that referenced this pull request Oct 24, 2021
@bclehmann
Copy link
Member

All good, I see you addressed my comments in a later commit.

There was a typo , I added a comment but I don't know if github notifies you if you comment on a commit.

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.

Colorbar: improve automatic tick placement

2 participants