Returns the visual tree stream in the format given by the parameter.
A stream with the json format of the visual tree.