GithubHelp home page GithubHelp logo

halyard.js's Introduction

halyard.js is a JavaScript library that simplifies the Qlik Sense data load experience as it abstracts away the need to write a load script.

The functionality in halyard.js is divided into two parts where the first one is halyard.js itself. It generates the load script, as well as the connections needed. The second part is halyard-enigma-mixin.js that extends the functionality of enigma.js to bring your halyard representation into the QIX engine.

halyard.js - API Basics

let halyard = new Halyard();

setDefaultSetStatements(defaultSetStatements[, preservePreviouslyEnteredValues])

Adds custom set statements to the beginning of the script. Typically used to configure time/data/currency settings.

defaultSetStatements is an object where the key becomes the variable name in the set statement, and the value becomes the variable value.

halyard.setDefaultSetStatements({DateFormat: 'MM-DD-YYYY'});
// getScript() will return SET DateFormat='MM-DD-YYYY';

Any entered default set statement will be replaced by default if this method is called a second time with defaultSetStatement containing already defined keys. If preservePreviouslyEnteredValues is set to true, then previously entered set statements will be preserved even if the setDefaultSetStatements method is called multiple times.

addTable(table)

Adds a table to the data model representation. More info about Halyard.Table.

The addTable method accepts an explicit table definition:

let table = new Halyard.Table('c:\\data\\file.csv');
halyard.addTable(table);

addTable returns a Halyard.Table instance

addTable(connection[, tableOptions])

You can also add a table by providing the table definition:

halyard.addTable('c:\\data\\file.csv', 'TableName');

addTable returns a Halyard.Table instance

addItem(item)

Adds any object that responds to getScript(). An example of a how to use this method to extend with custom functionality extending-functionality.js in examples

getScript()

Retrieves the script representation of the items added to halyard.js. The script returned can be set to QIX Engine using the setScript(script) method.

halyard.getScript();

getQixConnections()

Returns an array of QIX connections that needs to be created before the doReload() method is called. To create connections, use the createConnection(connection) method.

halyard.getQixConnections();

getItemThatGeneratedScriptAt(charPosition)

Returns the item that generated the script block at the specified character position from the getScript() call. The main usage for this method is to identify what item that causes a reload failure.

const syntaxErrorAtCharacterPosition = 32;

halyard.getItemThatGeneratedScriptAt(syntaxErrorAtCharacterPosition);

halyard-enigma-mixin.js

createSessionAppUsingHalyard(halyard)

Creates a session app according to the specification setup in the Halyard instance provided. This method will return the session app.

createAppUsingHalyard(appName, halyard)

Creates an app with the specified appName and Halyard instance. This method will return the an app object.

reloadAppUsingHalyard(existingAppName, halyard[, createIfMissing])

Updates an existing app named existingAppName with new data from the Halyard instance. If createIfMissing is set to true, an app is created if it does not already exist.

Note that this method replaces any script that already exist in the app.

Extending with new functionality

See extending-functionality.js in examples for more info about how to extend with new functionality.

Contributing

Please follow the instructions in CONTRIBUTING.md.

Examples

More examples can be found in examples or in the examples/ folder

halyard.js's People

Contributors

carlioth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.