Skip to content

Instantly share code, notes, and snippets.

@crissdev
Forked from xhinking/print_filter.js
Created April 25, 2020 16:57
Show Gist options
  • Save crissdev/1c5597841110989b178cfed0931774de to your computer and use it in GitHub Desktop.
Save crissdev/1c5597841110989b178cfed0931774de to your computer and use it in GitHub Desktop.
Crossfilter & dc filter printer source: codeproject
function print_filter(filter) {
var f=eval(filter);
if (typeof(f.length) != "undefined") {}else{}
if (typeof(f.top) != "undefined") {f=f.top(Infinity);}else{}
if (typeof(f.dimension) != "undefined") {f=f.dimension(function(d) { return "";}).top(Infinity);}else{}
console.log(filter+"("+f.length+") = "+JSON.stringify(f).replace("[","[\n\t").replace(/}\,/g,"},\n\t").replace("]","\n]"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment