Remove zoom and xbrush from histogram

pull/3897/head
Alex P 2018-07-12 13:25:18 -07:00
parent bd5cfa9d85
commit bb5da598b7
2 changed files with 0 additions and 32 deletions

View File

@ -6,12 +6,10 @@ import HistogramChartAxes from 'src/shared/components/HistogramChartAxes'
import HistogramChartBars from 'src/shared/components/HistogramChartBars'
import HistogramChartTooltip from 'src/shared/components/HistogramChartTooltip'
import HistogramChartSkeleton from 'src/shared/components/HistogramChartSkeleton'
import XBrush from 'src/shared/components/XBrush'
import extentBy from 'src/utils/extentBy'
import {
TimePeriod,
HistogramData,
Margins,
HoverData,
@ -33,7 +31,6 @@ interface Props {
height: number
colors: HistogramColor[]
colorScale: ColorScale
onZoom?: (TimePeriod) => void
onBarClick?: (time: string) => void
}
@ -86,7 +83,6 @@ class HistogramChart extends PureComponent<Props, State> {
yScale={yScale}
/>
</g>
{this.xBrush}
<g
transform={bodyTransform}
className="histogram-chart--bars"
@ -117,24 +113,6 @@ class HistogramChart extends PureComponent<Props, State> {
)
}
private get xBrush(): JSX.Element {
const {onZoom} = this.props
const {xScale, adjustedWidth, adjustedHeight, bodyTransform} = this
if (onZoom) {
return (
<g className="histogram-chart--brush" transform={bodyTransform}>
<XBrush
xScale={xScale}
width={adjustedWidth}
height={adjustedHeight}
onBrush={this.handleBrush}
/>
</g>
)
}
}
private get xScale(): ScaleTime<number, number> {
const {adjustedWidth} = this
const {data} = this.props
@ -196,11 +174,6 @@ class HistogramChart extends PureComponent<Props, State> {
return Math.max(...counts)
}
private handleBrush = (t: TimePeriod): void => {
this.props.onZoom(t)
this.setState({hoverData: null})
}
private handleHover = (hoverData: HoverData): void => {
this.setState({hoverData})
}

View File

@ -7,11 +7,6 @@ export interface HistogramDatum {
group: string
}
export interface TimePeriod {
start: UnixTime
end: UnixTime
}
export type HistogramData = HistogramDatum[]
export type TooltipAnchor = 'left' | 'right'