Closed M-Wicenec closed 1 week ago
This PR significantly refactors the graph configuration system by removing restrictions on editing existing configs and simplifying the active config management. The changes eliminate the need to save graph configs separately from the graph itself, as configurations are now directly integrated into the logical graph structure.
classDiagram
class GraphConfig {
-id: ko.Observable<GraphConfig.Id>
-name: ko.Observable<string>
-description: ko.Observable<string>
-nodes: ko.ObservableArray<GraphConfigNode>
+clone(): GraphConfig
+setId(id: GraphConfig.Id): void
+getId(): GraphConfig.Id
+setName(name: string): void
+getName(): string
+getNodes(): GraphConfigNode[]
}
class GraphConfigNode {
-id: ko.Observable<NodeId>
-fields: ko.ObservableArray<GraphConfigField>
+clone(): GraphConfigNode
+setId(id: NodeId): GraphConfigNode
+getId(): NodeId
+addField(id: FieldId): GraphConfigField
+findFieldById(id: FieldId): GraphConfigField
+removeFieldById(id: string): GraphConfigNode
+getFields(): GraphConfigField[]
}
class GraphConfigField {
-id: ko.Observable<FieldId>
-value: ko.Observable<string>
-comment: ko.Observable<string>
+clone(): GraphConfigField
+setId(id: FieldId): GraphConfigField
+getId(): string
+setValue(value: string): GraphConfigField
+getValue(): string
+setComment(comment: string): GraphConfigField
+getComment(): string
}
GraphConfig --> GraphConfigNode : contains
GraphConfigNode --> GraphConfigField : contains
classDiagram
class LogicalGraph {
-nodes: ko.ObservableArray<Node>
-edges: ko.ObservableArray<Edge>
-graphConfigs: ko.ObservableArray<GraphConfig>
-activeGraphConfigId: ko.Observable<GraphConfig.Id>
+getGraphConfigs(): GraphConfig[]
+getGraphConfigById(requestedConifgId: GraphConfig.Id): GraphConfig
+addGraphConfig(config: GraphConfig): void
+duplicateGraphConfig(config: GraphConfig): void
+removeGraphConfig(config: GraphConfig): void
+getActiveGraphConfig(): GraphConfig
+setActiveGraphConfig(configId: GraphConfig.Id): void
}
LogicalGraph --> GraphConfig : manages
Change | Details | Files |
---|---|---|
Removed the concept of modified/unmodified graph configurations |
|
src/GraphConfig.ts src/Eagle.ts |
Changed how active graph configuration is managed |
|
src/LogicalGraph.ts src/Eagle.ts |
Simplified the UI for managing graph configurations |
|
templates/graph_configurations_table.html templates/parameter_table.html templates/navbar.html |
Improved change tracking and undo functionality |
|
src/Eagle.ts src/GraphRenderer.ts |
graph configs are much more open to user changes now i have removed the restrictions stopping users from editing existing configs the active graph config is now not a separate entity, we keep an id for the active graph config. editing and adding of configs is all done directly into the logical graph, meaning there is also no longer a need to save graph configs before saving the graph
Summary by Sourcery
Enhance the graph configuration system by allowing direct editing and addition of configurations into the logical graph, eliminating the need for separate saving. Track the active graph configuration using an ID instead of a separate entity.
Enhancements: