1823 as a type of picture-viewing device, from French diorama (1822), from Greek di- "through" (see dia-) + orama "that which is seen, a sight" (see panorama). Meaning "small-scale replica of a scene, etc." is from 1902.
"The world viewed on a microscopic or subatomic scale; a small-scale theoretical or physical model of the world or of some aspect of it; a microcosm; ( Computing ) a simulated or virtual reality environment", 1920s; earliest use found in Science. From micro- + world.