mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 09:48:18 -05:00
* feat: add basic sheet rendering support * chore: add missing file * fix: correct bg colors for none support * chore: fix test that relied on dark bg * chore: fix ref * chore: api spec update * chore: add todo comments * chore: use memo * chore: a bit less verbose * chore: list * chore: cleaning * chore: add rendering test * chore: enable rendering test * chore: settings * chore: settings * chore: disable rendering tests * chore: revert test tests
47 lines
972 B
JavaScript
47 lines
972 B
JavaScript
/* global configured */
|
|
/* eslint no-underscore-dangle: 0 */
|
|
(() => {
|
|
async function getMocks(EnigmaMocker) {
|
|
const { getSheetLayout, getBarLayout, getPieLayout } = window.getFuncs();
|
|
|
|
const obj = [
|
|
{
|
|
id: `sheet`,
|
|
type: 'sheet',
|
|
getLayout: () => getSheetLayout(),
|
|
},
|
|
{
|
|
id: `bar`,
|
|
type: 'barchart',
|
|
getLayout: () => getBarLayout(),
|
|
},
|
|
{
|
|
id: `pie`,
|
|
type: 'piechart',
|
|
getLayout: () => getPieLayout(),
|
|
},
|
|
];
|
|
|
|
const app = await EnigmaMocker.fromGenericObjects(obj);
|
|
|
|
return {
|
|
obj,
|
|
app,
|
|
};
|
|
}
|
|
|
|
const init = async () => {
|
|
const element = document.querySelector('#object');
|
|
const { app } = await getMocks(window.stardust.EnigmaMocker);
|
|
|
|
const nebbie = configured(app);
|
|
|
|
const inst = await nebbie.render({ id: 'sheet', element });
|
|
return () => {
|
|
inst?.unmount(element);
|
|
};
|
|
};
|
|
|
|
return init();
|
|
})();
|