summaryrefslogtreecommitdiff
path: root/client/chart/pie.charts.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-06-27 19:01:55 -0400
committerJules Laplace <julescarbon@gmail.com>2019-06-27 19:01:55 -0400
commit213c89c7ff478e3fba73b0efbfd88cc084ceb43c (patch)
tree1f0de29c1f87dd54be7fa9ec5ae899ea037231f4 /client/chart/pie.charts.js
parentb7f8cfd92446c8107c75b4840c56d92304c16e78 (diff)
adding single pie chart
Diffstat (limited to 'client/chart/pie.charts.js')
-rw-r--r--client/chart/pie.charts.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/client/chart/pie.charts.js b/client/chart/pie.charts.js
index 939e9262..a73c953e 100644
--- a/client/chart/pie.charts.js
+++ b/client/chart/pie.charts.js
@@ -1,8 +1,6 @@
import React, { Component } from 'react'
-import { bindActionCreators } from 'redux'
-import { connect } from 'react-redux'
-import { toArray, toTuples } from '../util'
import C3Chart from 'react-c3js'
+import { toTuples } from '../util'
import 'c3/c3.css'
import './chart.css'
@@ -38,7 +36,7 @@ class PieCharts extends Component {
institutionTypes[address.type] += 1
break
case 'mil':
- institutionTypes['gov'] += 1
+ institutionTypes.gov += 1
break
default:
console.log('weird institution type', address)
@@ -47,10 +45,10 @@ class PieCharts extends Component {
})
})
- const countryTuples = toTuples(countries).sort((a,b) => b[1] - a[1])
+ const countryTuples = toTuples(countries).sort((a, b) => b[1] - a[1])
let countryRows = countryTuples.slice(0, 10)
- const otherCountryCount = countryTuples.slice(10).reduce((a,b) => (a + b[1]), 0)
+ const otherCountryCount = countryTuples.slice(10).reduce((a, b) => (a + b[1]), 0)
if (otherCountryCount > 0) {
countryRows.push([
otherCountriesLabel,
@@ -61,12 +59,10 @@ class PieCharts extends Component {
const institutionRows = toTuples(institutionTypes)
.map(a => [institutionOrder[a[0]], a])
- .sort((a,b) => a[0] - b[0])
+ .sort((a, b) => a[0] - b[0])
.map(a => a[1])
.map(a => [institutionLabels[a[0]], a[1]])
- const colorPattern = rainbow
-
return (
<div className='chart'>
<div>