Trim trailing spaces

This commit is contained in:
Nikolay Rozhkov
2023-06-21 01:37:06 +03:00
parent a2c055ba5d
commit 362648b74b
4 changed files with 76 additions and 74 deletions

View File

@@ -87,6 +87,7 @@ Tidal,Electricity grid,9.452
UK land based bioenergy,Bio-conversion,182.01 UK land based bioenergy,Bio-conversion,182.01
Wave,Electricity grid,19.013 Wave,Electricity grid,19.013
Wind,Electricity grid,289.366 Wind,Electricity grid,289.366
</pre </pre
> >

View File

@@ -64,5 +64,6 @@ Thermal generation,Losses,787.129
Thermal generation,District heating,79.329 Thermal generation,District heating,79.329
Tidal,Electricity grid,9.452 Tidal,Electricity grid,9.452
UK land based bioenergy,Bio-conversion,182.01 UK land based bioenergy,Bio-conversion,182.01
Wave,Electricity grid,19.013 Wave,Electricity grid,19.013
Wind,Electricity grid,289.366 Wind,Electricity grid,289.366
1 Agricultural 'waste' Bio-conversion 124.729
64 Thermal generation District heating 79.329
65 Tidal Electricity grid 9.452
66 UK land based bioenergy Bio-conversion 182.01
67 Wave Electricity grid 19.013
68 Wave Wind Electricity grid 19.013 289.366
69

View File

@@ -1,5 +1,5 @@
import diagram from './sankey.jison'; import diagram from './sankey-arrow.jison';
import { parser } from './sankey.jison'; import { parser } from './sankey-arrow.jison';
import db from '../sankeyDB.js'; import db from '../sankeyDB.js';
// import { fail } from 'assert'; // import { fail } from 'assert';

View File

@@ -62,9 +62,9 @@ opt_eof
record record
: field\[source] COMMA field\[target] COMMA field\[value] { : field\[source] COMMA field\[target] COMMA field\[value] {
const source = yy.findOrCreateNode($source); const source = yy.findOrCreateNode($source.trim());
const target = yy.findOrCreateNode($target); const target = yy.findOrCreateNode($target.trim());
const value = parseFloat($value); const value = parseFloat($value.trim());
$$ = yy.addLink(source,target,value); $$ = yy.addLink(source,target,value);
} // parse only 3 fields, this is not part of standard } // parse only 3 fields, this is not part of standard
| // allow empty record to handle empty lines, this is not part of csv standard either | // allow empty record to handle empty lines, this is not part of csv standard either