mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 15:11:12 +08:00
Improve comments
This commit is contained in:
parent
22460f3689
commit
715236b5b4
@ -275,12 +275,14 @@ module Uplot
|
|||||||
end
|
end
|
||||||
|
|
||||||
def preprocess(input)
|
def preprocess(input)
|
||||||
data = CSV.parse(input, col_sep: @delimiter)
|
arr = CSV.parse(input, col_sep: @delimiter)
|
||||||
data.delete([]) # Remove blank lines.
|
# Remove blank lines.
|
||||||
data.delete_if { |i| i.all? nil } # Room for improvement.
|
arr.delete([])
|
||||||
p parsed_csv: data if @debug
|
# Remove rows where all elements are nil
|
||||||
headers = get_headers(data)
|
arr.delete_if { |i| i.all? nil }
|
||||||
data = get_data(data)
|
p parsed_csv: arr if @debug
|
||||||
|
headers = get_headers(arr)
|
||||||
|
data = get_data(arr)
|
||||||
[data, headers]
|
[data, headers]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user