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

sense-search-components

v3.0.5

Published

A collection of HTML/JavaScript components that allow you to leverage the power of the Qlik Sense QIX engine to embed search in to a Web application or use a more natural language to generate charts on the fly.

Downloads

11

Readme

Sense Search Components

A collection of HTML/JavaScript components that allow you to leverage the power of the Qlik Sense QIX engine to embed search in to a Web application or use a more natural language to generate charts on the fly.

The components can be used with the Qlik Sense Capability API, the Engine API (with either Enigma.js or qsocks) or on own their own.

Below is a quick start guide, for more details please see the Wiki. If you think there's anything missing please let me know.

Getting Started

To include the Sense Search Components in your Web application you will need to include references to the JavaScript API and the CSS file for styling. Be sure to add the JavaScript file at the end of the HTML body

<link rel="stylesheet" href="https://rawgit.com/websy85/sense-search-components/master/build/sense-search.min.css"/>
<script type="text/javascript" src="https://rawgit.com/websy85/sense-search-components/master/build/sense-search.min.js"></script>

Once included, a new Global object called 'senseSearch' will be available

Connecting to the Sense Engine

var config = {
      host: "<hostname>",
      port: "<portnumber",
      prefix: "<virtualproxy>",
      isSecure: true|false,
      app: "<appname or guid>"
    };
senseSearch.connect(config, function(){
    
});

Adding the Search Box to your Web page

This is as simple as including the custom tag . Make sure you give the element an Id.

<body style="width: 80%; margin: 20px auto; font-family: arial;">
    <sense-search-input id="myInput"></sense-search-input>
</body>

Adding a Results List to your Web page

  1. Add an HTML container to your page (the API contains an example Results List but you can use any method to render the results i.e. AngularJS, Handlebars etc). Make sure you give the element an Id.
<sense-search-results id="myResults"></sense-search-results>
  1. Define the Result List definition and attach it to the Results List. The information provided here will be used to build a Session Hypercube for getting the desired values from your Sense application.
senseSearch.connect(config, function(){
    var options = {
        "fields":[
          {
            "dimension": "<fieldname>",
            "suppressNull": true|false
          },
          ...
        ],
        "sortOptions": {
          "<fieldname>": {
            "id": "<fieldname>",
            "name": "<displayname>",
            "order": 1(asc)|-1(desc)|0(none),
            "field": "<fieldname>",
            "sortType": "qSortByAscii|qSortByNumeric|..."
          }
        },
        "defaultSort": "<fieldname>"
    }
    senseSearch.results["myResults"].attach(options);
});

Search Behaviour

There are 3 available modes for searching, "associations", "simple" and "visualizations". The default mode is "associations".

Associations

In this mode the Search Box will behave like the Search Box in the Qlik Sense client. The engine will return the valid associations that were found using the specified search terms. This allows you to make selections in the desired fields to display the results that you want.

You can see an 'associations' search example here

Simple

In this mode the Sense Search Components will automatically select the first valid association returned by the engine and display the results for it. When using this mode it's best to create a field specifically for searching and concatinate various fields together.

You can see a 'simple' search example here

Visualizations

In this mode you can use a more natural language structure to generate visualizations on the fly. For example, if you type 'sales by rep for 2016', the QIX engine understands that 'sales' is a measure, 'rep' is a dimension and the value '2016' can be found in the year field. The search result in this instance will be a hypercube and if used with the Capability APIs will render a chart as well. You can read more about this mode in the Wiki.

You can see a 'visualizations' search example here