Draw Table Update

john's Avatar

john

29 Aug, 2024 07:37 AM

NOTE: I added a subsequent update to this update. See below for latest version.

I have added some improvements to my draw_table node:

  • fixed bug that sometimes caused an error when displaying points
  • now tolerates columns with mixed or unusual items
  • now uses fit_true and scale_true for fidelity at all sizes
  • added NEW render path option

Render path is particularly handy when debugging to spot incorrect paths in a table. You can also use it to produce quick and dirty presentation slides or whenever you need to show data in context or turn a small CSV into a PNG.

Screenshot and demo attached. Click the checkboxes to see what happens.

Enjoy!

  1. Support Staff 1 Posted by john on 31 Aug, 2024 11:07 PM

    john's Avatar

    Update to my update!

    I thought I was done with improvements to this node, but came up with one more...

    The newest version of draw_table now supports styling on individual cells using my style_text node. You can highlight cells by italicizing them, bolding them, turning them red, or any combination of the three.

    In order to do this you must first identify the cells you wish to highlight. This is done by two other nodes (supplied in the demo), hilite_string and hilite_numb; use the first for text, the second for numbers. Identify the column of the table and the value you wish to highlight. For text strings this must be an exact match. For numbers you can use a comparator (e.g. all numbers < 0). Then check any combination of the three checkboxes, Italic, Bold, and/or Red and feed the modified table data into your draw_table node. You can chain multiple hilite nodes together if you wish.

    The attached demo shows two examples. In the first I turn the first three columns of the "Square" row bold and red to show that its area serves as a comparison for the rest. In the second, I show Payment items in bold italic, amounts <0 in red, and changes <0 in bold red. If you choose the "Align numbers" option in draw_table, highlighted numbers will align correctly.

    One known issue. Because my style_text node uses asterisks (*) and tildes (~) to mark highlighted text, it may become confused by table cells containing those two characters. It shouldn't break, but it might hide those characters. This would take a lot of work to fix, and I thought it would be unlikely to cause much trouble in real life, so I left this in. If anyone uses this new feature and finds a real-world example requiring you to create drawable tables with highlighted cells containing asterisks or tildes, please reply to this thread and include your use case.

    Screenshot and demo attached. As always I will be overjoyed to hear any feedback about these new features.

  2. Support Staff 2 Posted by john on 13 Dec, 2024 02:13 AM

    john's Avatar

    One more (minor) update...

    I fixed a bug that could cause dramatic slowdowns and even out of memory errors when drawing large tables with with rendered points or paths.

    I also updated the fit_true node within draw_table which allows me to set a minimum and maximum stroke width for rendered paths in tables. If the path has a non-zero stroke width I set this minimum to .5 and the maximum to 10. This ensures that even large paths severely shrunk to fit into the table will still be easily visible. The update also ensures that horizontal or vertical lines rendered in a table will be visible.

    The demo works the same as above so I won't post a new one. Instead I will just include this updated version in the next release of my library, which I plan to publish soon,

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • draw_table_screenshot 462 KB
  • draw_table_update.ndbx.zip 15.9 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

26 Jan, 2025 02:09 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM

 

21 Jan, 2025 09:36 AM
21 Jan, 2025 02:00 AM
16 Jan, 2025 08:30 PM
15 Jan, 2025 06:37 AM
04 Jan, 2025 04:09 AM
03 Jan, 2025 05:32 PM