Files
nebula.js/test/rendering/sheet/configured.js
Tobias Åström 3dacac587b feat: sheet embed support (#1013)
* 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
2022-12-12 13:54:04 +01:00

46 lines
921 B
JavaScript

const pie = {
component: {
mounted(el) {
// eslint-disable-next-line
el.innerHTML = '<div id="pie" style="background: aliceblue; height:100%; width:100%;">Hello pie</div>';
},
},
};
const bar = function (env) {
env.translator.add({
id: 'hello',
locale: {
'sv-SE': 'Hej {0}!',
},
});
return {
component: {
mounted(el) {
// eslint-disable-next-line
el.innerHTML = `<div id="bar" style="font-size: 64px; background: tan; height:100%; width:100%;">${env.translator.get(
'hello',
['bar']
)}</div>`;
},
},
};
};
// eslint-disable-next-line
const configured = stardust.embed.createConfiguration({
context: {
language: 'sv-SE',
},
types: [
{
name: 'piechart',
load: () => Promise.resolve(pie),
},
{
name: 'barchart',
load: () => Promise.resolve(bar),
},
],
});