Is there currently a way to send arrays through nodes? We are looking for a way to visualize data from a Fast Fourier Transform inside of the Spatial Toolbox display
@jadelano currently you can use the publicData API to write and read to a node all kinds of objects. The flow engine only supports simple number types.
It looks like you can send text through the flow engine. However we have not officially added that kind of support at the moment.
What you can try is to JSON.stringily your array, send it as text trough the flow engine and JSON.parse it on the other side.
My first guess is that you have to do this step since the flow engine performs a value comparison to make sure that the engine is not called on unchanged data.
In javascript you can not compare two objects, only simple data types. We would need to add some extra work and include a recursive comparison to support arrays and objects.
Could you post an example for what you want to do? It could be interesting to learn from your example and see if there are options to expand the flow engine.
@valentin Thank you for posting some potential solutions, I’ll try those out and get back to you on that.
I am on the Academic team are working with connecting a LEGO Spike Prime to Spatial Toolbox and taking the vibration data from the motors on the Prime and running them through an FFT as part of a future tutorial that we will be putting out. Right now, the way that we would be doing this would to run the Prime, send the vibration to a separate data storage, which is currently Excel, run that data through an FFT in Python and send the max frequency back into Spatial Toolbox to be viewed as a value.
What we would like to be able to do is cut out the middle steps so that the data can be transformed straight from the Spike Prime readings and visualized as a max frequency value in Spatial Toolbox or even better yet, view the frequency graph in the Spatial context