mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2026-05-24 16:00:16 -04:00
* 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
39 lines
900 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
})();
|