From 515c452903258fd6b2ba32d350edc5b31f4d9fbd Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 12 Mar 2018 12:31:47 -0700 Subject: [PATCH] Polish crosshair styles Also renamed some things --- ui/src/shared/components/Crosshair.js | 14 +++++++++----- ui/src/style/components/crosshairs.scss | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ui/src/shared/components/Crosshair.js b/ui/src/shared/components/Crosshair.js index 4899df4cf7..a111dd35df 100644 --- a/ui/src/shared/components/Crosshair.js +++ b/ui/src/shared/components/Crosshair.js @@ -1,24 +1,28 @@ import React, {PropTypes, Component} from 'react' import {DYGRAPH_CONTAINER_XLABEL_MARGIN} from 'shared/constants' +import {NULL_HOVER_TIME} from 'shared/constants/tableGraph' + import classnames from 'classnames' class Crosshair extends Component { render() { const {dygraph, staticLegendHeight, hoverTime} = this.props - const crosshairleft = Math.round( + const crosshairLeft = Math.round( Math.max(-1000, dygraph.toDomXCoord(hoverTime)) || -1000 + 1 ) const crosshairHeight = `calc(100% - ${staticLegendHeight + DYGRAPH_CONTAINER_XLABEL_MARGIN}px)` + const crosshairHidden = hoverTime === NULL_HOVER_TIME + return ( -
+