Coder Social home page Coder Social logo

lodjs's Introduction

lodjs

Semplice helper per recuperare le variabili censuarie da http://datiopen.istat.it/variabiliCensuarieCOM.php

Utilizzo

Dipendenze : isomorphic-fetch

Livello aggregazione dati :

0 -> Sezioni di censimento
1 -> Aree di censimento
2 -> Località
3 -> Aree subcomunali

Variabili censuarie

0 -> Popolazione residente
1 -> Popolazine straniera
2 -> Famiglie
3 -> Grado di istruzione
4 -> Condizione professionale
5 -> Pendolarismo
6 -> Alloggi
7 -> Edifici

esempio

const {call, getUrl} = require('./lodjs');
// esempio :  Popolazione straniera suddivisa per località nel comune di roma
const cfg = {
    livello_aggregazione_dati : 2,
    variabili_censuarie : 1,
    location : "Roma"
}
// built in functionality, fetch the data and run a callback
let data = call(cfg,(result)=>{
    console.log(result.headers) // totale residenti e totale query => { totale: 1090239, totale_residenti: 2617175 }
    //console.log(result.payload) // elenco risultati query per livello aggregrazione
})

// custom fetching
let endpoint = getUrl(cfg)
fetch(endpoint).then(response => {
    response.json().then((data) =>{
        console.log(data)
        // do whatever you want with the raw data
    } )
})


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.