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

Function copyPrefToNewState

packages/sanddance-explorer/src/partialInsight.ts:59–64  ·  view source on GitHub ↗
(prefs: Prefs, chart: SandDance.specs.Chart, role: string, columnName: string)

Source from the content-addressed store, hash-verified

57}
58
59export function copyPrefToNewState(prefs: Prefs, chart: SandDance.specs.Chart, role: string, columnName: string) {
60 const specTypePrefs = SandDance.VegaDeckGl.util.deepMerge({}, prefs['*'], prefs[chart]);
61 const rolePrefs = SandDance.VegaDeckGl.util.deepMerge({}, specTypePrefs['*'], specTypePrefs[role]);
62 const partialInsight = SandDance.VegaDeckGl.util.deepMerge({}, rolePrefs['*'], rolePrefs[columnName]);
63 return partialInsight;
64}
65
66export function savePref(prefs: Prefs, chart: SandDance.specs.Chart, role: string, column: string, partialInsight: Partial<SandDance.specs.Insight>) {
67 const SpecTypePrefs = prefs[chart] || {};

Callers 2

changeChartTypeMethod · 0.90
changeColumnMappingMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected