AnsweredAssumed Answered

JSAPI 4.2 How exactly to set up visualVariables to generate univariate continuous size and color visualization in 3D

Question asked by davidchrest on Jan 26, 2017
Latest reply on Jan 27, 2017 by davidchrest

So I love this great sample with the slider: Generate univariate continuous size and color visualization in 3D | ArcGIS API for JavaScript 4.2  and I want to do something just like this but instead using a simple schools wpoint FeatureLayer with number of students instead of cities with population like the sample shows.

So I add in my code essentially based just like the sample code but just switching out for my schools FeatureLayer. I then get this error: there was an error:  d {name: "size-visual-variable:insufficient-info", message: "Unable to find size scheme", details: undefined}.

 

Turns out I need to set up my visualVariables (and statistics too) inside the colorAndSizeRendererCreator.createContinuousRenderer(params):

 var sizeVV = response.size.visualVariable;
var colorVV = response.color.visualVariable;

sliderParams.statistics = response.statistics;
sliderParams.visualVariables = [sizeVV, colorVV];

Turns out the FetureLayer in the sample has this all set up with "Drawing Info" in the FeatureLayer's service:

https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Enriched%20World%20Cities/FeatureServer/0 .

 So how do I set up these important statistics and visualVariables for my schools FeatureLayer by JS code. The snippets below the map in this sample page (Generate univariate continuous size and color visualization in 3D | ArcGIS API for JavaScript 4.2 ) are quite confusing.

 

Is this refereing to the assigned renderer in my renderer: property in my FeatureLayer?

// set the renderer to the layer povLyr.renderer = response.renderer;

 

Ande where exacttly atre these sizeVV and colorVV coming from? They are not set up in my rendere.

visualVariables: [ sizeVV, colorVV ]?

// size/color visual variables returned from createContinuousRenderer(),

 

There must be a straightforward code example to set up a common slider scenario with size, color, field max/min values, etc.  The set-up for the Thematic multivariate 3D visualization shows very well the symbolization syntax (Thematic multivariate visualization (3D) | ArcGIS API for JavaScript 4.2 ) for this slide example I'm pretty lost.

Any help is very much appreciated.

Much Thanks,

David

Outcomes