Skip to content

Maintenance data refactor#443

Open
jmdowrick wants to merge 65 commits into
physiomelinks:mainfrom
jmdowrick:maintenance-data-refactor
Open

Maintenance data refactor#443
jmdowrick wants to merge 65 commits into
physiomelinks:mainfrom
jmdowrick:maintenance-data-refactor

Conversation

@jmdowrick

Copy link
Copy Markdown
Collaborator

Updated data structures to have the following structures:

module: {
moduleRef: ${module_type}:${module_subtype},
mathRef: ${component_file}:${component_name},
variables: [defined below],
ports: [defined below],
}

instance.data: {
name: '',
moduleRef: ${module_type}:${module_subtype},
mathRef: ${component_file}:${component_name},
variables: [defined below],
ports: [defined below],
handles: [defined below],
}

variables: {
name: '',
value: '',
units: '',
access: String with value 'access' or 'no_access',
type: String with value 'constant', 'global_constant', 'boundary_condition', or 'variable',
data_reference: '',
}

ports: {
portType: String with value 'general_port', 'entrance_port', or 'exit_port',
label: String of name,
variables: [list of variable names associated with the port], // note: different from variables above
multiportType: String with value 'None', 'Sum', or 'Multiply'
}

handles: {
uid: crypto.randomUUID(),
type: 'source' or 'target',
side: 'left', 'right', 'top', 'bottom'
name: string of instance name -> should probably be updated to be associated with an immutable node id
}

There should now be functions to build each of these data structures.

As you can see, constant parameters are now associated with the instance. Global constants remain in the library store. Also introduces a library proxy store that dictates the library area to support dynamic organisation.

The library is now broken into several maps:
availableCollections -> use mathRef to get a set of moduleRefs using the same math
availableModules -> use moduleRef as key to get the module with structure above
availableMath -> use mathRef as key to get raw xml string of model with a single component
availableUnits (not a map) -> array of units
globalConstants -> use variable name to get { value, units, data_reference }

This PR should fix the following issues:
Resolves #429
Resolves #413
Resolves #405
Resolves #290
Resolves #246
Resolves #248

Also works towars #380, but need ability to edit data reference in the parameter window before I feel comfortable to mark this resolved.

Remaining functionalities to restore:

  • MacroBuilder - partially restored, but hit a wall with ghost nodes
  • Build affine component generates warnings (pretty sure it's not implemented properly)
  • EdgeConnectionDialog - autoscrolling up introduces offset between the mouse and the end of the connection proportional to the amount of autoscrolling (should be a simple fix, but I was unsure which measure to use to correct the offset) - related to issue Autoscroll up doesn't work in the edge connection dialog #417

jmdowrick added 30 commits June 17, 2026 10:19
Also flatten node data structure to enable cleaner use of updateNodeData helper function from useVueFlow composable
@jmdowrick
jmdowrick requested a review from hsorby July 15, 2026 23:54

@hsorby hsorby left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really nice.

I have made a few comments.
Some a trivial, some are personal preference, and some are queries.
It would be good to answer the queries and make sure we are on the same page.

Other than that it is looking pretty awesome and much more logical.

Comment thread src/components/CellMLEditorDialog.vue Outdated
Comment thread src/components/CellMLEditorDialog.vue Outdated
Comment thread src/components/CellMLEditorDialog.vue
Comment thread src/components/CellMLTextEditor.vue Outdated
Comment thread src/components/InstanceNode.vue Outdated
Comment thread src/utils/ports.js Outdated
Comment thread src/views/WorkspaceArea.vue Outdated
Comment thread src/views/WorkspaceArea.vue Outdated
Comment thread src/components/ModuleReplacementDialog.vue Outdated
Comment thread src/components/ImportDialog.vue Outdated
@jmdowrick
jmdowrick requested a review from hsorby July 16, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants