diff --git a/projects/nshmp-apps/src/app/source/mfd/services/app.service.ts b/projects/nshmp-apps/src/app/source/mfd/services/app.service.ts index a7dc09077edf806a202b4fa1f87775f83a23a861..5dea22443c336414a538ad514519d4daf84c1caf 100644 --- a/projects/nshmp-apps/src/app/source/mfd/services/app.service.ts +++ b/projects/nshmp-apps/src/app/source/mfd/services/app.service.ts @@ -75,6 +75,8 @@ export interface MfdQuery { sourceTree: string; /** Source type */ sourceType: SourceType; + /** Whether to apply weight */ + weightedMfds: string; } /** @@ -256,6 +258,7 @@ export class AppService source, sourceAsString: JSON.stringify(source), sourceTree: null, + weightedMfds: false, }; } @@ -594,12 +597,13 @@ export class AppService : null; const formValues: ControlForm = { - cumulative: queryParams.cumulative === 'true', + cumulative: queryParams?.cumulative === 'true', mfdType: defaultValues.mfdType, model, source, sourceAsString: JSON.stringify(source), sourceTree, + weightedMfds: queryParams?.weightedMfds === 'true', }; this.formGroup.patchValue(formValues); @@ -821,7 +825,9 @@ export class AppService let plotData: Partial<PlotData> = { name: name.length > 50 ? `${name.substring(0, 50)} ...` : name, x: xySequence.xs, - y: xySequence.ys.map(y => y * branch.weight * mfdInfo.weight), + y: form.weightedMfds + ? xySequence.ys.map(y => y * branch.weight * mfdInfo.weight) + : xySequence.ys, }; if (mfdInfo.mfd.props.type === MfdType.SINGLE) { @@ -894,6 +900,7 @@ export class AppService setting: source.tectonicSettings ?? null, sourceTree: values.sourceTree?.toString() ?? null, sourceType: source.sourceType ?? null, + weightedMfds: values.weightedMfds.toString(), }; this.router