diff --git a/lib/carto/torque-reference.js b/lib/carto/torque-reference.js index f30e0ce..0b9f204 100644 --- a/lib/carto/torque-reference.js +++ b/lib/carto/torque-reference.js @@ -167,6 +167,15 @@ var _mapnik_reference_latest = { ["colorize-alpha", -1], ["color-to-alpha", 1], ["scale-hsla", 8], + ["buckets", -1], + ["category", -1], + ["equal", -1], + ["headtails", -1], + ["jenks", -1], + ["quantiles", -1], + ["cartocolor", -1], + ["colorbrewer", -1], + ["range", -1], ["ramp", -1] ], "doc": "A list of image filters." diff --git a/test/rendering_js.test.js b/test/rendering_js.test.js index e91e87a..6d3ae42 100644 --- a/test/rendering_js.test.js +++ b/test/rendering_js.test.js @@ -166,4 +166,21 @@ describe('RenderingJS', function() { assert.equal(st.args[2].value, 'jenks'); }) + it.only("should parse turbocarto with inner functions", function(){ + var css = [ + '#layer {', + ' marker-width: ramp([cartodb_id], cartocolor(Bold), category(10));', + '}' + ].join('\n'); + var shader = (new carto.RendererJS({ debug: true })).render(css); + var layer = shader.getLayers()[0]; + var st = layer.shader['marker-width'].style({}, {zoom: 1}); + assert.equal(st.name, "ramp"); + assert.equal(st.args.length, 3); + assert.equal(st.args[1].name, 'cartocolor'); + assert.equal(st.args[1].args[0].value, 'Bold'); + assert.equal(st.args[2].name, 'category'); + assert.equal(st.args[2].args[0].value, 10); + }); + });