simple example to visualize spectra using javascript