From b4001b1d3dd98af1c2c551f4ef715b9873a73674 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Tue, 20 Feb 2024 21:41:37 -0500 Subject: [PATCH 1/2] expose structure option (via proxy), better descripiton language --- .../tera-stratification-group-form.vue | 22 ++++++++++++++----- .../stratify-mira/stratify-mira-operation.ts | 20 +++++++++++++++-- .../ops/stratify-mira/tera-stratify-mira.vue | 3 ++- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue b/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue index 1a29964962..7ae4cc4b9e 100644 --- a/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue +++ b/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue @@ -2,11 +2,13 @@
- - + +
- +
@@ -64,8 +66,9 @@ const strataName = ref(props.config.name); const selectedVariables = ref(props.config.selectedVariables); const labels = ref(props.config.groupLabels); const cartesianProduct = ref(props.config.cartesianProduct); -const directed = ref(props.config.directed); -const structure = ref(props.config.structure); // currently not used +const directed = ref(props.config.directed); // Currently not used, assume to be true +const structure = ref(props.config.structure); // Proxied by "useStructure" +const useStructure = ref(props.config.useStructure); const updatedConfig = computed(() => ({ borderColour: props.config.borderColour, @@ -74,7 +77,8 @@ const updatedConfig = computed(() => ({ groupLabels: labels.value, cartesianProduct: cartesianProduct.value, directed: directed.value, - structure: structure.value + structure: structure.value, + useStructure: useStructure.value })); watch( @@ -84,6 +88,8 @@ watch( selectedVariables.value = props.config.selectedVariables; labels.value = props.config.groupLabels; cartesianProduct.value = props.config.cartesianProduct; + structure.value = props.config.structure; + useStructure.value = props.config.useStructure; } ); @@ -118,6 +124,10 @@ watch( color: var(--text-color-subdued); } +.multi-line-label { + max-width: 12rem; +} + .input-row { width: 100%; display: flex; diff --git a/packages/client/hmi-client/src/workflow/ops/stratify-mira/stratify-mira-operation.ts b/packages/client/hmi-client/src/workflow/ops/stratify-mira/stratify-mira-operation.ts index cd23917c67..618f442ca6 100644 --- a/packages/client/hmi-client/src/workflow/ops/stratify-mira/stratify-mira-operation.ts +++ b/packages/client/hmi-client/src/workflow/ops/stratify-mira/stratify-mira-operation.ts @@ -9,6 +9,8 @@ export interface StratifyGroup { directed: boolean; structure: null | any[]; + + useStructure: boolean; } export interface StratifyCode { @@ -27,9 +29,23 @@ export const blankStratifyGroup: StratifyGroup = { name: '', selectedVariables: [], groupLabels: '', + + // Allow existing transitions to involve multiple strata cartesianProduct: true, - directed: false, - structure: null + + // Create new transitions between strata, this act as a proxy to MIRA "structure", which is + // null = everything + // [] = nothing + // [[a, b], [c, d]] = somewhere in between + // + // Here we use a simpler proxy useStructure, where + // true => structure = null + // false => structuer = [] + structure: null, + useStructure: true, + + // Always true for now - Feb 2024 + directed: true }; export const StratifyMiraOperation: Operation = { diff --git a/packages/client/hmi-client/src/workflow/ops/stratify-mira/tera-stratify-mira.vue b/packages/client/hmi-client/src/workflow/ops/stratify-mira/tera-stratify-mira.vue index 2c496322dd..b6dc9664de 100644 --- a/packages/client/hmi-client/src/workflow/ops/stratify-mira/tera-stratify-mira.vue +++ b/packages/client/hmi-client/src/workflow/ops/stratify-mira/tera-stratify-mira.vue @@ -207,7 +207,8 @@ const stratifyRequest = () => { key: strataOption.name, strata: strataOption.groupLabels.split(',').map((d) => d.trim()), concepts_to_stratify: strataOption.selectedVariables, - cartesian_control: strataOption.cartesianProduct + cartesian_control: strataOption.cartesianProduct, + structure: strataOption.useStructure === true ? null : [] } }; From e54f1b2b5af993fa1c0ef7498b8b2f761c8b87f6 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Tue, 20 Feb 2024 21:45:06 -0500 Subject: [PATCH 2/2] english --- .../stratification/tera-stratification-group-form.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue b/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue index 7ae4cc4b9e..ff5384f6bc 100644 --- a/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue +++ b/packages/client/hmi-client/src/components/stratification/tera-stratification-group-form.vue @@ -2,12 +2,12 @@
- +
Allow existing interactions to invole multiple stratum