mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[API] Document default composition provider
https://github.com/nasa/openmct/issues/1122#issuecomment-252115292 Fixes #1122
This commit is contained in:
parent
94319df69b
commit
381f3d9b69
29
API.md
29
API.md
@ -129,8 +129,10 @@ provider.
|
||||
|
||||
The "composition" of a domain object is the list of objects it contains,
|
||||
as shown (for example) in the tree for browsing. Open MCT provides a
|
||||
default solution for composition, but there may be cases where you want
|
||||
to provide the composition of a certain object (or type of object) dynamically.
|
||||
[default solution](#default-composition-provider) for composition, but there
|
||||
may be cases where you want to provide the composition of a certain object
|
||||
(or type of object) dynamically.
|
||||
|
||||
For instance, you may want to populate a hierarchy under a custom root-level
|
||||
object based on the contents of a telemetry dictionary.
|
||||
To do this, you can add a new CompositionProvider:
|
||||
@ -146,6 +148,29 @@ openmct.composition.addProvider({
|
||||
});
|
||||
```
|
||||
|
||||
#### Default Composition Provider
|
||||
|
||||
The default composition provider applies to any domain object with
|
||||
a `composition` property. The value of `composition` should be an
|
||||
array of identifiers, e.g.:
|
||||
|
||||
```js
|
||||
var domainObject = {
|
||||
name: "My Object",
|
||||
type: 'folder',
|
||||
composition: [
|
||||
{
|
||||
key: '412229c3-922c-444b-8624-736d85516247',
|
||||
namespace: 'foo'
|
||||
},
|
||||
{
|
||||
key: 'd6e0ce02-5b85-4e55-8006-a8a505b64c75',
|
||||
namespace: 'foo'
|
||||
}
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
### Adding Telemetry Providers
|
||||
|
||||
When connecting to a new telemetry source, you will want to register a new
|
||||
|
Loading…
Reference in New Issue
Block a user