From 8f6d2a3b782b8193a519f9c0b37ad1545b302ae0 Mon Sep 17 00:00:00 2001 From: Matt Seddon <37993418+mattseddon@users.noreply.github.com> Date: Tue, 19 Sep 2023 08:37:38 +1000 Subject: [PATCH] Remove mutli source encoding cache (#4678) --- extension/src/plots/model/index.ts | 2 +- extension/src/plots/multiSource/collect.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/src/plots/model/index.ts b/extension/src/plots/model/index.ts index 82d21eac81..9139820ad6 100644 --- a/extension/src/plots/model/index.ts +++ b/extension/src/plots/model/index.ts @@ -415,7 +415,7 @@ export class PlotsModel extends ModelWithPersistence { await Promise.all([ collectData(output), collectTemplates(output), - collectMultiSourceVariations(output, this.multiSourceVariations) + collectMultiSourceVariations(output) ]) this.comparisonData = { diff --git a/extension/src/plots/multiSource/collect.ts b/extension/src/plots/multiSource/collect.ts index 76bcd9db8b..9d27a75203 100644 --- a/extension/src/plots/multiSource/collect.ts +++ b/extension/src/plots/multiSource/collect.ts @@ -85,10 +85,8 @@ const collectPathMultiSourceVariations = ( } } -export const collectMultiSourceVariations = ( - output: PlotsOutput, - acc: Record[]> -) => { +export const collectMultiSourceVariations = (output: PlotsOutput) => { + const acc: Record[]> = {} const { data } = output for (const [path, plots] of Object.entries(data)) { collectPathMultiSourceVariations(acc, path, plots) @@ -275,6 +273,8 @@ const collectUnmergedShapeEncoding = ( } } +// this is how we can collect the encoding for multi-source plots +// we need to pass in the anchors that we want to fill as well const collectPathMultiSourceEncoding = ( acc: MultiSourceEncoding, path: string,