@@ -2,10 +2,7 @@ import React, {Component} from 'react';
22import { connect } from 'react-redux' ;
33import { format as d3Format } from 'd3-format' ;
44
5- import {
6- getLineDataFactory ,
7- getLineDataYDomainFactory ,
8- } from '../../selectors/factories' ;
5+ import { getLineDataFactory } from '../../selectors/factories' ;
96
107import {
118 getChartWidth ,
@@ -17,10 +14,8 @@ const mapStateToProps = (state, props) => {
1714 const { index, lineName} = props ;
1815 // lineName: the name of the line representing the uplifting effect
1916 const getLineData = getLineDataFactory ( index , lineName ) ;
20- const getLineDataYDomain = getLineDataYDomainFactory ( getLineData ) ;
2117 return {
2218 data : getLineData ( state ) ,
23- domain : getLineDataYDomain ( state ) ,
2419 width : getChartWidth ( state ) ,
2520 height : getChartHeight ( state ) ,
2621 padding : getChartPadding ( state ) ,
@@ -37,7 +32,6 @@ class Chart extends Component {
3732 height,
3833 padding : { left, right, top, bottom} ,
3934 groupName, // treatment or control
40- domain,
4135 } = this . props ;
4236
4337 const format = d3Format ( '.2f' ) ;
@@ -59,10 +53,10 @@ class Chart extends Component {
5953 >
6054 { groupName === 'treatment'
6155 ? data . length
62- ? format ( domain [ 0 ] )
56+ ? format ( data [ data . length - 1 ] . y )
6357 : null
6458 : data . length
65- ? format ( domain [ 1 ] )
59+ ? format ( data [ 0 ] . y )
6660 : null }
6761 </ text >
6862 </ svg >
0 commit comments