-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Discrete Event Visualization in Timeline #7967
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
base: master
Are you sure you want to change the base?
Conversation
…vent-visualization
- 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.
let clientWidth = this.$refs.events.clientWidth; | ||
|
||
if (!clientWidth) { | ||
//this is a hack - need a better way to find the parent of this component |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
|
||
return selection; | ||
}, | ||
createSelectionForInspector(event, eventWrapper) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from being a bit obtuse, our selection API is also not documented. This is a sterling effort to successfully use it against all the odds.
In principle you should be able to just call openmct.selection.selectable(eventWrapper, {item: event})
to make each event element responsive to the selection API. The parent view is already selectable, so it should automatically pick up the correct object path, so you shouldn't have to create that whole selection hierarchy manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not resolved. We should not be manually constructing the selection path - https://github.com/nasa/openmct/pull/7967/files/32a0e1569144e1b4384c3f7e984a72cc90716823..2e35212c322d851e58b2e96d396166e3948f9538#diff-35593380249d65dcade3df51d2bfe759a597f2e9690e12e001aa8b81f19f6ffbR314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost write permission to this branch 😢, but the fix should look like this:
createSelectionForInspector(event) {
const eventWrapper = this.$refs[`wrapper-${event.time}`][0];
const eventContext = {
type: 'time-strip-event-selection',
event,
item: this.domainObject
};
this.unsubscribeSelection = this.openmct.selection.selectable(
eventWrapper,
eventContext,
true
);
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in beforeUnmount
:
if (this.unsubscribeSelection) {
this.unsubscribeSelection();
}
*****************************************************************************/ | ||
|
||
import { EventEmitter } from 'eventemitter3'; | ||
export default class ExtendedLinesBus extends EventEmitter { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…riority for eventtimelineviewprovider to HIGH. Also add a condition to the eventtimelineview to reject objects that have imagery (this is to promote the imagerytimestripview to handle those objets)
1) reduce call to instance method 2) Use existing event line bus functionality 3) move non reactive properties to the created lifecycle hook
…d-discrete-event-visualization
…send tick updates
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) |
There was a problem hiding this comment.
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.
} | ||
|
||
return { | ||
key: type, | ||
name: 'Event Timeline View', | ||
cssClass: 'icon-event', | ||
priority: function () { | ||
return 6000; // big number! | ||
// We want this to be higher priority than the TelemetryTableView | ||
return openmct.priority.HIGH + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than making the timeline view HIGH + 1
I think we should just make the TelemetryTableView the lowest priority. Like, it's basically the default for all telemetry types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 3 qualifying views when you're trying to visualize events in the timeline view: Telemetry Table, LAD Table and Event timeline view.
The TelemetryTableView has a priority of 1
.
The LAD Table has a priority of HIGH.
The Event timeline has a priority of HIGH+1
This is why it's priority is HIGH+1. I think we need to review view priorities in general though.
|
||
return selection; | ||
}, | ||
createSelectionForInspector(event, eventWrapper) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not resolved. We should not be manually constructing the selection path - https://github.com/nasa/openmct/pull/7967/files/32a0e1569144e1b4384c3f7e984a72cc90716823..2e35212c322d851e58b2e96d396166e3948f9538#diff-35593380249d65dcade3df51d2bfe759a597f2e9690e12e001aa8b81f19f6ffbR314
Closes #7936
Describe your changes:
Adds a discrete event visualization for the Time Strip object.
All Submissions:
Author Checklist
type:
label? Note: this is not necessarily the same as the original issue.Reviewer Checklist