Web Components
GlycanAge distributes a web component library ga-components. It's published under the MIT license and available via npm.
Web components are framework agnostic and can be used in any modern browser.
Installing the package
The easiest way to install @glycanage/web-components is to use the npm command.
You can do this by running the command:
npm i --save-exact @glycanage/web-components
Using a Component
All of the components depend on a GaReportService
property on the window
object.
<script>
window.GaReportService = {
getReport: (id) => {
return ...logic for fetching the report;
}
};
</script>
Firstly you'll need to import the component in your environment
import '@glycanage/web-components/dist/atherosclerosis.wc';
warning
Here we reference atherosclerosis.wc
, but you'll need to import specific component you need to render.
Now you can use the component anywhere in the html like so:
<ga-arthritis report="{{id}}" type="{{'header'|'summary'|null}}"></ga-arthritis>
- report - ID of the patients report
- type - The component has 3 mods of rendering 'header', 'summary' and null