In the visualizer you can extend the "types" defined by javascript with other specific types.
The structure of a value will be something like:
{"type":"mf", "value":"C10H20O3"}
Each type may be associated to a renderer. This could be a simple render allowing to put in a molecular formula the number in subscript or more complex renderer allowing to display a chart.
In this example we display the type "png". Please note that the value contains a URL that may contain the URL encoded value of the image.