Skip to content

Commit 5ce7db2

Browse files
committed
Unify DEFAULT_WIDTH
1 parent e64c525 commit 5ce7db2

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/unicode_plot/barplot.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ class Barplot < Plot
33
include ValueTransformer
44

55
MIN_WIDTH = 10
6-
DEFAULT_WIDTH = 40
76
DEFAULT_COLOR = :green
87
DEFAULT_SYMBOL = "■"
98

@@ -77,7 +76,7 @@ def print_row(out, row_index)
7776
end
7877

7978
module_function def barplot(*args,
80-
width: Barplot::DEFAULT_WIDTH,
79+
width: Plot::DEFAULT_WIDTH,
8180
color: Barplot::DEFAULT_COLOR,
8281
symbol: Barplot::DEFAULT_SYMBOL,
8382
border: :barplot,

lib/unicode_plot/boxplot.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module UnicodePlot
44
class Boxplot < Plot
55
MIN_WIDTH = 10
66
DEFAULT_COLOR = :green
7-
DEFAULT_WIDTH = 40
87

98
def initialize(data, width, color, min_x, max_x, **kw)
109
if min_x == max_x
@@ -101,7 +100,7 @@ def print_row(out, row_index)
101100
data: nil,
102101
border: :corners,
103102
color: Boxplot::DEFAULT_COLOR,
104-
width: Boxplot::DEFAULT_WIDTH,
103+
width: Plot::DEFAULT_WIDTH,
105104
xlim: [0, 0],
106105
**kw)
107106
case args.length

lib/unicode_plot/grid_plot.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module UnicodePlot
22
class GridPlot < Plot
33
MIN_WIDTH = 5
4-
DEFAULT_WIDTH = 40
54
MIN_HEIGHT = 2
65
DEFAULT_HEIGHT = 15
76

lib/unicode_plot/plot.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module UnicodePlot
22
class Plot
33
include StyledPrinter
44

5+
DEFAULT_WIDTH = 40
56
DEFAULT_BORDER = :solid
67
DEFAULT_MARGIN = 3
78
DEFAULT_PADDING = 1

0 commit comments

Comments
 (0)