forked from qlik-oss/halyard.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-data.js
31 lines (17 loc) · 821 Bytes
/
local-data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const path = require('path');
const enigmaConfig = require('./enigma-config.js');
const enigma = require('enigma.js');
const enigmaMixin = require('../dist/halyard-enigma-mixin.js');
enigmaConfig.mixins = enigmaMixin;
const Halyard = require('../dist/halyard.js');
const filePath = path.join(__dirname, './data/airports.csv');
const halyard = new Halyard();
const table = new Halyard.Table(filePath, { name: 'Airports', fields: [{ src: 'rowID', name: 'Id' }, { src: 'Country', name: 'Country' }], delimiter: ',' });
halyard.addTable(table);
enigma.getService('qix', enigmaConfig).then((qix) => {
const appName = `Local-Data-${Date.now()}`;
qix.global.createAppUsingHalyard(appName, halyard).then((result) => {
console.log(`App created and reloaded - ${appName}.qvf`);
process.exit(1);
});
});