Skip to content

Embedding a Spec

Every other example shows only its spec. This one shows the whole JavaScript file: import AutkGrammar, describe the application as a spec, point the grammar at a canvas and a div, and run it.

Live Playground

Interaction

Double click a feature on the map to select it. The selection is shared with the plot, and selecting in the plot highlights the matching features on the map.

Highlights

  • new AutkGrammar({ map, plot }) takes the ids of a <canvas> and a <div>
  • await grammar.run(spec) loads the data and draws the views
  • the page only needs <canvas id="map"></canvas> and <div id="plot"></div>

Released under the MIT License.