Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

interactiveFilters.json

Ganesh Iyer edited this page Aug 30, 2017 · 2 revisions

interactiveFilters.json

Used to define the interactive filters panel that is displayed on the left of the dashboard.

This file describes how the dashboard should look like.

[
    {
        "attributeName": "A",
        "visualization": {
            "visType": "rowChart"
        },
        "statistics": "default"
    },    
    {
        "attributeName": "B",
        "visualization": {
            "visType": "pieChart"
        },
        "statistics": [
            "count", "mean", "custom-myStat"
        ]
    },    
    {
        "attributeName": "C",
        "visualization": {
            "visType": "pieChart"
        },
        "statistics": [
            "min", "max", "mean", "distinct", "median", "stdev", "count"
        ]
    },   
    {
        "attributeName": "D",
        "visualization": {
            "visType": "pieChart"
        },
        "statistics": "default"
    }
        
]


  • attributeName(String): The name of the attribute with which it is refered to. It should be the same as provided in the backend schema.
  • visualization(Object): Used to define information regarding the visualization.
  • visType(String): The type of visualization to be done. Currently supports: barChart, rowChart and pieChart.
  • statistics: The types of statistics to be computed for the attribute which it is refered to.

Notes on visTypes

  • The datatype of the attribute must be enum(in the dataDescription.json) for rowChart and pieChart
  • barChart must have float or integer as their dataType.

Notes on statistics

  • The statistics can be computed on all types of attributes but there are different statistics that make sense for different attributes.

  • By omitting this field, no statistics will be shown for that attribute.

  • statistics having default will automatically calculate all the possible statistics for that attribute

    • number or integer attributes default statistics are: count, distinct, min, max, mean, median, stdev.
    • other attributes types default statistics are: count and distinct.
  • for custom statistics, statistics are accepting an array containing one or more statistics. Thus, the array can contain:

    • one or more of the abovementioned statistics (Ex: "count", "mean", etc)
    • one or more of custom created statistics. For using custom created statistics, the user needs firstly to create them in /modules/customStatistics.js. The name is at the user's choice but they need to be put in the global context. When specifing them within the configuration file, the name needs to have a certain format: "custom-" + the name of the statistic as it was named in customStatistics.js file. Ex: "custom-myStat". Further is an example of implementing a new statistic:
    global.sum = function (data, attr) {
        var sum = 0;
        for (index in data) {
            sum += data[index][attr];
        }
        return sum;
    };
    

Clone this wiki locally