Bodylight plugin for Aurelia framework
npm install aurelia-bodylight-pluginWeb components of the Bodylight library is a suite of custom elements enhancing HTML.
It is distributed either as
* 1. Aurelia web components - follow this instruction further, framework dependent distribution. Follow instructions further
* 2. Standard web components - framework agnostic distibution with 1 independent JS file. Follow Bodylight.js-Components to create web simulator using HTML or Markdown or mor complex application using different framework.
Web components contains:
* FMU component able to be execute in browser. Modelica model is exported to FMU using FMI standard and Bodylight FMU Compiler can convert FMU with source codes and solver into WebAssembly script.
* Adobe-Animate and Gif-Animate component able to control animation exported from Adobe-Animate or animated GIF and bind them to variables of model simulation.
* ChartJS, DygraphJS, PlotlyJS components to visualise model variables in different chart types and libraries.
* Following Web components standard to be broadly compatible with any web application.
bdl-fmi component, and modelDescription.xml - standard FMU description with variable references.bdl-adobe component.We recommend to use aurelia framework to build web application with Bodylight Web components.
Follow Aurelia doc's how to prepare your project and install aurelia-bodylight-plugin by npm command-line:
``bash`
npm i aurelia-bodylight-plugin
In your main.js file enable the plugin by aurelia.use.plugin(PLATFORM.moduleName('aurelia-bodylight-plugin')), so it may look like:`javascript
//main.js
import {PLATFORM} from 'aurelia-pal';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.plugin(PLATFORM.moduleName('aurelia-bodylight-plugin'))
aurelia.start().then(() => {
aurelia.setRoot(PLATFORM.moduleName('app'));
});
}
`bdl-
Bodylight web components are available in any template, use them without prefix:`html`
...docs/Reference manual
For further doc refer
To Build and test
* au build-plugin - builds plugin - outpu to distau build
* - builds dev-app with documentation - output to /scriptau test
* - execute unit tests
To publish NPM package version NPM aurelia-bodylight-plugin
* npm login - logs into NPM - need to be contributor for np
* - UI for release the new version (will ask for patch,minor or major version)
javascript
export function configure(aurelia) {
aurelia.use
...
//use this routine to register HTML only component as web component
.globalResources(PLATFORM.moduleName('components/mycomponent.html'))
//use this routine to register component (JS and HTML) as web component
.globalResources(PLATFORM.moduleName('components/mycomponent'))
...
`* create documentation in
docs
* create unit test in test
* build plugin au build-plugin and build dev-app with docs using au build and see docs/index.html Release history
$3
* follow https://github.com/creative-connections/aurelia-bodylight-plugin/releases
* follow https://github.com/creative-connections/Bodylight.js-Components/releases
* compiled JS distributed as NPM packages aurelia plugin: npm i aurelia-bodylight-plugin standard web components: npm i bodylight-components
$3
* consolidated docs and tests
$3
* removed unused packages
* created npm package aurelia-bodylight-plugin - can be installed using
`
npm -i aurelia-bodylight-plugin
`
$3
* aurelia templating left as is
all elements renamed, do not have bdl- prefix or Bdl in name,
* aurelia-web-components patched with 'forcePrefix' option to have consistent prefix for all web components
$3
* aurelia-templating throws 'behaviorInstruction' is undefined - need to patch from \patch` directory