MCPcopy Create free account
hub / github.com/microsoft/SandDance / needsNewCharacterSet

Function needsNewCharacterSet

packages/sanddance/src/characterSet.ts:35–53  ·  view source on GitHub ↗
(oldInsight: Insight, newInsight: Insight)

Source from the content-addressed store, hash-verified

33}
34
35function needsNewCharacterSet(oldInsight: Insight, newInsight: Insight) {
36 if (!oldInsight) return true;
37 if (!newInsight) return true;
38 if (oldInsight.chart !== newInsight.chart) return true;
39 if (oldInsight.facetStyle !== newInsight.facetStyle) return true;
40 if (oldInsight.totalStyle !== newInsight.totalStyle) return true;
41 if (oldInsight.hideAxes !== newInsight.hideAxes) return true;
42 if (oldInsight.view !== newInsight.view) return true;
43 if (differentObjectValues(oldInsight.signalValues, newInsight.signalValues)) return true;
44 if (differentObjectValues(oldInsight.size, newInsight.size)) return true;
45 const oldColumns = oldInsight.columns;
46 const newColumns = newInsight.columns;
47 if (oldColumns.facet !== newColumns.facet) return true;
48 if (oldColumns.facetV !== newColumns.facetV) return true;
49 if (oldColumns.x !== newColumns.x) return true;
50 if (oldColumns.y !== newColumns.y) return true;
51 if (oldColumns.z !== newColumns.z) return true;
52 return false;
53}
54
55function differentObjectValues(a: { [key: string]: any }, b: { [key: string]: any }) {
56 if (!a && !b) return false;

Callers 1

resetCharacterSetMethod · 0.70

Calls 1

differentObjectValuesFunction · 0.70

Tested by

no test coverage detected