mirror of
				https://github.com/red-data-tools/YouPlot.git
				synced 2025-11-04 11:38:10 +08:00 
			
		
		
		
	Improve comments
This commit is contained in:
		@@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user