Commit e11cc983 authored by Myriam Begel's avatar Myriam Begel

Fixe l'erreur pour le retour et factorise des variables

parent 6926754c
......@@ -5,18 +5,16 @@ import pandas as pd
import plotly.graph_objs as go
from utils import red, blue, green, grey, orange, brown, purple
from figures import figure_barh, figure_rep_contributeurs, figure_date
from commons import INTERIM_PATH, FIG_PATH, extrema, analyse, back
from textwrap import dedent
from app import app
shortname = 'democratie'
DATA_PATH = '../data/interim/DEMOCRATIE_ET_CITOYENNETE.csv'
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
DATA_PATH = INTERIM_PATH + 'DEMOCRATIE_ET_CITOYENNETE.csv'
pers_dep = pd.read_csv(INTERIM_PATH + shortname + '_personnes_par_departement.csv', index_col=0)
part_q = pd.read_csv(INTERIM_PATH + shortname + '_participation_question.csv', index_col=0).T
analyse = 'Analyse des expressions les plus utilisées'
extrema = pd.read_csv(INTERIM_PATH + 'participation_gens_extrema.csv', index_col=0).loc[shortname]
extrema = extrema.loc[shortname]
# Data
data = pd.read_csv(DATA_PATH, low_memory=False, nrows=1)
......@@ -29,12 +27,7 @@ with open('../figures/%s_contributeurs_per100000.html' % shortname, 'r') as f:
map_contrib_100000 = f.read()
layout = html.Div([
dcc.Link(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50},
title="Retour"
),
back,
html.H3(children='Démocratie et Citoyenneté'),
# Répartition géographique des contributeurs
html.H4('Répartition géographique des contributions'),
......
......@@ -5,13 +5,12 @@ import pandas as pd
import plotly.graph_objs as go
from utils import red, blue, green, grey, orange, brown, purple
from figures import figure_barh, figure_rep_contributeurs, figure_date
from commons import INTERIM_PATH, FIG_PATH, back
from app import app
shortname = 'events'
DATA_PATH = '../data/interim/EVENTS.csv'
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
DATA_PATH = INTERIM_PATH + 'EVENTS.csv'
data = pd.read_csv(DATA_PATH)
total_inv = len(data) - data['departement'].count()
......@@ -23,10 +22,7 @@ with open('../figures/%s_map_per100000.html' % shortname, 'r') as f:
map_contrib_100000 = f.read()
layout = html.Div([
dcc.Link(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50}),
back,
html.H3(children='Débats locaux'),
# Répartition géographique des contributeurs
......
......@@ -5,18 +5,16 @@ import pandas as pd
import plotly.graph_objs as go
from utils import red, blue, green, grey, orange, brown, purple
from figures import figure_barh, figure_rep_contributeurs, figure_date
from commons import INTERIM_PATH, FIG_PATH, extrema, analyse, back
from textwrap import dedent
from app import app
shortname = 'fiscalite'
DATA_PATH = '../data/interim/LA_FISCALITE_ET_LES_DEPENSES_PUBLIQUES.csv'
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
DATA_PATH = INTERIM_PATH + 'LA_FISCALITE_ET_LES_DEPENSES_PUBLIQUES.csv'
pers_dep = pd.read_csv(INTERIM_PATH + shortname + '_personnes_par_departement.csv', index_col=0)
part_q = pd.read_csv(INTERIM_PATH + shortname + '_participation_question.csv', index_col=0).T
extrema = pd.read_csv(INTERIM_PATH + 'participation_gens_extrema.csv', index_col=0).loc[shortname]
analyse = 'Analyse des expressions les plus utilisées'
extrema = extrema.loc[shortname]
# Data
......@@ -32,10 +30,7 @@ with open('../figures/%s_contributeurs_per100000.html' % shortname, 'r') as f:
map_contrib_100000 = f.read()
layout = html.Div([
dcc.Link(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50}),
back,
html.H3(children='La fiscalité et les dépenses publiques'),
# Répartition géographique des contributeurs
......
......@@ -6,18 +6,16 @@ import pandas as pd
import plotly.graph_objs as go
from utils import red, blue, green, grey, orange, brown, purple
from figures import figure_barh, figure_rep_contributeurs, figure_date
from commons import INTERIM_PATH, FIG_PATH, extrema, analyse, back
from textwrap import dedent
from app import app
shortname = 'organisation'
DATA_PATH = '../data/interim/ORGANISATION_DE_LETAT_ET_DES_SERVICES_PUBLICS.csv'
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
DATA_PATH = INTERIM_PATH + 'ORGANISATION_DE_LETAT_ET_DES_SERVICES_PUBLICS.csv'
pers_dep = pd.read_csv(INTERIM_PATH + shortname + '_personnes_par_departement.csv', index_col=0)
part_q = pd.read_csv(INTERIM_PATH + shortname + '_participation_question.csv', index_col=0).T
extrema = pd.read_csv(INTERIM_PATH + 'participation_gens_extrema.csv', index_col=0).loc[shortname]
analyse = 'Analyse des expressions les plus utilisées'
extrema = extrema.loc[shortname]
# Data
data = pd.read_csv(DATA_PATH, low_memory=False, nrows=1)
......@@ -36,10 +34,7 @@ with open('../figures/%s_Q204_map.html' % shortname, 'r') as f:
map_q204 = f.read()
layout = html.Div([
dcc.Link(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50}),
back,
html.H3(children='Organisation de l\'État et des services publiques'),
# Répartition géographique des contributeurs
......
......@@ -6,18 +6,16 @@ import pandas as pd
import plotly.graph_objs as go
from utils import red, blue, green, grey, orange, brown, purple
from figures import figure_barh, figure_rep_contributeurs, figure_date
from commons import INTERIM_PATH, FIG_PATH, extrema, analyse, back
from textwrap import dedent
from app import app
shortname = 'transition'
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
DATA_PATH = INTERIM_PATH + 'LA_TRANSITION_ECOLOGIQUE.csv'
pers_dep = pd.read_csv(INTERIM_PATH + shortname + '_personnes_par_departement.csv', index_col=0)
part_q = pd.read_csv(INTERIM_PATH + shortname + '_participation_question.csv', index_col=0).T
extrema = pd.read_csv(INTERIM_PATH + 'participation_gens_extrema.csv', index_col=0).loc[shortname]
analyse = 'Analyse des expressions les plus utilisées'
extrema = extrema.loc[shortname]
# Data
data = pd.read_csv(DATA_PATH, low_memory=False, nrows=1)
......@@ -36,10 +34,7 @@ with open('../figures/transition_q154_map.html', 'r') as f:
map_q154 = f.read()
layout = html.Div([
dcc.Link(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50}),
back,
html.H3(children='La transition écologique'),
# Répartition géographique des contributeurs
......
import pandas as pd
import dash_html_components as html
INTERIM_PATH = '../data/interim/'
FIG_PATH = '../figures/'
extrema = pd.read_csv(INTERIM_PATH + 'participation_gens_extrema.csv', index_col=0)
analyse = 'Analyse des expressions les plus utilisées'
back = html.A(
children=html.I(className='fa fa-angle-left h1'),
href='/grand-debat/',
style={'position': 'fixed', 'left': 50, 'top': 50},
title="Retour"
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment