Commit 552a2feb authored by Hamer Iboshi's avatar Hamer Iboshi

Merge branch 'development' of gitlab.c3sl.ufpr.br:SMPPIR/Portal-SMPPIR-React into development

parents 96bcf073 b4c80b81
{
"python.pythonPath": "/usr/bin/python3"
}
\ No newline at end of file
......@@ -22,9 +22,7 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
import React from 'react';
import NavigationBar from './Components/NavigationBar';
import AfricanCulture from './SubPages/AfricanCulture';
import AfricanSustainability from './SubPages/AfricanSustainability';
import AfricanRights from './SubPages/AfricanRights';
import AfricanIndicator from './SubPages/AfricanIndicator';
import { Tab, Tabs } from 'react-materialize';
import { Store } from './Store';
......@@ -38,12 +36,12 @@ function AfricanOrigin() {
// Get information about which page was accessed
const { state, dispatch } = React.useContext(Store);
var states = {"DIREITOS": false, "CULTURA": false, "SUSTENTABILIDADE":false}
var states = {"MATRIZ AFRICANA": false}
if (state.page.toUpperCase() in states) {
states[state.page.toUpperCase()] = true
}
else {
states["DIREITOS"] = true
states["MATRIZ AFRICANA"] = true
}
// Hook to set page context
......@@ -67,10 +65,12 @@ function AfricanOrigin() {
<NavigationBar/>
<div id='contentTabsDiv'>
<div id="conteudo" />
<Tabs className={`tab-demo z-depth-1 ${contrastString}mainPageDarkBlueTab`} onChange={whereIAm}>
<Tab title="Direitos" active={states["DIREITOS"]}> {states["DIREITOS"] ? <AfricanRights /> : <div />} </Tab>
<Tab title="Cultura" active={states["CULTURA"]}> {states["CULTURA"] ? <AfricanCulture /> : <div />} </Tab>
<Tab title="Sustentabilidade" active={states["SUSTENTABILIDADE"]}> {states["SUSTENTABILIDADE"] ? <AfricanSustainability /> : <div />} </Tab>
<Tabs
className={`tab-demo z-depth-1 ${contrastString}mainPageDarkBlueTab`} onChange={whereIAm}
>
<Tab title="Matriz Africana" active={states["MATRIZ AFRICANA"]}>
{states["MATRIZ AFRICANA"] ? <AfricanIndicator /> : <div />}
</Tab>
</Tabs>
</div>
</div>
......
......@@ -24,6 +24,7 @@ import React, { Component } from 'react';
import { ResponsiveContainer, Bar, BarChart,
XAxis, YAxis, CartesianGrid, Tooltip, Legend, LabelList
} from 'recharts';
import './Styles/BuildStackedBar.css';
const getPercent = (value, total) => {
const ratio = total > 0 ? value / total : 0;
......@@ -34,7 +35,8 @@ const toPercent = (decimal, fixed = 0) => {
return `${(decimal * 100).toFixed(fixed)}%`;
};
const COLORS = ["#0E3959", "#0B7B6B", "#EA7C27", "#B66526", "#CA3828", "#363B1B", "#78752E", "#081A24", "#211517","#763618", "#722417", "#C93829", "#363B1BU"];
const COLORS = ["#0E3959", "#0B7B6B", "#EA7C27", "#B66526", "#CA3828", "#363B1B",
"#78752E", "#081A24", "#211517", "#763618", "#722417", "#C93829"];
const renderTooltipContent = (o) => {
const { payload, label } = o;
......@@ -60,33 +62,32 @@ const renderTooltipContent = (o) => {
);
};
/**
* Creates a bar chart. <br />
* Takes 4 props __customKeys__, __data__, __dataKey__ and __id__: <br />
* __customKeys__: Custom labels for the charts; <br />
* __data__: Raw data; <br />
* __dataKey__: Key to parse the data to be ploted;<br />
* __id__: Html name. <br />
*/
class BuildBar extends Component {
constructor(props) {
super(props);
this.state = {
data: []
};
this.renameKeys = this.renameKeys.bind(this);
this.filterArrayByPercent = this.filterArrayByPercent.bind(this);
}
/**
* Creates a bar chart. <br />
* Takes 4 props __customKeys__, __data__, __dataKey__ and __id__: <br />
* __customKeys__: Custom labels for the charts; <br />
* __data__: Raw data; <br />
* __dataKey__: Key to parse the data to be ploted;<br />
* __id__: Html name. <br />
*/
class BuildBar extends Component {
constructor(props) {
super(props);
this.state = {
data: null,
};
this.filterArrayByPercent = this.filterArrayByPercent.bind(this);
}
componentDidUpdate(prevProps) {
if (this.props !== prevProps) {
var data = this.props.data;
if (this.props.percent !== undefined)
data = this.filterArrayByPercent(data, this.props.percent);
this.setState({ data: data })
}
prevProps = null;
componentDidUpdate(prevProps) {
if (this.props !== prevProps) {
var data = this.props.data;
if (this.props.percent !== undefined)
data = this.filterArrayByPercent(data, this.props.percent);
this.setState({ data: data })
}
prevProps = null;
}
render() {
......@@ -107,9 +108,10 @@ const renderTooltipContent = (o) => {
return this.renameKeys(element, customKeys);
}, this);
}
if (newData !== null && newData !== undefined && newData.length > 0)
return (
<ResponsiveContainer height={cardHeight}>
<BarChart width={600} height={cardHeight} data={newData}
margin={{ top: 20, right: 0, left: 0, bottom: 5 }}>
......@@ -119,7 +121,7 @@ const renderTooltipContent = (o) => {
<Tooltip content={renderTooltipContent} />
<Legend />
{Object.keys(newData[0]).map(function (bar, index) {
if (bar !== dataKey && bar !== 'Sem informações') {
if (bar !== dataKey) {
if (label === undefined) {
return <Bar isAnimationActive={false} key={Math.random()} dataKey={bar} fill={COLORS[index]} />
}
......@@ -135,7 +137,6 @@ const renderTooltipContent = (o) => {
return null;
})
}
</BarChart>
</ResponsiveContainer>
);
......@@ -148,12 +149,14 @@ const renderTooltipContent = (o) => {
var returnObj = {};
var newKey;
for (let key in obj) {
newKey = newKeys[key] || key;
if (recurrentKeys.indexOf(newKey) === -1) {
recurrentKeys.push(newKey);
Object.assign(returnObj, { [newKey]: obj[key] });
} else {
returnObj[newKey] = returnObj[newKey] + obj[key];
if (newKeys[key] || key === this.props.dataKey) {
newKey = newKeys[key] || key;
if (recurrentKeys.indexOf(newKey) === -1) {
recurrentKeys.push(newKey);
Object.assign(returnObj, { [newKey]: obj[key] });
} else {
returnObj[newKey] = returnObj[newKey] + obj[key];
}
}
}
return returnObj;
......
......@@ -22,14 +22,12 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
import React from 'react';
import NavigationBar from './Components/NavigationBar';
import CiganosSustainability from './SubPages/CiganosSustainability';
import CiganosRights from './SubPages/CiganosRights';
import CiganosCulture from './SubPages/CiganosCulture';
import CiganosIndicator from './SubPages/CiganosIndicator';
import { Tab, Tabs } from 'react-materialize';
import { Store } from './Store';
import './Styles/AfricanOrigin.css'
import './Styles/Ciganos.css'
/**
* Main page overlay for managing access to the afican matrix subpages. <br />
......@@ -38,12 +36,12 @@ function Ciganos() {
// Get information about which page was accessed
const { state, dispatch } = React.useContext(Store);
var states = {"DIREITOS": false, "CULTURA": false, "SUSTENTABILIDADE":false}
var states = {"POVOS CIGANOS": false,}
if (state.page.toUpperCase() in states) {
states[state.page.toUpperCase()] = true
}
else {
states["DIREITOS"] = true
states["POVOS CIGANOS"] = true
}
// Hook to set page context
......@@ -67,10 +65,8 @@ function Ciganos() {
<NavigationBar/>
<div id='contentTabsDiv'>
<div id="conteudo" />
<Tabs className={`tab-demo z-depth-1 ${contrastString}mainPageOrangeTab`} onChange={whereIAm}>
<Tab title="Direitos" active={states["DIREITOS"]}> {states["DIREITOS"] ? <CiganosRights /> : <div />} </Tab>
<Tab title="Cultura" active={states["CULTURA"]}> {states["CULTURA"] ? <CiganosCulture /> : <div />} </Tab>
<Tab title="Sustentabilidade" active={states["SUSTENTABILIDADE"]}> {states["SUSTENTABILIDADE"] ? <CiganosSustainability /> : <div />} </Tab>
<Tabs className={`tab-demo z-depth-1 ${contrastString}mainPageYellowTab`} onChange={whereIAm}>
<Tab title="Povos Ciganos" active={states["POVOS CIGANOS"]}> {states["POVOS CIGANOS"] ? <CiganosIndicator /> : <div />} </Tab>
</Tabs>
</div>
</div>
......
......@@ -21,8 +21,7 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
import React, { Component } from 'react';
import { Icon, Row, Col } from 'react-materialize'
import { Store } from '../Store';
import { Row, Col, Button } from 'react-materialize'
import '../Styles/CardFooter.css'
......@@ -34,28 +33,32 @@ import '../Styles/CardFooter.css'
*/
class CardFooter extends Component {
render() {
var contrastString = this.context.state.contrast;
return (
<div className="footer">
<Row className="z-depth-1">
<Col s={9}>
<Row className="z-depth-1 valign-wrapper footer">
<Col>
<span><b>Fonte:</b>{this.props.source}</span>
</Col>
{this.props.data ?
<Col s={3} className={`${contrastString}dataSource center`}>
<a href={this.props.data}>
<Icon>assessment</Icon>
<p>Acesso aos Dados</p>
</a>
</Col>
: null
<Col s={2}>
<Button
node="a"
href={this.props.data}
className={'grey right'}
floating
icon="assessment"
tooltip="Acesso aos Dados"
// tooltipOptions={{ position: 'top' }}
style={{ margin:'3px'}}
>
</Button>
</Col>
:
null
}
</Row>
</div>
);
}
}
CardFooter.contextType = Store;
export default CardFooter;
......@@ -59,14 +59,14 @@ export default class CollapsibleContainer extends React.Component {
}
handleSelect (key) {
// const { onSelect } = this.props;
const { onSelect } = this.props;
// if (onSelect) { onSelect(key); }
if (onSelect) { onSelect(key); }
// if (this.state.activeKey === key) { key = null; }
if (this.state.activeKey === key) { key = null; }
// if (this.props.accordion) {
// this.setState({ activeKey: key });
// }
if (this.props.accordion) {
this.setState({ activeKey: key });
}
}
}
......@@ -60,21 +60,25 @@ function NavigationBar() {
<nav className={`${contrastString}navBackground z-depth-2`} style={{ height: 65 }}>
<div className="nav-wrapper">
<Link className="brand-logo hide-on-med-and-down" to='/'>
<img alt='Logo do SMPPIR' id={'portal-logo'} src={logoSMPPIR} style={{ width: 200, marginLeft: 20, marginTop: 15 }} />
</Link>
<Link className="brand-logo center hide-on-large-only" to='/'>
<img alt='Logo do SMPPIR' id={'portal-logo'} src={logoSMPPIR} style={{ width: 200, marginLeft: 20, marginTop: 15 }} />
</Link>
<ul className="right hide-on-med-and-down">{links}</ul>
<div className="left hide-on-large-only">
<SideNav className={`${contrastString}navBackground`} trigger={<a href=""><i className={`material-icons ${contrastString}navIcon`} style={{ marginLeft: 20 }}>menu</i></a>} options={{closeOnClick:true}}>
{links}
</SideNav>
<div className="responsive-large">
<Link className="brand-logo" to='/'>
<img alt='Logo do SMPPIR' id={'portal-logo'} src={logoSMPPIR} style={{ width: 200, marginLeft: 20, marginTop: 15 }} />
</Link>
<ul className="right">{links}</ul>
</div>
<div className="responsive-small">
<Link className="brand-logo center" to='/'>
<img alt='Logo do SMPPIR' id={'portal-logo'} src={logoSMPPIR} style={{ width: 200, marginLeft: 20, marginTop: 15 }} />
</Link>
<div className="left">
<SideNav className={`${contrastString}navBackground`} trigger={<a href=""><i className={`material-icons ${contrastString}navIcon`} style={{ marginLeft: 20 }}>menu</i></a>} options={{closeOnClick:true}}>
{links}
</SideNav>
</div>
</div>
</div>
</nav>
)
......
......@@ -58,6 +58,13 @@ class Table extends Component {
this.loadExtraHeader = this.loadExtraHeader.bind(this);
}
componentDidMount() {
var data = this.loadBody();
var header = this.loadHeader();
if (data) this.setState({ data: data });
if (header) this.setState({ headers: header });
}
componentDidUpdate(prevProps) {
if(this.props !== prevProps) {
var data = this.loadBody();
......@@ -67,7 +74,7 @@ class Table extends Component {
}
prevProps = null;
}
render() {
return (
<div className={this.props.divClasses}>
......
src/Images/Brasil.png

11.5 KB | W: | H:

src/Images/Brasil.png

28.3 KB | W: | H:

src/Images/Brasil.png
src/Images/Brasil.png
src/Images/Brasil.png
src/Images/Brasil.png
  • 2-up
  • Swipe
  • Onion skin
src/Images/MinisterioDaMulher.png

7.64 KB | W: | H:

src/Images/MinisterioDaMulher.png

19.1 KB | W: | H:

src/Images/MinisterioDaMulher.png
src/Images/MinisterioDaMulher.png
src/Images/MinisterioDaMulher.png
src/Images/MinisterioDaMulher.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -24,6 +24,7 @@ import MainCard from './Components/MainCard'
import { Col, Row } from 'react-materialize'
import './Styles/MainPage.css'
import { Store } from './Store'
/**
* Main page of the application, contains the cards with information and links for the sub pages. <br />
*/
......@@ -52,7 +53,7 @@ function MainPage() {
</Row>
<Row className={'mainPageRow'}>
<Col m={12} l={5} offset={'l1'}>
<MainCard color='mainPageOrange' title='Povos Ciganos' subpages={subpages3} text={text3} image={'mapas.png'}/>
<MainCard color='mainPageYellow' title='Povos Ciganos' subpages={subpages3} text={text3} image={'ciganos.png'}/>
</Col>
<Col m={12} l={5} className={'mainPageMargin'}>
<MainCard color='mainPageDarkBlue' title='Comunidades de Matriz Africana e Povos de Terreiro' subpages={subpages4} text={text4} image={'matriz_africana4.png'} />
......@@ -111,8 +112,8 @@ const text6 = <div>
// Subpages is an Array of arrays that in the first position expects the title and in the second position the route
const subpages1 = {'route': '/quilombolas', 'links':['EIXO 1', 'EIXO 2', 'EIXO 3', 'EIXO 4', 'SOBRE']}
const subpages2 = {'route': '/juventude', 'links':['VULNERABILIDADES', 'EDUCAÇÃO', 'TRABALHO']}
const subpages3 = {'route': '/ciganos', 'links':["DIREITOS", "CULTURA", "SUSTENTABILIDADE"]}
const subpages4 = {'route': '/matrizAfricana', 'links':["DIREITOS", "CULTURA", "SUSTENTABILIDADE"]}
const subpages3 = {'route': '/ciganos', 'links':["POVOS CIGANOS"]}
const subpages4 = {'route': '/matrizAfricana', 'links':["MATRIZ AFRICANA"]}
const subpages5 = {'route': '/cotas', 'links':['EVASÃO', 'CONCLUINTES', 'ESCOLARIDADE', 'FIES', 'PROUNI', 'FINANCIAMENTO', 'ATIVIDADE EXTRACURRICULAR', 'INGRESSO', 'APOIO SOCIAL', 'VAGAS OFERTADAS']}
const subpages6 = {route: 'participantesSinapir', 'links':['ESTADOS E MUNICÍPIOS PARTICIPANTES', 'CONVÊNIOS EM EXECUÇÃO']}
......
......@@ -29,7 +29,7 @@ a {
}
.footer{
margin: 10px;
margin-top: 10px;
}
/* Contrast rules */
......
......@@ -20,19 +20,19 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
.mainPageOrangeTab{
background-color: #ea7c27;
.mainPageYellowTab{
background-color: #bf9e0f;
}
.mainPageOrangeTab > li.tab > a{
.mainPageYellowTab > li.tab > a{
color: white;
}
.mainPageOrangeTab > li.tab > a.active{
.mainPageYellowTab > li.tab > a.active{
color: white;
}
.mainPageOrangeTab > li.tab > a:hover{
.mainPageYellowTab > li.tab > a:hover{
color: white;
}
......@@ -46,19 +46,19 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
/* Contrast Colors */
.ContrastmainPageOrangeTab{
.ContrastmainPageYellowTab{
background-color: black;
border: 1px solid white;
}
.ContrastmainPageOrangeTab > li.tab > a{
.ContrastmainPageYellowTab > li.tab > a{
color: yellow;
}
.ContrastmainPageOrangeTab > li.tab > a.active{
.ContrastmainPageYellowTab > li.tab > a.active{
color: white;
}
.ContrastmainPageOrangeTab > li.tab > a:hover{
.ContrastmainPageYellowTab > li.tab > a:hover{
color: yellow;
}
}
\ No newline at end of file
......@@ -29,6 +29,9 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
.mainPageOrange{
color: #ea7c27;
}
.mainPageYellow{
color: #bf9e0f;
}
.mainPageContrast{
color: yellow;
......@@ -78,6 +81,7 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
.card-MainPage{
display:flex;
flex-direction: column;
width:100%;
}
.card-MainPage > .card-content {
flex-direction: column;
......
......@@ -18,7 +18,20 @@ You should have received a copy of the GNU General Public License
along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
*/
.responsive-large {
display: none;
}
.responsive-small {
display: block;
}
@media only screen and (min-width: 1250px) {
.responsive-large {
display: block;
}
.responsive-small {
display: none;
}
}
ul.z-depth-2{
box-shadow: none;
......@@ -83,7 +96,7 @@ nav a{
font-weight: bold;
}
#navBarCiganos.ciganos > a{
color:#ea7c27;
color:#bf9e0f;
font-weight: bold;
}
#navBarSinapir.participantesSinapir > a{
......
......@@ -22,12 +22,17 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
.scrolltable{
display: block;
height: 100%;
width: 100%;
overflow: auto;
overflow-x: scroll;
height: 450px;
max-height: 550px;
/* margin: 0px 0px;
padding: 0px 0px; */
/* overflow-x: scroll; */
}
.smallCells td, th{
padding: 0px 0px;
margin: 0px 0px;
}
@media only screen and (max-width: 900px ) {
......
This diff is collapsed.
......@@ -148,9 +148,11 @@ class AgreementsInExecution extends Component {
<Col l={3} m={5} s={8}>
<h4 className={`${contrastString}eixoHeader`}>Convênios em Execução</h4>
</Col>
<Col l={5} m={8} s={8}>
<p className={`${contrastString}eixoSubHeader`}> Clique sobre qualquer estado no mapa para apresentar os
dados somente daquele estado. </p>
<Col l={9} m={7} s={12}>
<br/>
<p className={`${contrastString}eixoSubHeader`}> Clique
sobre qualquer estado no mapa para apresentar os dados
somente daquele estado. </p>
</Col>
</Row>
<Row>
......
This diff is collapsed.
......@@ -239,7 +239,7 @@ class Eixo1 extends Component {
) : (
<UfBar img={MapMarker} ufname={getStateExtendedName(this.state.clickedInMap).currentState} val="Sem informação" />
)}
<CardFooter source="Fundação Cultural Palmares / MinC (Jan, 2016)" />
<CardFooter source=" Fundação Cultural Palmares / MinC (Jan, 2016)" />
</Card>
<Card id="e1pannel-2" className={`${contrastString}pannel hoverable`} title="Evoluções de Certificações e Regularizações">
......@@ -252,7 +252,7 @@ class Eixo1 extends Component {
<BuildLineNotFixed data={nullInfo} customKeys={nullKeys} dataKey="Ano" />
)}
<CardFooter source="Comitê Gestor do Programa Brasil Quilombola, Fundação Cultural Palmares e INCRA (Jan, 2016)" />
<CardFooter source=" Comitê Gestor do Programa Brasil Quilombola, Fundação Cultural Palmares e INCRA (Jan, 2016)" />
</Card>
<Card id="e1pannel-3" className={`${contrastString}pannel hoverable`} title="Lista de Comunidades Reconhecidas Oficialmente pelo estado">
......@@ -264,7 +264,7 @@ class Eixo1 extends Component {
onClick={this.openModal}
/>
<CardFooter source="Comitê Gestor do Programa Brasil Quilombola, Fundação Cultural Palmares / MinC e INCRA (Jan, 2016)" />
<CardFooter source=" Comitê Gestor do Programa Brasil Quilombola, Fundação Cultural Palmares / MinC e INCRA (Jan, 2016)" />
</Card>
<Card id="e1pannel-4" className={`${contrastString}pannel hoverable`} title="Estágio dos processos">
......@@ -275,7 +275,7 @@ class Eixo1 extends Component {
<BuildPie data={nullInfo} dataKey="valor" nameKey="tipo" />
)}
<CardFooter source="INCRA (Jan, 2016)" />
<CardFooter source=" INCRA (Jan, 2016)" />
</Card>
</div>
</div>
......
......@@ -45,7 +45,15 @@ import './Styles/Eixo2.css'
const serverURL = getServerURL();
const type = "eixo_2";
const homeLighting ={
const queries = {
'Número de famílias': 'eixo_2?dims=year',
'Forma de abastecimento de água': 'eixo_2?dims=cod_home_watter_supply,year',
'Forma de iluminação - Famílias': 'eixo_2?dims=cod_home_lighting,year',
'Tipos de escoamento sanitário': 'eixo_2?dims=cod_sanitary_dump,year',
'Destino do lixo': 'eixo_2?dims=cod_home_trash_destiny,year',
}
const homeLighting = {
'1': 'Elétrica com medidor próprio',
'2': 'Elétrica com medidor comunitário',
'3': 'Elétrica sem medidor',
......@@ -124,10 +132,10 @@ class Eixo2 extends Component {
const uf = getStateExtendedName(this.state.clickedInMap).currentState;
const c = [
this.state.charts["Número de famílias"],
organizeJson(this.state.charts["Forma de abastecimento de água"], "cod_abaste_agua_domic_fam", "ano_pesquisa"),
organizeJson(this.state.charts["Tipos de escoamento sanitário"], "cod_escoa_sanitario_domic_fam", "ano_pesquisa"),
organizeJson(this.state.charts["Forma de iluminação - Famílias"], "cod_iluminacao_domic_fam", "ano_pesquisa"),
organizeJson(this.state.charts["Destino do lixo"], "cod_destino_lixo_domic_fam", "ano_pesquisa"),
this.state.charts["Forma de abastecimento de água"],
this.state.charts["Tipos de escoamento sanitário"],
this.state.charts["Forma de iluminação - Famílias"],
this.state.charts["Destino do lixo"],
];
return (
<div>
......@@ -154,7 +162,10 @@ class Eixo2 extends Component {
):(
<UfBar img={family} ufname={uf} val="Sem informação"/>
)}
<CardFooter source=" Cadastro Único para Programas Sociais (CadÚnico)" />
<CardFooter
data={serverURL + queries['Número de famílias']+',uf&format=csv'}
source = " Cadastro Único para Programas Sociais (CadÚnico)"
/>
</Row>
</Card>
......@@ -170,7 +181,10 @@ class Eixo2 extends Component {
/>
</div>
<Loading />
<CardFooter source=" Cadastro Único para Programas Sociais (CadÚnico)" />
<CardFooter
data={serverURL + queries['Forma de abastecimento de água'] + ',uf&format=csv'}
source=" Cadastro Único para Programas Sociais (CadÚnico)"
/>
</Row>
<Row>
<GrayBar text="Tipos de escoamento sanitário" />
......@@ -183,7 +197,10 @@ class Eixo2 extends Component {
/>
</div>
<Loading />
<CardFooter source=" Cadastro Único para Programas Sociais (CadÚnico)" />
<CardFooter
data={serverURL + queries['Tipos de escoamento sanitário'] + ',uf&format=csv'}
source=" Cadastro Único para Programas Sociais (CadÚnico)"
/>
</Row>
</Card>
......@@ -199,7 +216,10 @@ class Eixo2 extends Component {
/>
</div>
<Loading />
<CardFooter source=" Cadastro Único para Programas Sociais (CadÚnico)" />
<CardFooter
data={serverURL + queries['Forma de iluminação - Famílias'] + ',uf&format=csv'}
source=" Cadastro Único para Programas Sociais (CadÚnico)"
/>
</Row>
<Row>
<GrayBar text="Destino do lixo" />
......@@ -212,7 +232,10 @@ class Eixo2 extends Component {
/>
</div>
<Loading />
<CardFooter source=" Cadastro Único para Programas Sociais (CadÚnico)" />
<CardFooter
data={serverURL + queries['Destino do lixo'] + ',uf&format=csv'}
source=" Cadastro Único para Programas Sociais (CadÚnico)"
/>
</Row>
</Card>
......@@ -229,8 +252,8 @@ class Eixo2 extends Component {
}
axios.get(`${serverURL}${defaultData}`)
.then(res => {
const requestData = res.data.result
chart = chart.trim()
const requestData = this.organizeData(chart, res.data.result);
this.setState(prevState => {
let prev = { ...prevState.charts };
prev[chart] = requestData;
......@@ -251,28 +274,26 @@ class Eixo2 extends Component {
});
}
createRoute(header, uf) {
var route;
let head = header.trim()
switch (head) {
case 'Forma de iluminação - Famílias':
route = type + "?dims=cod_home_lighting,year"
break;
case 'Destino do lixo':
route = type + "?dims=cod_home_trash_destiny,year"
break;
case 'Forma de abastecimento de água':
route = type + "?dims=cod_home_watter_supply,year"
break;
case 'Tipos de escoamento sanitário':
route = type + "?dims=cod_sanitary_dump,year<