Created by: zeffii
an explanation of the current implementation:
- The console node interprets the incoming text data, and depending on the color mode does full
- code tokenizing
- random char colors (why?.. as tests..)
- no color.
- The incoming text longest line is found, and this is used to set the terminal_width. The longest line is also used to pad all shorter lines with whitespace. The new padded text is stored as a multiline string in
node.terminal_text
. - Then it makes a grid of
x * y
character cells, each cell is 2 triangles.- So for example 2 lines, of 5 chars is 10 cells, that makes a total of 20 triangles.
The issue is when you load a json of a stored sverchok layout, and the json contains a monad, the "groups"
key will contain one or more very long lines (because it describes a nodetree but as a flat string ) . This will then push the longest line length to a considerable length, and as a conseqence the total amount of triangles produced by the drawing callback is going to cause considerable slow down in drawing.
the solution in this implementation is to automatically trim the longest line, the problem however is exactly what to do with that line.
- simply trim it and break lexing?
- trim it by replacing the line with a placeholder to indicate
# this line is trimmed
, and make it parsable as a code comment. (not breaking lexer) - replace it with spaces
- completely skip the long line, and display a warning.