This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
var fs = require('fs'); | |
var request = require('request'); | |
// Set our request defaults, ignore unauthorized cert warnings as default QS certs are self-signed. | |
// Export the certificates from your Qlik Sense installation and refer to them | |
var r = request.defaults({ | |
rejectUnauthorized: false, | |
host: 'localhost', | |
pfx: fs.readFileSync(__dirname + '\\client.pfx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['d3'], function (d3) { | |
const ANIMATION_DURATION = 300; | |
var viz = { | |
x: d3.scale.ordinal(), | |
y: d3.scale.linear(), | |
xAxis: function () { return d3.svg.axis().scale(viz.x).orient('bottom') }, | |
yAxis: function () { return d3.svg.axis().scale(viz.y).orient('left') } | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsocks = require('qsocks'); | |
const fs = require('fs'); | |
const Promise = require('bluebird'); | |
var config = { | |
host: 'localhost', | |
port: 4747, | |
headers: { | |
'X-Qlik-User': 'UserDirectory=INTERNAL;UserId=sa_repository' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qsocks.Connect(config) | |
.then(global => global.getActiveDoc()) // Or open a doc, in this scenario we already had a scoped app. | |
.then(doc => { | |
// bar chart | |
doc.getObject(objectid[0]) | |
.then(model => { | |
var margin = {top: 20, right: 20, bottom: 30, left: 40}, | |
width = 650 - margin.left - margin.right, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
(function foo(node) { | |
if (node && node.$id) { | |
if (node.$$childHead) foo(node.$$childHead); | |
if (node.$$nextSibling) foo(node.$$nextSibling); | |
if (node.model && node.model.layout) node.model.layout.title = node.model.id; | |
} | |
})(qvangularGlobal.$rootScope); | |
$('*').css('-webkit-user-select', 'all'); | |
pubsub.publish('/resize/end') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['qvangular', 'qlik', 'jquery'],function(qvangular, qlik, $) { | |
var SUPPORTED_CHARTS = ['barchart', 'piechart', 'linechart', 'combochart'] | |
return { | |
initialProperties : { | |
version: 1.0, | |
qHyperCubeDef : { | |
qDimensions : [], | |
qMeasures : [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
rejectUnauthorized: false, | |
hostname: <QRS HOST NAME>, | |
port: 4242, | |
path: '/qrs/dataconnection/18a67b3a-2228-4c06-9e38-c9cb9900288c?xrfkey=abcdefghijklmnop', | |
method: 'PUT', | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.createCube({ | |
qDimensions: [{ | |
qDef: { | |
qFieldDefs: ["Sales Rep Name"] | |
}, | |
qShowTotal: false, | |
qOtherTotalSpec: { | |
qOtherMode: 'OTHER_COUNTED', | |
qOtherCounted: { | |
// Sets the number to limit by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qsocks = require('qsocks'); | |
// ConnectOpenApp requires a appname property. | |
// Returns an array of [globalhandle, apphandle] | |
var connection = qsocks.ConnectOpenApp({ | |
host: 'localhost', | |
isSecure: true, | |
rejectUnauthorized: false, | |
appname: '7c876a9a-d62d-49ea-b21c-aaccda76c067', | |
debug: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsocks = require('qsocks'); | |
const fs = require('fs'); | |
// Our Qlik Sense Certificates | |
const client = fs.readFileSync('C:\\ProgramData\\Qlik\\Sense\\Repository\\Exported Certificates\\.Local Certificates\\client.pem'); | |
const client_key = fs.readFileSync('C:\\ProgramData\\Qlik\\Sense\\Repository\\Exported Certificates\\.Local Certificates\\client_key.pem'); | |
const config = { | |
host: 'localhost', | |
port: 4747, // Standard Engine port |