bi-dataset
v2.2.0
Published
A dataset core for BI app
Downloads
7
Readme
BI-Dataset
A data set tool for building BI visulization app.
API
filterData
filterData is used to filter the data with several conditions.
- params:
let rawData = [{value: 12, name: 'Alice'}, {value: 98, name: 'Bob'}, {value: 32, name: 'Carl'}]
let filters = [
{
column: 'value',
type: 'equal',
value: [40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]
},
{
column: 'value',
type: 'range',
value: [10, 98]
}
]
let viewData = filterData({filters: state.filters, rawData: state.globalData})
dimensionValueSet
dimensionValueSet is used to get all the possible value of given dimension or measure.
transLabel
turn the labels in xAxis and yAxis into dimension labels and measure labels.
- params:
- Return
- [Object]: {dimensions, measures}
- dimensions and measures are arrays contains the name of each column.
let xLabels = [{type: 'string', name: 'city'}, {type: 'number', name: 'value'}]
let yLabels = []
let {dimensions, measures} = transLabel({xLabels, yLabels})
transDimension
check all the possible values in each dimension.
- Params
- Return
- [Object]: {mixDim, lowerMixDim}
mixDim = [
['name', 'city'],
]