MCPcopy Index your code
hub / github.com/microsoft/SandDance / getCharacterSet

Method getCharacterSet

docs/app/js/sanddance-app.js:11033–11056  ·  view source on GitHub ↗
(stage)

Source from the content-addressed store, hash-verified

11031 if (forceNewCharacterSet || needsNewCharacterSet(oldInsight, newInsight)) this.chars = undefined;
11032 }
11033 getCharacterSet(stage) {
11034 if (!this.chars) {
11035 const map = {};
11036 const addText = (text)=>{
11037 Array.from(text).forEach((char)=>{
11038 map[char] = true;
11039 });
11040 };
11041 stage.textData.forEach((t)=>addText(t.text));
11042 const { x , y , z } = stage.axes;
11043 [
11044 x,
11045 y,
11046 z
11047 ].forEach((axes)=>{
11048 axes.forEach((axis)=>{
11049 if (axis.tickText) axis.tickText.forEach((t)=>addText(t.text));
11050 if (axis.title) addText(axis.title.text);
11051 });
11052 });
11053 this.chars = Object.keys(map);
11054 }
11055 return this.chars;
11056 }
11057}
11058function needsNewCharacterSet(oldInsight, newInsight) {
11059 if (!oldInsight) return true;

Callers 2

getLayersFunction · 0.45
createConfigMethod · 0.45

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected