Contrôleurs de l’application ReactJS

Analysis

class Analysis(callback, region, regionCode, failCallback)

This component retrieves data relating to the DB and transforms it into functions that can be called in other components. This module therefore makes the link to the API via the Component:ref:Api For exemple : this.props.parentApi.controller.analysisManager.getLegendTitles(id_indicateur) is a function called in Legend.js to get legend titles.

Analysis.fetchData(id, zone, zoneId, callback, reload, filters, provenance, idUtilisateur, filtre, reinitialiserFiltres, selectedYear=false)

Call the API to retrieve data for a specific analysis, a zone, a year and filters.

Arguments
  • id (integer()) – the analysis Id

  • zone (object()) – contains two values associated to zone and maille keys

  • zoneId (string()) – current zone ID (e.g., « 84 », « 06018 », « FR8000019 »)

  • callback (callable()) – function called after retrieving if data or if data already present

  • reload (boolean()) – forces reloading even if data already present

  • filters (object()) – contains categories filters grouped by category name.

  • provenance (string()) – where the data retrieval is triggered from

  • idUtilisateur (integer()) – user id from SuiviConsultations class

  • filtre (string()) – when values can be filtered (e.g., distance) will contain one or two values (separated by comma)

  • reinitialiserFiltres (boolean()) – decide whether to reset filters or not in backend call

  • selectedYear (integer()) – the year selected for values

Analysis.getAnalysisEstimatedYears(id)

Return analysis’s estimated years

Analysis.getAnalysisLastYear(id)

Return analysis’s year

Analysis.getAnalysisMethodoPdf(id)

Return analysis’s methodology’s pdf name

Analysis.getAnalysisNameTheme(id)

Return analysis’s theme

Analysis.getAnalysisRepresentationDetails(id)

Return analysis’s details

Analysis.getAnalysisYears(id)

Return analysis’s years

Analysis.getCategories(id)

Returns the list of categories for an indicator

Arguments
  • id (entier()) – : Unique identifier of the indicator for which we want to know the available charts

Analysis.getDataChart(id, idChart)

This function is used to retrieve data for a particular chart (data are already fetch by the map)

Arguments
  • id (string()) – : indicator identifier

  • idChart (string()) – : chart identifier (nom_indicateur + categorie)

Renvoie

json – : the data for the chart and the metadata for the analysis

Analysis.getDataMap(id)

Get data (data are already fetch)

Analysis.getDetailsOnTrajectory(trajectoryId)

Retrieve the list of PCAET trajectories

Analysis.getDisabledMacroLevels(id)

Returns the value of the disabled_for_macro_level column which indicates if the indicator is disabled at certain macro levels.

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getDisabledZones(id)

Returns the value of the disabled_for_zone column which indicates if the indicator is not available on some territories and if so which ones

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getFilterDefaultValue(id)

Returns the default filter value for indicators for which certain values can be filtered (ex : migrations pendulaires, Distance domicile - travail).

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getFullCategoriesValues(id, category)

Returns a list of filters based on an indicator’s ID.

Analysis.getLegendTitles(id)

Returns legend titles (two legends if the indicator allows the combination of two representations)

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getListeTables()

Returns the list of tables used to calculate an indicator

Analysis.getOnlyForZones(id)

Returns the value of the only_for_zone column which indicates if the indicator is only available on some territories and if so which ones

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getPCAETTrajectories()

Retrieve the list of PCAET trajectories

Analysis.getProportionForCircleDisplay(id)

Returns the value of the afficher_proportion column

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getTitle(id)

Returns the value of the title column (only works if the indicator allows the combination of two representations)

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.getUnit(unitId)

Get unique unit from ID

Analysis.getUnitParamsForIndicator(currentAnalysisSelectedUnit, meta, currentZoneMaille)

Compute units parameters associated to indicator with specific maille

Analysis.getUnitsByIds(idsList)

Get associated units from IDs list

Analysis.getUnitsForAnalysis(id)

Return analysis’s theme

Analysis.initFiltersByCategory(id)

Returns a key-value object constructed as follows: {

identifiant indicateur + categorie1 : [{« filtre_categorie »: modalité1}, …, {« filtre_categorie »: modalitén}]} identifiant indicateur + categorie2 : [{« filtre_categorie »: modalité1}, …, {« filtre_categorie »: modalitén}]}

} At initialization, it gathers all the categories and modalities formatted according to the API requirements to define the filters in the SQL queries

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.isActive(id)

Returns the value of the active column which indicates if the indicator is enabled.

Arguments
  • id (entier()) – : Unique identifier of the indicator

Analysis.isDisabledInDashboard(id)

Return analysis’s theme

Analysis.obtenirRepresentationsPossibles(id)

Returns the list of possible representations for an indicator from the data transmitted by the API

Arguments
  • id (entier()) – : Unique identifier of the indicator

Api

class Api()

Function to make the link with the API of Terristory

DashboardService

class DashboardService(callback, region, regionCode, territoryType, territoryIDCode, wasEditing)

This component display the dashboards list that are available, either because owned by current user, or because they have been published by the owner at current geographical level.

DashboardService.applyBottomMargin(elemHtml, diagramme)

Add classes to a list of large enough (150 offset) children of current HTML element.

Arguments
  • diagramme (string()) – the optional additionnal class to add

DashboardService.refreshDashboardLists(territoryType, territoryIDCode)

Retrieve all public dashboards for this specific territory

Arguments
  • territoryType (string()) – the territory type (region, etc.)

  • territoryIDCode (string()) – the INSEE id for this territory

DashboardService.retrieveMyDashboardsList(callback)

Retrieves the list of current user dashboards

Arguments
  • callback (callable()) – the function to call after API query succeeded

DashboardService.retrievePublicDashboardList(callback)

Retrieves all public dashboards available at current geographical level.

Arguments
  • callback (callable()) – the function to call after API query succeeded

DashboardService.setEditingModeDashboard(wasEditing)

Change wasEditing value.

Arguments
  • wasEditing (boolean()) – the new value

Equipements

class Equipements(callback, region)

This component is used to manage poi layers

Print

class Print()

This component is used to print the cartographic interface of the application (the map)

Referencement

Settings

class Settings(callback)

This component is used to get the configurations of all regions form the regions configuration table.

Settings.fetchConfiguration(callback)

Calls the API to get the list of available regions.

Arguments
  • callback (callable()) – function called at the end of the treatment of available regions.

style

class style()

Style object gathering all possible styles available for map styling.

SuiviConsultations

class SuiviConsultations(callback, regionCode, region)

This component is used to tracks user visits by associating them with an ID.

SuiviConsultations.obtenirIdUtilisateur(callback)

This function assigns an identifier to the person browsing the site. This incremental identifier is updated with each new access to the user’s platform.

Zones

class Zones(callback, region)

This component is used to manage th selection of a geographical zone

Zones.zonesInNewFormat
Ex: {
region: { label: « Région », mailles: {

departement: {label: « département »}, epci: {label: « EPCI »}

}

}

Zones.fetchConfiguration()

Retreive zones configuration from API and store available zone types into this.zones.

Zones.fetchZones()

Fetches the data (code, geometry…) for the all the zones defined in this.zones except for zone « commune »

Zones.getZoneList(zone)

Return the list of zones for a specified scale

Arguments
  • zone (string|Object()) –

Renvoie