From 4345722fe01dea0192ba4daccffd1a517773501f Mon Sep 17 00:00:00 2001 From: David Tsay Date: Wed, 26 Feb 2025 18:09:33 -0800 Subject: [PATCH] WIP: use flex layout container sizing for timeline --- src/plugins/timeline/Container.js | 17 ++++ src/plugins/timeline/TimelineObjectView.vue | 11 ++- src/plugins/timeline/TimelineViewLayout.vue | 48 +++++++++- src/plugins/timeline/timeline.scss | 60 ++++++------- src/utils/vue/useFlexContainers.js | 97 +++++++++++++++++++++ 5 files changed, 199 insertions(+), 34 deletions(-) create mode 100644 src/plugins/timeline/Container.js create mode 100644 src/utils/vue/useFlexContainers.js diff --git a/src/plugins/timeline/Container.js b/src/plugins/timeline/Container.js new file mode 100644 index 0000000000..3f729d56da --- /dev/null +++ b/src/plugins/timeline/Container.js @@ -0,0 +1,17 @@ +class Container { + constructor(domainObject, size) { + this.domainObjectIdentifier = domainObject.identifier; + this.size = size; + this.scale = getContainerScale(domainObject); + } +} + +function getContainerScale(domainObject) { + if (domainObject.type === 'telemetry.plot.stacked') { + return domainObject?.composition?.length; + } + + return 1; +} + +export default Container; diff --git a/src/plugins/timeline/TimelineObjectView.vue b/src/plugins/timeline/TimelineObjectView.vue index 60d609de00..c571e95396 100644 --- a/src/plugins/timeline/TimelineObjectView.vue +++ b/src/plugins/timeline/TimelineObjectView.vue @@ -24,7 +24,6 @@