AnsweredAssumed Answered

How to use smart mapping classBreaks in JS API 4.5?

Question asked by FrizzelleCPC on Dec 11, 2017

Can somebody help me understand how to use the classBreaks function under esri/renderers/smartMapping/statistics in JS API 4.5? The documentation gives an example but I cannot figure out how to feed the results into the classBreaksRenderer.


I've pasted my JS code below that contains a modification of the code example plus my attempt to feed the output from classBreaks into a renderer. I know it's wrong but I'm not clear how to fix it. Any help would be appreciated.


], function(dom, number, on, Map, MapView, FeatureLayer, classBreaks) {
    // Create the Map element
    var map = new Map({
        basemap: 'oceans'

    var viewProperties = {
        center: [-77.3936, 35.1377],
        zoom: 8

    // Create the MapView element that will hold the map
    var view = new MapView({
        container: "viewDiv",
        map: map
    }); =;
    view.zoom = viewProperties.zoom;

    var renderer = {
        type: 'class-breaks',
        field: 'Alligator'


    function genClassBreaks () {
            layer: featureLayer,
            field: "Alligator",
            classificationMethod: "quantile",
            numClasses: 4
            var breakInfos = response.classBreakInfos;

    var featureLayer = new FeatureLayer({
        url: "",
        renderer: renderer,
        outFields: ["*"],
        definitionExpression: "Alligator > 0"

    // Add featureLayer to the map