(oldInsight: Insight, newInsight: Insight)
| 33 | } |
| 34 | |
| 35 | function 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 | |
| 55 | function differentObjectValues(a: { [key: string]: any }, b: { [key: string]: any }) { |
| 56 | if (!a && !b) return false; |
no test coverage detected