My main point is basically that Dash has no opinions or functions to build the “elements” array for you. There might be other libraries to do that that I am not aware of, but I imagine that this is pretty much problem-specific to have a general solution.
I think that your approach is very solid and indeed you’ll have to somehow translate the data you have into something that follows the expected format of “elements”.