mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Plot] Restrict hover coordinates
Only show hover coordinates in a stacked plot for the plot which the user is specifically hovering over. WTD-625.
This commit is contained in:
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="gl-plot-coords"
|
<div class="gl-plot-coords"
|
||||||
ng-if="representation.showControls">
|
ng-if="subplot.isHovering()">
|
||||||
{{subplot.getHoverCoordinates().join(', ')}}
|
{{subplot.getHoverCoordinates().join(', ')}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -46,7 +46,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="gl-plot-display-area"
|
<div class="gl-plot-display-area"
|
||||||
ng-mouseenter="representation.showControls = true">
|
ng-mouseenter="subplot.isHovering(true); representation.showControls = true;"
|
||||||
|
ng-mouseleave="subplot.isHovering(false)">
|
||||||
|
|
||||||
<div class="gl-plot-hash hash-v"
|
<div class="gl-plot-hash hash-v"
|
||||||
ng-repeat="tick in subplot.getDomainTicks()"
|
ng-repeat="tick in subplot.getDomainTicks()"
|
||||||
|
@ -19,7 +19,8 @@ define(
|
|||||||
formatter = new PlotFormatter(),
|
formatter = new PlotFormatter(),
|
||||||
domainOffset,
|
domainOffset,
|
||||||
mousePosition,
|
mousePosition,
|
||||||
marqueeStart;
|
marqueeStart,
|
||||||
|
isHovering = false;
|
||||||
|
|
||||||
// Utility, for map/forEach loops. Index 0 is domain,
|
// Utility, for map/forEach loops. Index 0 is domain,
|
||||||
// index 1 is range.
|
// index 1 is range.
|
||||||
@ -157,6 +158,7 @@ define(
|
|||||||
* @param $event the mouse event
|
* @param $event the mouse event
|
||||||
*/
|
*/
|
||||||
hover: function ($event) {
|
hover: function ($event) {
|
||||||
|
isHovering = true;
|
||||||
mousePosition = toMousePosition($event);
|
mousePosition = toMousePosition($event);
|
||||||
if (marqueeStart) {
|
if (marqueeStart) {
|
||||||
updateMarqueeBox();
|
updateMarqueeBox();
|
||||||
@ -194,6 +196,12 @@ define(
|
|||||||
},
|
},
|
||||||
setDomainOffset: function (value) {
|
setDomainOffset: function (value) {
|
||||||
domainOffset = value;
|
domainOffset = value;
|
||||||
|
},
|
||||||
|
isHovering: function (state) {
|
||||||
|
if (state !== undefined) {
|
||||||
|
isHovering = state;
|
||||||
|
}
|
||||||
|
return isHovering;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user