Open ghost opened 6 years ago
That's a general javascript question, but here's one way we are extending mapd crossfilter with custom methods in Immerse:
function getTopN(column) {
const group = this.dimension(column)
.order("val")
.group()
.reduceCount(column)
return group
.topAsync(NUM_DEFAULT_CATEGORIES, 0, null, true)
.then(results => results.map(result => result.key0))
}
export function extendCrossfilter(crossfilter) {
crossfilter.getTopN = getTopN.bind(crossfilter)
return crossfilter
}
Actually the issue is I want group by.... with having clause for ILIKE on array Column, So I need to have facility to create group by.. having queries through crossfilter.
@uyanga-gb I have a requirement to override writeQuery method in the mapd crossfilter libray. Can you suggest a way in which I can override the writeQuery method in the crossfilter js using custom function by inheriting in new object without making changes in this mapd-crossfilter.js