Skip to content

Commit

Permalink
ToAxisOption -> toAxisOption
Browse files Browse the repository at this point in the history
The axisOption struct is internal, only used to minimize code duplication between the x and y axis.
  • Loading branch information
jentfoo committed Jan 10, 2025
1 parent 5415948 commit 6420826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions xaxis.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type XAxisOption struct {
const defaultXAxisHeight = 30
const boundaryGapDefaultThreshold = 40

func (opt *XAxisOption) ToAxisOption() axisOption {
func (opt *XAxisOption) toAxisOption() axisOption {
position := PositionBottom
if opt.Position == PositionTop {
position = PositionTop
Expand Down Expand Up @@ -63,5 +63,5 @@ func (opt *XAxisOption) ToAxisOption() axisOption {

// newBottomXAxis returns a bottom x-axis renderer.
func newBottomXAxis(p *Painter, opt XAxisOption) *axisPainter {
return newAxisPainter(p, opt.ToAxisOption())
return newAxisPainter(p, opt.toAxisOption())
}
6 changes: 3 additions & 3 deletions yaxis.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type YAxisOption struct {
SpineLineShow *bool
}

func (opt *YAxisOption) ToAxisOption(p *Painter) axisOption {
func (opt *YAxisOption) toAxisOption(p *Painter) axisOption {
position := PositionLeft
if opt.Position == PositionRight {
position = PositionRight
Expand Down Expand Up @@ -91,15 +91,15 @@ func newLeftYAxis(p *Painter, opt YAxisOption) *axisPainter {
p = p.Child(PainterPaddingOption(Box{
Bottom: defaultXAxisHeight,
}))
return newAxisPainter(p, opt.ToAxisOption(p))
return newAxisPainter(p, opt.toAxisOption(p))
}

// newRightYAxis returns a right y-axis renderer.
func newRightYAxis(p *Painter, opt YAxisOption) *axisPainter {
p = p.Child(PainterPaddingOption(Box{
Bottom: defaultXAxisHeight,
}))
axisOpt := opt.ToAxisOption(p)
axisOpt := opt.toAxisOption(p)
axisOpt.Position = PositionRight
axisOpt.SplitLineShow = false
return newAxisPainter(p, axisOpt)
Expand Down

0 comments on commit 6420826

Please sign in to comment.