Clientside callback to add trace in figure

I want to add a trace in the graph using client side java script code.
I have a graph with some data on x and y axis. I want to read the data and perform some calculation like average and plot this as a trace on client side everything using JS.

Is it possible to do so and is it a good way to move forward?

Hi @shanky1 welcome to the forums.

This is possible, unfortunately I don’t know anything about JS, but there are other users on this forum who do…

Hello @shanky1,

Why are you wanting to do this clientside exactly?

A thing you have to keep in mind is that each prop can only be used once as an output.

Also, calculations are a lot simpler, imo, on python vs JavaScript.

This particular graph has many traces which are based on heavy calculation. If i do it on server side there will be too much data to-and-fro. It will take around a minute to render.
To avoid this I just want to do it on server side.
It is a simple calculation which can be handled by browser and just a trace in the graph.

1 Like

Would you be able to post an MRE to aid with helping you out?