diff --git a/src/mol-plugin/ui/controls/parameters.tsx b/src/mol-plugin/ui/controls/parameters.tsx index 657d2767601f2685228e5499e5f9c1551dfdd5fc..99abe5c7de98766cd34204577a1a9c2367e2d923 100644 --- a/src/mol-plugin/ui/controls/parameters.tsx +++ b/src/mol-plugin/ui/controls/parameters.tsx @@ -344,9 +344,9 @@ export class Vec3Control extends React.PureComponent<ParamProps<PD.Vec3>, { isEx state = { isExpanded: false } components = { - 0: PD.Numeric(0, void 0, { label: 'X' }), - 1: PD.Numeric(0, void 0, { label: 'Y' }), - 2: PD.Numeric(0, void 0, { label: 'Z' }) + 0: PD.Numeric(0, void 0, { label: (this.props.param.fieldLabels && this.props.param.fieldLabels.x) || 'X' }), + 1: PD.Numeric(0, void 0, { label: (this.props.param.fieldLabels && this.props.param.fieldLabels.y) || 'Y' }), + 2: PD.Numeric(0, void 0, { label: (this.props.param.fieldLabels && this.props.param.fieldLabels.z) || 'Z' }) } change(value: PD.MultiSelect<any>['defaultValue']) { diff --git a/src/mol-util/param-definition.ts b/src/mol-util/param-definition.ts index 4fb2e52bfd49a283ab63ca5cc73574f6cb9ea956..46d8abbfeb457cfbb5ae83f320374cb77cd266e2 100644 --- a/src/mol-util/param-definition.ts +++ b/src/mol-util/param-definition.ts @@ -14,13 +14,15 @@ export namespace ParamDefinition { export interface Info { label?: string, description?: string, + fieldLabels?: { [name: string]: string }, isHidden?: boolean, } function setInfo<T extends Info>(param: T, info?: Info): T { if (!info) return param; - if (info.description) param.description = info.description; if (info.label) param.label = info.label; + if (info.description) param.description = info.description; + if (info.fieldLabels) param.fieldLabels = info.fieldLabels; if (info.isHidden) param.isHidden = info.isHidden; return param; }