mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 23:21:13 +08:00
Fix variables
This commit is contained in:
parent
975eb95f55
commit
b6c3ca9b43
@ -14,9 +14,6 @@ module Uplot
|
|||||||
@params = Params.new
|
@params = Params.new
|
||||||
|
|
||||||
@command = nil
|
@command = nil
|
||||||
@headers = nil
|
|
||||||
@delimiter = "\t"
|
|
||||||
@transpose = false
|
|
||||||
@output = false
|
@output = false
|
||||||
@count = false
|
@count = false
|
||||||
@fmt = 'xyy'
|
@fmt = 'xyy'
|
||||||
@ -32,6 +29,9 @@ module Uplot
|
|||||||
parser.parse_options
|
parser.parse_options
|
||||||
command = parser.command
|
command = parser.command
|
||||||
params = parser.params
|
params = parser.params
|
||||||
|
delimiter = parser.delimiter
|
||||||
|
transpose = parser.transpose
|
||||||
|
headers = parser.headers
|
||||||
|
|
||||||
if command == :colors
|
if command == :colors
|
||||||
Plot.colors
|
Plot.colors
|
||||||
@ -42,7 +42,7 @@ module Uplot
|
|||||||
while input = Kernel.gets(nil)
|
while input = Kernel.gets(nil)
|
||||||
input.freeze
|
input.freeze
|
||||||
@raw_inputs << input
|
@raw_inputs << input
|
||||||
@data = Preprocessing.input(input, @delimiter, @headers, @transpose)
|
@data = Preprocessing.input(input, delimiter, headers, transpose)
|
||||||
pp @data if @debug
|
pp @data if @debug
|
||||||
case command
|
case command
|
||||||
when :bar, :barplot
|
when :bar, :barplot
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
module Uplot
|
module Uplot
|
||||||
class Command
|
class Command
|
||||||
class Parser
|
class Parser
|
||||||
attr_reader :command, :params, :main_parser, :sub_parsers
|
attr_reader :command, :params, :main_parser, :sub_parsers, :delimiter, :transpose, :headers
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@sub_parsers = create_sub_parsers
|
@sub_parsers = create_sub_parsers
|
||||||
@main_parser = create_main_parser
|
@main_parser = create_main_parser
|
||||||
@command = nil
|
@command = nil
|
||||||
@params = Params.new
|
@params = Params.new
|
||||||
|
|
||||||
|
@delimiter = "\t"
|
||||||
|
@transpose = false
|
||||||
|
@headers = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_default_parser
|
def create_default_parser
|
||||||
@ -51,7 +55,7 @@ module Uplot
|
|||||||
params.padding = v
|
params.padding = v
|
||||||
end
|
end
|
||||||
opt.on('-c', '--color VAL', 'color of the drawing', String) do |v|
|
opt.on('-c', '--color VAL', 'color of the drawing', String) do |v|
|
||||||
params.color = v =~ /\A[0-9]+\z/ ? v.to_i : v.to_sym
|
params.color = v =~ /\<[0-9]+\>/ ? v.to_i : v.to_sym
|
||||||
end
|
end
|
||||||
opt.on('--[no-]labels', 'hide the labels', TrueClass) do |v|
|
opt.on('--[no-]labels', 'hide the labels', TrueClass) do |v|
|
||||||
params.labels = v
|
params.labels = v
|
||||||
|
Loading…
Reference in New Issue
Block a user