npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

halyard.js

v1.3.2

Published

Data import library for Qlik Analytics Platform

Downloads

62

Readme

CircleCI Dependabot Status Coverage Status

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

addHyperCube(hyperCube)

Adds a hyper cube to the data model representation. More info about Halyard.HyperCube.

The addHyperCube method accepts an explicit hyper cube definition:

let hyperCube = new Halyard.HyperCube(qHyperCube);
halyard.addHyperCube(hyperCube);

Example qHyperCube

addHyperCube returns a Halyard.HyperCube instance

addHyperCube(hyperCubeLayout[, hyperCubeOptions])

You can also add a hyper cube by providing the hyper cube definition:

halyard.addHyperCube(qHyperCube, 'HyperCubeName');

addHyperCube returns a Halyard.HyperCube instance An example of a how to use this method hyper-cube.js in examples

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.

setScriptAndReloadWithHalyard(app, halyard, doSaveAfterReload)

Sets data from the halyard instance to the app instance. If doSaveAfterReload is set to true, the app is saved after the data has been set. This method will return 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.