Commit 228308de authored by Feng Xue's avatar Feng Xue

Change the input of the plugin to:

NSDchart(data, properties)
data = {
    rowVariables: [
    {
            "id": "demo!gor_V19",
            "isMeasureVariable": true,
            "name": "Time",
            "label": "Departure time - hours",
            "categories": [
                {
                    "label": "Min",
                    "value": "MIN"
                },
                {
                    "label": "Q1",
                    "value": "Q1"
                },
                {
                    "label": "Median",
                    "value": "MEDIAN"
                },
                {
                    "label": "Q3",
                    "value": "Q3"
                },
                {
                    "label": "Q3",
                    "value": "Q3"
                },
                {
                    "label": "Max",
                    "value": "MAX"
                }
            ]
        }
    ],
    columnVariables: [
    {
                "id": "demo!gor_V17",
                "name": "Travel1",
                "label": "Main mode of travel",
                "categories": [
                    {
                        "label": "Car",
                        "value": "1",
                }
            ]
        }
    ],
    columnVariables: [
    {
                "id": "demo!gor_V17",
                "name": "Travel1",
                "label": "Main mode of travel",
                "categories": [
                    {
                        "label": "Car",
                        "value": "1",
                        "frequency": "134"
                    },
                    {
                        "label": "Train",
                        "value": "2",
                        "frequency": "100"
                    },
                    {
                        "label": "Bus",
                        "value": "3",
                        "frequency": "90"
                    },
                    {
                        "label": "Cycle",
                        "value": "4",
                    {
                        "label": "Train",
                        "value": "2",
                        "frequency": "100"
                    },
                    {
                        "label": "Bus",
                        "value": "3",
                        "frequency": "90"
                    },
                    {
                        "label": "Cycle",
                        "value": "4",
                        "frequency": "83"
                    },
                    {
                        "label": "Walk",
                        "value": "5",
                        "frequency": "93"
                    }
                ]
            }
    ],
    data: [1, 2, 3, 4,...],
}
propertise = {
    i18n: {
        percent: "String",
                    {
                        "label": "Walk",
                        "value": "5",
                        "frequency": "93"
                    }
                ]
            }
    ],
    data: [1, 2, 3, 4,...],
}
propertise = {
    i18n: {
        percent: "String",
        value: "String"
    },
    orientation: "String",
    percentages: boolean,
    stacked: boolean,
    type: "string"
}

The input will not contain missing and blacklist categories.

Change the codes pattern from object-oriented to functional
Make the codes fit to the jslint
Change tag to 0.5.0
parent 5c3eeca7
{
"name": "nsdcharts",
"version": "0.4.18",
"version": "0.5.0",
"main": "src/nsdcharts.js",
"ignore": [
"**/.*",
......
{
"name": "nsdcharts",
"version": "0.4.18",
"version": "0.5.0",
"devDependencies": {
"grunt-bower-task": "latest",
"grunt": "latest",
......
var measureAndBreakTestdata = {
"payload": {
"measureVariable": {
"columnVariables": [{
"id": "demo!gor_V19",
"isMeasureVariable": true,
"name": "Time",
"label": "Departure time - hours",
"categories": [],
"statistics": {
"MAX": 22,
"MEAN": 12.128,
"Q1": 8.13636363636364,
"Q3": 15.4272727272727,
"MIN": 5,
"MEDIAN": 10.9642857142857
}
},
"breakVariables": [
{
"id": "demo!gor_V17",
"name": "Travel1",
"label": "Main mode of travel",
"categories": [
{
"label": "Car",
"value": "1",
"frequency": "134"
},
{
"label": "Train",
"value": "2",
"frequency": "100"
},
{
"label": "Bus",
"value": "3",
"frequency": "90"
},
{
"label": "Cycle",
"value": "4",
"frequency": "83"
},
{
"label": "Walk",
"value": "5",
"frequency": "93"
}
]
}
"categories": [
{
"label": "Min",
"value": "MIN"
},
{
"label": "Q1",
"value": "Q1"
},
{
"label": "Median",
"value": "MEDIAN"
},
{
"label": "Q3",
"value": "Q3"
},
{
"label": "Max",
"value": "MAX"
}
]
}],
"rowVariables": [
{
"id": "demo!gor_V17",
"name": "Travel1",
"label": "Main mode of travel",
"categories": [
{
"label": "Car",
"value": "1",
"frequency": "134"
},
{
"label": "Train",
"value": "2",
"frequency": "100"
},
{
"label": "Bus",
"value": "3",
"frequency": "90"
},
{
"label": "Cycle",
"value": "4",
"frequency": "83"
},
{
"label": "Walk",
"value": "5",
"frequency": "93"
}
]
}
],
"measureTypes": [
"MAX",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment