Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Time Strip] allow user to adjust width and height of swimlanes #8003

Open
wants to merge 19 commits into
base: 7936-add-discrete-event-visualization
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 0 additions & 2 deletions src/plugins/events/components/events-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
&__container {
// Holds event lines
background-color: $colorPlotBg;
//box-shadow: inset $colorPlotAreaBorder 0 0 0 1px; // Using box-shadow instead of border to not affect box size
position: absolute;
top: $m; right: 0; bottom: $m; left: 0;
}
Expand Down Expand Up @@ -80,7 +79,6 @@
.c-timeline__event-line--extended {
@include abs();
width: $eventLineW;
opacity: 0.4;

&.--hilite {
opacity: 0.8;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/flexibleLayout/components/ContainerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@
</template>

<script>
import ResizeHandle from '@/ui/layout/ResizeHandle/ResizeHandle.vue';

import DropHint from './DropHint.vue';
import FrameComponent from './FrameComponent.vue';
import ResizeHandle from './ResizeHandle.vue';

const MIN_FRAME_SIZE = 5;

Expand Down
7 changes: 4 additions & 3 deletions src/plugins/flexibleLayout/components/FlexibleLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@
</template>

<script>
import Container from '../utils/container.js';
import Frame from '../utils/frame.js';
import Container from '@/ui/layout/Container.js';
import Frame from '@/ui/layout/Frame.js';
import ResizeHandle from '@/ui/layout/ResizeHandle/ResizeHandle.vue';

import ContainerComponent from './ContainerComponent.vue';
import DropHint from './DropHint.vue';
import ResizeHandle from './ResizeHandle.vue';

const MIN_CONTAINER_SIZE = 5;

Expand Down
35 changes: 3 additions & 32 deletions src/plugins/flexibleLayout/components/flexible-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -247,46 +247,17 @@
}

&__resize-handle {
$size: 2px;
$size: 1px;
$margin: 3px;
$marginHov: 0;
$grippyThickness: $size + 6;
$grippyLen: $grippyThickness * 2;

@include resizeHandleStyle($size, $margin);

display: flex;
flex-direction: column;
flex: 0 0 ($margin * 2) + $size;

&:before {
// The visible resize line
background-color: $editUIColor;
content: '';
display: block;
flex: 1 1 auto;
min-height: $size;
min-width: $size;
}

&.vertical {
padding: $margin $size;
&:hover {
cursor: row-resize;
}
}

&.horizontal {
padding: $size $margin;
&:hover {
cursor: col-resize;
}
}

&:hover {
&:before {
// The visible resize line
background-color: $editUIColorHov;
}
}
}

// Hide the resize-handles in first and last c-fl-frame elements
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/flexibleLayout/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import Container from '@/ui/layout/Container.js';

import FlexibleLayoutViewProvider from './flexibleLayoutViewProvider.js';
import ToolBarProvider from './toolbarProvider.js';
import Container from './utils/container.js';

export default function plugin() {
return function install(openmct) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plan/components/PlanView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div ref="plan" class="c-plan c-timeline-holder">
<template v-if="viewBounds && !options.compact">
<SwimLane>
<SwimLane class="c-swimlane__time-axis">
<template #label>{{ timeSystem.name }}</template>
<template #object>
<TimelineAxis
Expand Down
17 changes: 17 additions & 0 deletions src/plugins/timeline/Container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Container {
constructor(domainObject, size) {
this.domainObjectIdentifier = domainObject.identifier;
this.size = size;
this.scale = getContainerScale(domainObject);

Check warning on line 5 in src/plugins/timeline/Container.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/timeline/Container.js#L3-L5

Added lines #L3 - L5 were not covered by tests
}
}

function getContainerScale(domainObject) {
if (domainObject.type === 'telemetry.plot.stacked') {
return domainObject?.composition?.length;

Check warning on line 11 in src/plugins/timeline/Container.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/timeline/Container.js#L10-L11

Added lines #L10 - L11 were not covered by tests
}

return 1;

Check warning on line 14 in src/plugins/timeline/Container.js

View check run for this annotation

Codecov / codecov/patch

src/plugins/timeline/Container.js#L14

Added line #L14 was not covered by tests
}

export default Container;
11 changes: 10 additions & 1 deletion src/plugins/timeline/TimelineObjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<SwimLane
:icon-class="item.type.definition.cssClass"
:status="status"
:min-height="item.height"
:show-ucontents="isPlanLikeObject(item.domainObject)"
:span-rows-count="item.rowCount"
:domain-object="item.domainObject"
Expand All @@ -33,6 +32,7 @@
:hide-button="!item.isEventTelemetry"
:button-click-on="enableExtendEventLines"
:button-click-off="disableExtendEventLines"
:style="[{ 'flex-basis': sizeString }]"
>
<template #label>
{{ item.domainObject.name }}
Expand Down Expand Up @@ -67,6 +67,10 @@
extendedLinesBus: {
type: Object,
required: true
},
size: {
type: Number,
required: true
}
},
data() {
Expand All @@ -76,6 +80,11 @@
status: ''
};
},
computed: {
sizeString() {
return `${this.size}%`;

Check warning on line 85 in src/plugins/timeline/TimelineObjectView.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/timeline/TimelineObjectView.vue#L85

Added line #L85 was not covered by tests
}
},
watch: {
item(newItem) {
if (!this.context) {
Expand Down
Loading
Loading