(stage)
| 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 | } |
| 11058 | function needsNewCharacterSet(oldInsight, newInsight) { |
| 11059 | if (!oldInsight) return true; |
no test coverage detected