Files
nebula.js/test/rendering/sheet/configured.js
Tobias Åström 65af64044c feat: chart bg colors and title styles from properties and theme (#1183)
* fix: show correct bg color from theme

* feat: show title styles in Nebula mashup

* chore: require theme

* chore: show titles in rendering test

* chore: set props in test correctly

* chore: set some font families

* chore: add font style support

* chore: fix tests

* chore: update image

* chore: use themed in sheet test

* chore: set separate bg color for sheet

* chore: proper prop

* chore: set sheet baseline
2023-03-28 18:16:25 +02:00

62 lines
1.2 KiB
JavaScript

const pie = {
component: {
mounted(el) {
// eslint-disable-next-line
el.innerHTML = '<div id="pie" style="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; height:100%; width:100%;">${env.translator.get('hello', [
'bar',
])}</div>`;
},
},
};
};
// eslint-disable-next-line
const configured = stardust.embed.createConfiguration({
context: {
language: 'sv-SE',
theme: 'bla',
},
themes: [
{
id: 'bla',
load: () =>
Promise.resolve({
_inherit: false,
color: '#fff',
object: {
backgroundColor: '#ff00ff',
},
backgroundColor: '#eeeeee',
fontSize: '20px',
fontFamily: 'Arial',
}),
},
],
types: [
{
name: 'piechart',
load: () => Promise.resolve(pie),
},
{
name: 'barchart',
load: () => Promise.resolve(bar),
},
],
});