JS9.create: a full editor in one call

Include the JS9 files, add an empty <div>, and call JS9.create() with the container's id. No hand-placed menubar/ toolbar/display divs, and no required configuration — override a default only if you want to.

Full editor (default layout)

JS9.create("viewer", {
  image: "../data/example.fits.gz",
  opts: { scale: "log", colormap: "viridis" }
});

Minimal layout (just the image)

JS9.create("viewer2", {
  layout: "minimal",
  image: "../data/example.fits.gz",
  opts: { colormap: "heat" }
});

Declarative (no script)

<div class="JS9Editor"
     data-layout="viewer"
     data-image="../data/example.fits.gz"
     data-colormap="cool"></div>

Layout presets: full, viewer, minimal. Compose parts on top of a preset, e.g. JS9.create("viewer", {layout: "minimal", menubar: true, panner: true}), or define your own named looks by adding to JS9.Layouts.