3dgeo-heidelberg / pytreedb

Python package providing a file and object-based database to store tree objects.
Other
28 stars 4 forks source link

Webfrontend: Save JSON #66

Closed bhoefle-3dgeo closed 2 years ago

bhoefle-3dgeo commented 2 years ago

The current export JSON files delivers JSON files without line breaks etc.

db.get_tree_as_json() should deliver well formatted (formatted as the input) JSON files with newlines and blanks etc.

@annachiu7 : where is this removal happening? also in the preview it looks ok but not when exporting.

annachiu7 commented 2 years ago

The preview uses a 3rd party plug-in to pretty-print it on the HTML. Actually, because the JSONs of the preview trees are already delivered to client side, we decided at that time to directly write the JSON strings to file for output to avoid excessive calls to the backend. With all that said: I just discovered a built-in pretty-printer of javascript JSON and updated it