Select to view content in your preferred language

The object esri/renderers/smartMapping/symbology/color has a method .GetSchemeByName when I look in the api reference you use and params object consisting of four required parameters and to optional one. The name parameter is causing me problems since

669
1
09-27-2019 09:11 AM
RexCammack
New Contributor

here are two examples using the .getSchemeByName 

api reference 

// Returns the Galaxy Berries scheme

var galaxyBerriesScheme = colorSchemes.getSchemeByName({

basemap: map.basemap,

geometryType: featureLayer.geometryType,

theme: "extremes",

name: "Galaxy Berries" });

and from the interactive histogram example

const redAndGreenScheme = colorSymbology.getSchemeByName({
basemap: map.basemap,
geometryType: "polygon",
theme: "above-and-below",
name: "Red and Green 4"
});

the string values for "Galaxy Berries" and "Red and Green 4"  if change will make the method fail so I would like to know the list of acceptable name stings or where to find them in the api.   I was trying to change the interactive Histogram color scheme to be sensitive to color blind people.

Thanks

Rex

 

0 Kudos
1 Reply
KristianEkenes
Esri Regular Contributor

Great question!

In short, we plan on documenting all our available color schemes with their names at 4.14 (December 2019). Once they are documented you won't have a need for the getSchemeByName method (or the scheme name for that matter) because you can just use the provided colors at that point.

The getSchemeByName() method was designed for getting a specific scheme you knew you previously had in a particular smart mapping workflow. In apps where you allow users to author styles for layers, they will select one after the app makes a call to getSchemes(). If you want to remember that scheme, you can store the name of it, the app user and app developer don't really need to know what that name is. But the app will remember it and can pass it to getSchemeByName if you have it preselected for a smart mapping workflow.

For changing the histogram sample, you only really need to change colors. That's where the additional page coming later will help if you want some ideas for colorblind safe colors. If you already have a set of colorblind safe ramps, you can already use those by hard coding the colors in the layer's renderer.

See the modified app here: https://codepen.io/kekenes/pen/jONoNMJ?editors=1000 

Then look at the color stops from lines 201 - 220. That's where you will input the colors. I hope that helps!