Files
nebula.js/test/rendering/snaps/snapper.js
Tobias Åström c5a3bceec6 chore: get rid of jimp (#1659)
* chore: change snapper to es6

* chore: jimp 1.6.0

* chore: change snapper back

* chore: ems import of jimp

* chore: ems import of jimp

* chore: get rid of jimp

* chore: add baseline
2024-12-30 16:43:54 +01:00

39 lines
900 B
JavaScript

/* global configured */
/* eslint no-underscore-dangle: 0 */
(() => {
document.querySelectorAll('.object').forEach((element) => {
const type = element.getAttribute('data-type');
const obj = {
id: `${type}-${+new Date()}`,
getLayout: async () => ({
qInfo: {
qId: 'id:',
},
visualization: type,
}),
on() {},
once() {},
};
const app = {
id: `${+new Date()}`,
createSessionObject: async () => obj,
getObject: async () => obj,
getAppLayout: async () => ({ qTitle: '', qLocaleInfo: {} }),
};
const n = configured(app);
n.render({
type,
element,
}).then((viz) => {
element.addEventListener('click', () => {
viz.__DO_NOT_USE__.exportImage().then((res) => {
element.setAttribute('data-captured', res.url);
});
});
});
});
})();