mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Tidy-ups
This commit is contained in:
@@ -77,7 +77,7 @@
|
|||||||
"less": "^2.5.3",
|
"less": "^2.5.3",
|
||||||
"less-loader": "^2.2.1",
|
"less-loader": "^2.2.1",
|
||||||
"react-addons-test-utils": "^15.0.1",
|
"react-addons-test-utils": "^15.0.1",
|
||||||
"@types/react-measure": "^0.4.6",
|
"react-measure": "^1.4.6",
|
||||||
"react-testutils-additions": "^15.1.0",
|
"react-testutils-additions": "^15.1.0",
|
||||||
"rimraf": "^2.4.3",
|
"rimraf": "^2.4.3",
|
||||||
"rollup": "0.36",
|
"rollup": "0.36",
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ export default class PieChart extends Component {
|
|||||||
return (
|
return (
|
||||||
<g key={`group-${i}`}>
|
<g key={`group-${i}`}>
|
||||||
<path key={`arc-${i}`} d={this.arc(d)} style={{ fill: this.colors[i] }} />
|
<path key={`arc-${i}`} d={this.arc(d)} style={{ fill: this.colors[i] }} />
|
||||||
<text key={`label-${i}`} transform={labelTranslate} stroke={LABEL_COLOUR} strokeWidth='1px' fill='None' textAnchor='middle'>{d.value}</text>
|
<text key={`label-${i}`} transform={labelTranslate} style={{ strokeWidth: '0px', fill: LABEL_COLOUR }} textAnchor='middle'>{d.value}</text>
|
||||||
<text key={`key-${i}`} transform={keyTranslate} style={{ stroke: this.colors[i], strokeWidth:'1px', fill:'None' }} textAnchor='middle'>{d.data.label}</text>
|
<text key={`key-${i}`} transform={keyTranslate} style={{ strokeWidth:'0px', fill: this.colors[i] }} textAnchor='middle'>{d.data.label}</text>
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ export default class VerticalBarChart extends Component {
|
|||||||
.attr('text-anchor', 'middle')
|
.attr('text-anchor', 'middle')
|
||||||
.attr('x', 100)
|
.attr('x', 100)
|
||||||
.attr('y', 100)
|
.attr('y', 100)
|
||||||
.attr('stroke', '#ffffff')
|
.attr('stroke-width', '0px')
|
||||||
.attr('stroke-width', '1px')
|
.attr('fill', '#ffffff')
|
||||||
.attr('x', d => this.x(d.label) + this.x.bandwidth() / 2)
|
.attr('x', d => this.x(d.label) + this.x.bandwidth() / 2)
|
||||||
.attr('y', d => this.y(d.value) + 15)
|
.attr('y', d => this.y(d.value) + 15)
|
||||||
.text(d => d.value);
|
.text(d => d.value);
|
||||||
@@ -115,16 +115,17 @@ export default class VerticalBarChart extends Component {
|
|||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
const { width } = this.state.dimensions;
|
const { width } = this.state.dimensions;
|
||||||
|
|
||||||
const translate = `translate(${margin.left}, ${margin.top})`;
|
const translate = `translate(${margin.left}, ${margin.top})`;
|
||||||
|
|
||||||
|
const height = width * ASPECT;
|
||||||
|
|
||||||
this._renderGraph(this.props);
|
this._renderGraph(this.props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Measure width='100%' whitelist={['width', 'top']} onMeasure={ (dimensions) => { this.setState({ dimensions }); }}>
|
<Measure width='100%' whitelist={['width', 'top']} onMeasure={ (dimensions) => { this.setState({ dimensions }); }}>
|
||||||
<div width={width} height={width * ASPECT}>
|
<div width={width} height={height}>
|
||||||
{ this.x ?
|
{ this.x ?
|
||||||
<svg ref={ref => this.svg = ref} width={width} height={width * ASPECT} transform={translate}>
|
<svg ref={ref => this.svg = ref} width={width} height={height} transform={translate}>
|
||||||
<g transform={translate}></g>
|
<g transform={translate}></g>
|
||||||
</svg> : null }
|
</svg> : null }
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user