Now exists as package in https://github.com/libris/lxlviewer/
JavaScript tools for the Libris XL infrastructure.
Install from git repo like so
npm install libris/lxltools-js --save
yarn add libris/lxltools-js --save
Specifiy version as usual if needed
When developing these files and testing changes to this repo in the applications that depend on it, use yarn link
or npm link
.
Functions related to fresnel.
Functions related to class structures of our base vocabulary.
String conversions etc.
The settings
parameter should at least contain the property language
(sv
, en
etc). This could be the same object that you use for general settings in your application, if you follow the same pattern.
The resources
parameter should be an object. Not all functions require all properties to be present, but a full version contains the following properties:
context
- The context in which to run the application. Ie the contents of https://id.kb.se/context.jsonlddisplay
- The fresnel definitions. Ie the contents of https://id.kb.se/vocab/display/data.jsonldvocab
- The base vocabulary as a Map. Ie a map conversion of the graph from https://id.kb.se/vocab/data.jsonldi18n
- Translations. Should be rather optional (translations will just fail if not found)
Depending on your application, you may want to enrich the resources
object with other things. This is generally not a problem, as long as the properties mentioned above aren't used for this.