summaryrefslogtreecommitdiff
path: root/scraper/client/paper/paper.info.js
blob: 3523461733df92cb67b9da935a9112b19f0645e9 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
import React, { Component } from 'react'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'

import * as actions from '../actions'

import { TableObject } from '../common'

class PaperInfo extends Component {
  render() {
    const { paperInfo, unknownCitations } = this.props.api
    const { dataset, address } = paperInfo
    if (!dataset) return null
    return (
      <div className='paperInfo'>
        <h2>{dataset.name_full}</h2>
        <TableObject summary
          tag="Dataset"
          object={dataset}
          order={['key', 'name_full', 'relevance', 'subset_of', 'superset_of']}
        />
        <TableObject summary
          tag="Statistics"
          object={dataset}
          order={['year_published', 'purpose_short',
            'wild', 'indoor', 'outdoor', 'cyberspace',
            'names', 'downloaded',
            'year_published', 'year_start', 'year_end', 'ongoing', 'images', 'videos',
            'faces_unique', 'total_faces', 'img_per_person', 'num_cameras', 'faces_persons', 'female', 'male',
            'landmarks', 'width', 'height',
            'comment',
          ]}
        />
        <TableObject
          tag="Address"
          object={address}
          order={['address', 'type', 'lat', 'lng']}
        />
        <TableObject summary
          tag="Citations"
          object={{
            'geocoded': paperInfo.citations.length,
            'unknown': unknownCitations.citations ? unknownCitations.citations.length : 'Loading',
          }}
        />
      </div>
    )
  }
}

const mapStateToProps = state => ({
  api: state.api
})
const mapDispatchToProps = dispatch => ({
  actions: bindActionCreators({ ...actions }, dispatch),
})

export default connect(mapStateToProps, mapDispatchToProps)(PaperInfo)