mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2026-05-25 01:00:13 -04:00
6.0 KiB
6.0 KiB
id, title
| id | title |
|---|---|
| nucleus-reference | API Reference |
Table of contents
- interface: nucleus(app[, instanceConfig])
- interface: Context
- interface: Configuration
- class: Nucleus
- interface: ThemeInfo
- class: SupernovaController
- class: AppSelections
- interface: CreateConfig
- interface: BaseConfig
- interface: GetConfig
- [type Field = <string|qae.NxDimension|qae.NxMeasure|LibraryField>](#type-field-stringqaenxdimensionqaenxmeasurelibraryfield)
- interface: LibraryField
- interface: LoadType(type, env)
- interface: TypeInfo
API
interface: nucleus(app[, instanceConfig])
app<enigma.Doc>instanceConfig<Configuration>returns:<Nucleus>
Initiates a new Nucleus instance using the specified app.
import nucleus from '@nebula.js/nucleus';
const n = nucleus(app);
n.render({ id: 'abc' });
createConfiguration<Function> Creates a newnucleusscope bound to the specifiedconfiguration.
The configuration is merged with all previous scopes.
interface: Context
interface: Configuration
class: Nucleus
nucleus.render(cfg)
cfg<CreateConfig|GetConfig> The render configuration.returns:<Promise<SupernovaController>> A controller to the rendered supernova
Renders a supernova into an HTMLElement.
// render from existing object
n.render({
element: el,
id: 'abcdef',
});
// render on the fly
n.render({
type: 'barchart',
fields: ['Product', { qLibraryId: 'u378hn', type: 'measure' }],
});
nucleus.context(ctx)
Updates the current context of this nucleus instance. Use this when you want to change some part of the current context, like theme.
// change theme
n.context({ theme: 'dark' });
// limit constraints
n.context({ constraints: { active: true } });
nucleus.selections()
returns:<Promise<AppSelections>>
Gets the app selections of this instance.
const selections = await n.selections();
selections.mount(element);
interface: ThemeInfo
id<string> Theme identifierload<Function> A function that should return a Promise that resolve to a raw JSON theme
class: SupernovaController
A controller to further modify a supernova after it has been rendered.
const ctl = await nucleus(app).render({
element,
type: 'barchart',
});
ctl.destroy();
supernovaController.destroy()
Destroys the supernova and removes if from the the DOM.
const ctl = ctl.destroy();
class: AppSelections
appSelections.mount(element)
element<HTMLElement>
Mounts the app selection UI into the provided HTMLElement
selections.mount(element);
appSelections.unmount()
Unmounts the app selection UI from the DOM
selections.unmount();
interface: CreateConfig
- extends: <BaseConfig>
type<string>version<string>fields<Array>properties<qae.GenericObjectProperties>
interface: BaseConfig
element<HTMLElement>options<Object>
interface: GetConfig
- extends: <BaseConfig>
id<string>
type Field = <string|qae.NxDimension|qae.NxMeasure|LibraryField>
interface: LibraryField
qLibraryId<string>type<dimension|measure>