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

Discrete Event Visualization in Timeline #7967

Open
wants to merge 76 commits into
base: master
Choose a base branch
from

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Dec 18, 2024

Closes #7936

Describe your changes:

Adds a discrete event visualization for the Time Strip object.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

scottbell and others added 30 commits December 9, 2024 10:32
- Removed in-page `style` defs from ExtendedLinesOverlay.vue; CSS actually located in timeline.scss.
- Improved sizing and style for Marcus Bains ("now") line.
- Removed extraneous padding at bottom of plot view when in Time Strip.
- Added missing header info to timeline.scss.
- CSS refinements.
- Removed bad `}` in TimeSystemAxis.vue.
- Removed `.u-contents` from line 129 of ganttChart.e2e.spec.js.
- Removed `event-handle` element; not needed.
- Changed `__event-wrapper` to not set height explicitly; uses absolute positioning.
- Added :before element to event-wrapper for better hit area.
- Improved hover styling.
- $colorEvent* style constants added to theme constant SCSS files.
- Layout converted to set `min-height` on top-most `c-swimlane` element.
Interior containers now use 100% height or absolute positioning.
- Removed `c-timeline-holder` from `c-events-tsv` in EventTimelineView.vue;
Refactored `c-events-tsv__contents` to be `js-events-tsv` as that was being used as a reference.
- New theme constant `eventLineW` sets event lines to be 1px wide for more precision.
- Removed event handle again.
@unlikelyzero unlikelyzero added the notable_change A change which should be noted in the changelog label Dec 24, 2024
@scottbell scottbell requested a review from unlikelyzero January 6, 2025 09:11
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 6, 2025
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 6, 2025
@akhenry akhenry removed this from the Target:4.1.0 milestone Jan 29, 2025
let clientWidth = this.$refs.events.clientWidth;

if (!clientWidth) {
//this is a hack - need a better way to find the parent of this component
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah this won't work if embedded in a layout. What's the issue with using $el for this? Does it not resize with its parent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Braindead copy/paste from PlanView. Now using $el

*****************************************************************************/

import { EventEmitter } from 'eventemitter3';
export default class ExtendedLinesBus extends EventEmitter {
Copy link
Contributor

Choose a reason for hiding this comment

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

A message bus is 100% the right architecture for this.

Recently I've been toying with CustomEvents instead of EventEmitters as they're browser-native (vs a Node-ism), and the addEventListener / dispatchEvent functions are familiar to all JS developers.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gave it a shot! Let me know what you think.

*****************************************************************************/

import { EventEmitter } from 'eventemitter3';
export default class ExtendedLinesBus extends EventEmitter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if this could be implemented as a Vue composable instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We pass this bus around between two Open MCT plugins, the timeline plugin, and the events plugin, so on first blush I'd probably say it's better as a plain ES6 class.

if (!clientWidth) {
//this is a hack - need a better way to find the parent of this component
const parent = this.openmct.layout.$refs.browseObject.$el;
// Fallback: use the actual container element (the immediate parent)
Copy link
Contributor

Choose a reason for hiding this comment

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

I vaguely recall .parentElement not working in some specific cases for planView, but maybe that's not an issue here. I'll test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable_change A change which should be noted in the changelog type:feature Feature. Required intentional design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add discrete event visualization
5 participants