A widget for choosing concepts from the Unified Astronomy Thesaurus (UAT). It currently looks like this:
We host a live version of the widget on the UAT website:
See dist/index.html for a minimal example webpage that will demonstrate the concept chooser.
We don’t currently host a world-accessible version of the UAT chooser, so if you want to embed it in your own website, you must build and upload it yourself. To do so, run
$ npm install $ npm run build
and then copy the contents of the
dist/ directory, minus
your web server. Tweak the sample HTML and embed it in your webpage as
To test the local code in a web browser, you can launch a webserver that
serves static files from the
dist/ directory. There are
many ways to do this. We suggest:
$ cd dist $ npx httpserver 8000
Then navigate your browser to http://localhost:8000/.
TODO: show how to extract the list of selected keywords!
What I’ve set up here is an
npm run build command that will combine the
widget code with the script.aculo.us modules that it uses. That way, the only
special thing you need to do is to make sure to load
loading this package.
The main output file created by the
npm run build command is
dist/uat-chooser.js. This module is built in Webpack’s
so that if you load it in a webpage it will create a global variable named
uat_chooser that represents the module. That module currently has one API
function takes the ID of a
<div class="uat-widget"> element that will be
set up with the UAT concept-choosing interface.
The original code was donated by Precision Computer Works, Inc. / eJournalPress to the American Astronomical Society. Licensed under the MIT License.