/
index.js
46 lines (39 loc) · 1.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import './styles.scss'
import React, { Component } from 'react'
import { connect } from 'kea'
import Dimensions from 'react-dimensions'
import { Graph } from 'insights-charts'
import ControlsLeft from './controls-left'
import CompareWith from './compare-with'
import ControlsRight from './controls-right'
import explorerLogic from '~/scenes/explorer/logic'
export const colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']
@Dimensions({ elementResize: true })
@connect({
props: [
explorerLogic, [
'graph',
'graphControls',
'graphTimeGroup'
]
]
})
export default class GraphView extends Component {
render () {
const { graph, graphControls, graphTimeGroup, containerHeight } = this.props
return (
<div className='graph-and-controls'>
<div className='graph' style={{ height: containerHeight - 20 }}>
<Graph
graph={graph}
controls={graphControls} />
</div>
<div className='controls'>
<ControlsLeft />
<CompareWith />
<ControlsRight />
</div>
</div>
)
}
}