import React from 'react'; import { XYPlot, XAxis, YAxis, HorizontalGridLines, VerticalGridLines, LineSeries } from 'react-vis/dist'; import GridArea from '../src/grid-area'; import '../node_modules/react-vis/dist/style.css'; const MSEC_DAILY = 86400000; export default class GridAreaWithPopupOnValueClick extends React.Component { constructor() { super(); this.state = {}; this.state.tooltipNode = undefined; } render() { const timestamp = new Date('September 9 2017').getTime(); const tooltipNodeRect = this.state.tooltipNode ? this.state.tooltipNode.getBoundingClientRect() : undefined; return (
{ console.log(ev); this.setState({ tooltipNode: ev.currentTarget }); }} /> { (this.state.tooltipNode !== undefined) ? (
Here's a tooltip
) : ( undefined ) }
); } }