-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: support alignment translation of axis #30
base: master
Are you sure you want to change the base?
Conversation
Thanks for this feature!
From reading the commit message and the code it seems as if this change allows to put the axis "on the other" side (right side of plot for Y-axis and top of plot for the X-axis). Is this correct? |
@@ -122,6 +122,8 @@ type Range struct { | |||
InvNorm func(float64) float64 // Inverse of Norm() | |||
Data2Screen func(float64) int // Function to map data value to screen position | |||
Screen2Data func(int) float64 // Inverse of Data2Screen | |||
|
|||
AlignTrans bool // alignment translation of the axis: false: axis location left/bottom, true: axis location right/top |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlignTrans is not a clear name. I would prefer something like SwitchSide or AlternateSide or something else but it is not just a translation, and not really an alignment.
For the comment: Start with a capital letter.
Maybe
SwitchSide bool // Switch location of axis to top / right if true.
@@ -127,10 +127,10 @@ func (c *ScatterChart) Reset() { | |||
|
|||
// Plot outputs the scatter chart to the graphic output g. | |||
func (c *ScatterChart) Plot(g Graphics) { | |||
layout := layout(g, c.Title, c.XRange.Label, c.YRange.Label, | |||
layout := layoutWithAlign(g, c.Title, c.XRange.Label, c.YRange.Label, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is scatterplot the only one which calls layoutWithAlign?
Location Y axis to right.