UI: added default value to colorSettings type and default case for colorProcessor

This commit is contained in:
Dmitriymush 2023-11-09 15:14:35 +02:00
parent c021c64eab
commit 0a9c769afe
2 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,7 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit
ngOnInit(): void { ngOnInit(): void {
this.colorSettingsFormGroup = this.fb.group( this.colorSettingsFormGroup = this.fb.group(
{ {
type: [this.colorSettings?.type, []], type: [this.colorSettings?.type || ColorType.constant, []],
color: [this.colorSettings?.color, []], color: [this.colorSettings?.color, []],
rangeList: [this.colorSettings?.rangeList, []], rangeList: [this.colorSettings?.rangeList, []],
colorFunction: [this.colorSettings?.colorFunction, []] colorFunction: [this.colorSettings?.colorFunction, []]

View File

@ -161,6 +161,8 @@ export abstract class ColorProcessor {
return new RangeColorProcessor(settings); return new RangeColorProcessor(settings);
case ColorType.function: case ColorType.function:
return new FunctionColorProcessor(settings); return new FunctionColorProcessor(settings);
default:
return new ConstantColorProcessor(settings);
} }
} }