Client Customisation API¶
The functionality detailed in this page needs more attention, both in terms of testing and code development. We expect there to be some bugs and possible API changes. If you rely on this functionality, we recommend you pin your installation of Auspice to a specific version. Please get in touch with us if you are using these customisations so that we can work with you!
This page details the available options and format of the customisations available at (client) build time. They are contained in a JSON file supplied to Auspice via
auspice build --extend <JSON>
Note that the hot-reloading development functionality does not work for code which is included via this client customisation mechanism.
Thus, while you can run
auspice develop --extend <JSON> it will not update as you may expect!
The following are definable as top-level keys of the JSON file. A useful reference may be the customisation JSON file used by nextstrain.org.
sidebarThemeallows modifications to the aesthetics of the sidebar. See below.
navbarComponenta (relative) path to a JS file exporting a React component to be rendered as the nav bar. See below.
browserTitleThe browser title for the page. Defaults to “auspice” if not defined.
googleAnalyticsKeyYou can specify a Google Analytics key to enable (some) analytics functionality. More documentation to come.
serverAddressSpecify the address / prefix which the auspice client uses for API requests.
One way to extend Auspice is by replacing React components with your own custom components. These custom components will receive props defined here, which can be used to update the rendering of the component using the normal react lifecycle methods. Right now this is only available for the splash page and nav-bar components, whose interfaces are defined here.
auspice build or
Define a custom splash page for Auspice. Please note that this is extremely expirimental and the interface is expected to change.
React Props available:
||Object||available datasets and narratives|
||Object||Browser width & height|
||function||access to redux's dispatch mechanism|
Specifying the API server address¶
By default, the client makes API requests (as detailed here) to “/charon/getAvailable”, “/charon/getDataset” etc.
This is using the default server address of “/charon”.
This can be changed by specifying
serverAddress in the customisation JSON.
Note that currently you can’t specify a different domain due to CORS headers. This may well be a simple fix – please get in touch if you can help here!