Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/components/trait/forms/BaseTraitForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ export default class BaseTraitForm extends Vue {
}

this.trait.scale.dataType = value;
this.trait!.scale!.units = value;

} else if (Scale.dataTypeEquals(value, DataType.Ordinal) && Scale.dataTypeEquals(this.lastCategoryType, DataType.Nominal)) {
//Nominal to Ordinal
Expand All @@ -512,28 +511,17 @@ export default class BaseTraitForm extends Vue {
this.restoreMinCategories(2);
}
this.trait.scale.dataType = value;
this.trait!.scale!.units = value;

//Scale history
} else if (this.scaleHistory[value.toLowerCase()]) {
this.trait.scale = this.scaleHistory[value.toLowerCase()];
this.trait.scale.dataType = value;

if (!Scale.dataTypeEquals(value, DataType.Numerical)) {
this.trait!.scale!.units = value;
}
} else {
// No history
this.trait.scale = new Scale();
this.trait.scale.dataType = value;

// Allow for units in the numerical and duration traits
if (Scale.dataTypeEquals(value, DataType.Numerical)) {
this.trait!.scale!.units = undefined;
} else {
this.trait!.scale!.units = value;
}

//Establish minimal categories for ordinal and nominal
if (Scale.dataTypeEquals(value, DataType.Nominal) || Scale.dataTypeEquals(value, DataType.Ordinal)) {
this.trait.scale.categories = this.prepopulateCategories();
Expand Down