pyspur icon indicating copy to clipboard operation
pyspur copied to clipboard

Replace custom HTML with a JSON view

Open rajeev opened this issue 9 months ago • 1 comments

In one of my nodes, there's a huge amount of JSON formatted data returned by an API (about 600KB of data, including several base64 encoded images). Along with all of the other nodes in my spur, this causes the entire frontend to be extremely slow, or even freeze, after the workflow is run and all the outputs are rendered.

After replacing with this JSONView, the performance is far better.

I don't have any benchmarks or anything for this, so feel free to reject it. I just thought it might be useful in general.


[!IMPORTANT] Replaces custom HTML with JsonView in NodeOutputDisplay.tsx to improve performance for large JSON data.

  • Behavior:
    • Replaces custom HTML rendering with JsonView in NodeOutputDisplay.tsx for JSON data.
    • Improves performance for large JSON data sets, such as those with base64 images.
  • Imports:
    • Adds JsonView and its CSS from react18-json-view.
  • Misc:
    • Removes custom HTML and button logic for JSON rendering in renderJsonObject().

This description was created by Ellipsis for 72d3550ce8500f8b46ee3360036ebe2996dc6930. It will automatically update as commits are pushed.

rajeev avatar Mar 04 '25 15:03 rajeev

Thank you very much! We'll take a look

JeanKaddour avatar Mar 04 '25 15:03 JeanKaddour

Thanks for the PR @rajeev . Merging this!

srijanpatel avatar Mar 09 '25 00:03 srijanpatel