Skip to content

Commit f4093e2

Browse files
authored
display the staticbar values correctly (#89)
1 parent 2465556 commit f4093e2

File tree

1 file changed

+3
-9
lines changed
  • bindings/jupyter-modules/jupyter-ma-causal/src/containers/staticbar-svg-container

1 file changed

+3
-9
lines changed

bindings/jupyter-modules/jupyter-ma-causal/src/containers/staticbar-svg-container/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import React, {Component} from 'react';
22
import {connect} from 'react-redux';
33
import {format as d3Format} from 'd3-format';
44

5-
import {
6-
getLineDataFactory,
7-
getLineDataYDomainFactory,
8-
} from '../../selectors/factories';
5+
import {getLineDataFactory} from '../../selectors/factories';
96

107
import {
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

Comments
 (0)