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

Added ColorMap types and legends #322

Merged
merged 1 commit into from Dec 17, 2016
Merged

Added ColorMap types and legends #322

merged 1 commit into from Dec 17, 2016

Conversation

ctessum
Copy link
Contributor

@ctessum ctessum commented Oct 30, 2016

This is related to issues #304, #133, and #17

Copy link
Member

@kortschak kortschak left a comment

Choose a reason for hiding this comment

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

Initial review.


// ColorMapLegend is a plot.Plotter that draws a color bar legend for a ColorMap.
type ColorMapLegend struct {
// Vertical determines wether the legend will be
Copy link
Member

Choose a reason for hiding this comment

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

whether

// The default is false (horizontal).
Vertical bool

// NColors specifies the number of colors to be
Copy link
Member

Choose a reason for hiding this comment

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

s/NColors/Colors/g


// StringMap fulfils the ColorMapString interface, mapping integer
// categories to colors.
type StringMap struct {
Copy link
Member

Choose a reason for hiding this comment

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

Could this not be a map?

// If scalar is outside of the allowed range, an error is returned.
type ColorMap interface {
// At returns the color associated with the value scalar.
At(scalar float64) (color.Color, error)
Copy link
Member

Choose a reason for hiding this comment

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

s/scalar/v/ or even s/scalar// (updating the comment).


// IntMap fulfils the ColorMapInt interface, mapping integer
// categories to colors.
type IntMap struct {
Copy link
Member

Choose a reason for hiding this comment

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

Could this not be a map?

// If there is no mapped color for the given category, an error is returned.
type ColorMapInt interface {
// At returns the color associated with category cat.
At(cat int) (color.Color, error)
Copy link
Member

Choose a reason for hiding this comment

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

s/At/Color/g ?
s/cat/int/g or s/cat/v/g

@kortschak
Copy link
Member

What happened here?

@ctessum
Copy link
Contributor Author

ctessum commented Dec 12, 2016

This has become a bit of a mess. It depends on the changes in #321, but in response to comments over there I have moved some of the code from this PR over there. Once that one is merged I will fix this one.

@ctessum ctessum force-pushed the moreland branch 4 times, most recently from 4f4fdeb to 235bd2a Compare December 16, 2016 23:56
@ctessum
Copy link
Contributor Author

ctessum commented Dec 17, 2016

This pull request was based on a non-master branch, which has caused some trouble. I will start a new one relative to master.

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.

None yet

2 participants