From 4f559fdccf3f558c33c97ea8a82ac2d29923a918 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Mon, 18 Sep 2023 15:12:18 -0700 Subject: [PATCH] cherry-pick(#7052): Allow Data Visualization in inspector based on current selection (#7062) Allow Data Visualization in inspector based on current selection (#7052) * visualize data in inspector per selection --------- Co-authored-by: David Tsay <3614296+davetsay@users.noreply.github.com> Co-authored-by: Khalid Adil Co-authored-by: John Hill --- .../DataVisualization.vue | 186 ++++++++++++++++++ .../inspectorDataVisualization/Imagery.vue | 127 ++++++++++++ .../InspectorDataVisualizationComponent.vue | 65 ++++++ .../InspectorDataVisualizationViewProvider.js | 94 +++++++++ .../NumericData.vue | 165 ++++++++++++++++ .../TelemetryFrame.vue | 124 ++++++++++++ .../inspector-data-visualization.scss | 128 ++++++++++++ .../inspectorDataVisualization/plugin.js | 31 +++ src/plugins/plugins.js | 7 +- src/styles/vue-styles.scss | 1 + 10 files changed, 926 insertions(+), 2 deletions(-) create mode 100644 src/plugins/inspectorDataVisualization/DataVisualization.vue create mode 100644 src/plugins/inspectorDataVisualization/Imagery.vue create mode 100644 src/plugins/inspectorDataVisualization/InspectorDataVisualizationComponent.vue create mode 100644 src/plugins/inspectorDataVisualization/InspectorDataVisualizationViewProvider.js create mode 100644 src/plugins/inspectorDataVisualization/NumericData.vue create mode 100644 src/plugins/inspectorDataVisualization/TelemetryFrame.vue create mode 100644 src/plugins/inspectorDataVisualization/inspector-data-visualization.scss create mode 100644 src/plugins/inspectorDataVisualization/plugin.js diff --git a/src/plugins/inspectorDataVisualization/DataVisualization.vue b/src/plugins/inspectorDataVisualization/DataVisualization.vue new file mode 100644 index 0000000000..2578f022b2 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/DataVisualization.vue @@ -0,0 +1,186 @@ + + + + diff --git a/src/plugins/inspectorDataVisualization/Imagery.vue b/src/plugins/inspectorDataVisualization/Imagery.vue new file mode 100644 index 0000000000..31e048d04f --- /dev/null +++ b/src/plugins/inspectorDataVisualization/Imagery.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/plugins/inspectorDataVisualization/InspectorDataVisualizationComponent.vue b/src/plugins/inspectorDataVisualization/InspectorDataVisualizationComponent.vue new file mode 100644 index 0000000000..9adc745a27 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/InspectorDataVisualizationComponent.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/plugins/inspectorDataVisualization/InspectorDataVisualizationViewProvider.js b/src/plugins/inspectorDataVisualization/InspectorDataVisualizationViewProvider.js new file mode 100644 index 0000000000..4f44518e91 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/InspectorDataVisualizationViewProvider.js @@ -0,0 +1,94 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2023, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +import mount from 'utils/mount'; + +import InspectorDataVisualizationComponent from './InspectorDataVisualizationComponent.vue'; + +export default function InspectorDataVisualizationViewProvider(openmct, configuration) { + const { + type = 'mmgis', + name = 'Data Visualization', + placeholderText = '', + plotOptions, + imageryOptions + } = configuration; + + return { + key: 'inspectorDataVisualizationView', + name, + + canView(selection) { + const domainObject = selection?.[0]?.[0]?.context?.item; + + return domainObject?.type === type; + }, + + view(selection) { + let _destroy = null; + + const context = selection[0][0].context; + const domainObject = context.item; + const dataVisualizationContext = context?.dataVisualization ?? {}; + const timeFormatter = openmct.telemetry.getFormatter('iso'); + + return { + show(element) { + const { destroy } = mount( + { + components: { + InspectorDataVisualization: InspectorDataVisualizationComponent + }, + provide: { + openmct, + domainObject, + timeFormatter, + placeholderText, + plotOptions, + imageryOptions + }, + data() { + return { + context: dataVisualizationContext + }; + }, + template: `` + }, + { + app: openmct.app, + element + } + ); + _destroy = destroy; + }, + destroy() { + if (_destroy) { + _destroy(); + } + }, + priority() { + return openmct.priority.HIGH; + } + }; + } + }; +} diff --git a/src/plugins/inspectorDataVisualization/NumericData.vue b/src/plugins/inspectorDataVisualization/NumericData.vue new file mode 100644 index 0000000000..bad83fc587 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/NumericData.vue @@ -0,0 +1,165 @@ + + + + diff --git a/src/plugins/inspectorDataVisualization/TelemetryFrame.vue b/src/plugins/inspectorDataVisualization/TelemetryFrame.vue new file mode 100644 index 0000000000..23b53fdd78 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/TelemetryFrame.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/plugins/inspectorDataVisualization/inspector-data-visualization.scss b/src/plugins/inspectorDataVisualization/inspector-data-visualization.scss new file mode 100644 index 0000000000..a7be702580 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/inspector-data-visualization.scss @@ -0,0 +1,128 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2023, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + + //InspectorDataVisualizationComponent + .c-data-visualization-inspector__flex-column { + display: flex; + flex-direction: column; +} + +.c-data-visualization-inspector__flex-row { + display: flex; + flex-direction: row; +} + +.c-data-visualization-inspect-properties + .c-data-visualization-inspect-properties { + margin-top: 10px; +} + +// DataVisualization +.c-inspector__data-pivot-placeholder { + margin-top: 8px; +} + +.c-inspector__data-pivot-coordinates-wrapper { + display: flex; + align-items: center; + margin-top: 10px; +} + +.c-inspector__data-pivot-coordinates { + margin-left: 6px; + text-transform: capitalize; +} + +.c-inspector__data-pivot-range-selector { + margin: 10px auto; + height: 25px; + max-width: 100%; +} + +.c-inspector__imagery-view { + margin-top: 10px; +} + +.c-imagery-view__camera-image-set { + grid-column: 1/3; +} + +.c-imagery-view__camera-image-list { + display: grid; + grid-auto-flow: column; + grid-gap: 10px; + grid-auto-columns: min-content; + overflow: auto; + white-space: nowrap; + margin-top: 5px; +} + +.c-imagery-view__camera-image { + display: inline-block; +} + +.c-imagery-view__camera-image img { + width: 70px; + height: 70px; +} + +.c-imagery-view__camera-image-timestamp { + white-space: break-spaces; +} + +// Telemetry Frame +.c-telemetry-frame { + margin: 8px 0px; + + &__title-bar { + display: flex; + align-items: center; + margin: 6px 0px; + } + + &__title { + flex: 1; + font-size: 1.2em; + } + + &__title-icon { + margin-right: 4px; + } +} + +.c-telemetry-frame .c-menu { + position: absolute; + right: 0px; +} + +.c-inspector__data-pivot .c-plot { + position: relative; + min-height: 150px; + max-height: 200px; +} + +.c-inspector__data-pivot .c-plot .c-plot--stacked-container { + min-height: 150px; +} + +.c-inspector__numeric-data .c-inspect-properties__header { + margin-bottom: 10px; +} diff --git a/src/plugins/inspectorDataVisualization/plugin.js b/src/plugins/inspectorDataVisualization/plugin.js new file mode 100644 index 0000000000..961c45b2b5 --- /dev/null +++ b/src/plugins/inspectorDataVisualization/plugin.js @@ -0,0 +1,31 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2023, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + +import InspectorDataVisualizationViewProvider from './InspectorDataVisualizationViewProvider'; + +export default function (options) { + return function (openmct) { + openmct.inspectorViews.addProvider( + new InspectorDataVisualizationViewProvider(openmct, options) + ); + }; +} diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index af255090d9..0393a333a6 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -83,7 +83,8 @@ define([ './timelist/plugin', './faultManagement/FaultManagementPlugin', '../../example/exampleTags/plugin', - './inspectorViews/plugin' + './inspectorViews/plugin', + './inspectorDataVisualization/plugin' ], function ( _, UTCTimeSystem, @@ -147,7 +148,8 @@ define([ TimeList, FaultManagementPlugin, ExampleTags, - InspectorViews + InspectorViews, + InspectorDataVisualization ) { const plugins = {}; @@ -232,6 +234,7 @@ define([ plugins.Gauge = GaugePlugin.default; plugins.Timelist = TimeList.default; plugins.InspectorViews = InspectorViews.default; + plugins.InspectorDataVisualization = InspectorDataVisualization.default; return plugins; }); diff --git a/src/styles/vue-styles.scss b/src/styles/vue-styles.scss index aaf2a2a55f..3f32fc9d5a 100644 --- a/src/styles/vue-styles.scss +++ b/src/styles/vue-styles.scss @@ -58,6 +58,7 @@ @import '../plugins/gauge/gauge.scss'; @import '../plugins/faultManagement/fault-manager.scss'; @import '../plugins/operatorStatus/operator-status'; +@import '../plugins/inspectorDataVisualization/inspector-data-visualization.scss'; #splash-screen { display: none;