Mercurial > hg > dml-open-vis
annotate src/DML/MainVisBundle/Resources/assets/lib/vega/vega.expr.centroid.js @ 1:f38015048f48 tip
Added GPL
author | Daniel Wolff |
---|---|
date | Sat, 13 Feb 2016 20:43:38 +0100 |
parents | 493bcb69166c |
children |
rev | line source |
---|---|
Daniel@0 | 1 /** |
Daniel@0 | 2 * centroid function in vega expression |
Daniel@0 | 3 */ |
Daniel@0 | 4 if (vg && false) { // see https://github.com/vega/vega/issues/385 |
Daniel@0 | 5 |
Daniel@0 | 6 vg.parse.expr.codegen.functions["myFunction"] = function(args) { |
Daniel@0 | 7 var a = args.map(vg.parse.expr.codegen); |
Daniel@0 | 8 return 'window.myFunction('+a[0]+')'; |
Daniel@0 | 9 } |
Daniel@0 | 10 } else { |
Daniel@0 | 11 //console.error("Can't register centroid function in vega expression"); |
Daniel@0 | 12 } |