Mercurial > hg > dml-open-vis
diff src/DML/MainVisBundle/Resources/assets/lib/vega/vega.expr.centroid.js @ 0:493bcb69166c
added public content
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 20:54:02 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/DML/MainVisBundle/Resources/assets/lib/vega/vega.expr.centroid.js Tue Feb 09 20:54:02 2016 +0100 @@ -0,0 +1,12 @@ +/** + * centroid function in vega expression + */ +if (vg && false) { // see https://github.com/vega/vega/issues/385 + + vg.parse.expr.codegen.functions["myFunction"] = function(args) { + var a = args.map(vg.parse.expr.codegen); + return 'window.myFunction('+a[0]+')'; + } +} else { + //console.error("Can't register centroid function in vega expression"); +}