Your province

Part of the Tourism

Province code (e.g. `BO`, `MI`, `TO`, `NA`, `VE`).

▶ Use this app

data space «turismo» — this micro app reads and writes the suite’s shared data space.

What it records

  • Province code

The other micro apps in the same suite

How it works

This is a Reactive app: a plain text document that your browser turns into a working app — forms, live data, tables, statistics and even charts, with nothing to install or configure.

  1. Use it right away. Hit “Use this app”: it opens right in your browser, ready to go, with data saved only on your device.
  2. Your data stays yours. Everything is stored locally on your device, kept separate for each app: no account, no server, nothing to set up.
  3. Make it your own. The text below is the entire app: copy it, tweak fields, views and words, and your changes become interactive instantly.
  4. Share it as a file. An app is a simple file: save it, export it or share it with a link; and with encrypted collaboration several people edit the same data in real time.
The app’s source
# 📈 Your province

## The trend in your province

Province code (e.g. `BO`, `MI`, `TO`, `NA`, `VE`).

::input[prov]{value="VE" placeholder="Province code"}

::od-query{into="trend" sql="SELECT anno AS anno, arrivi AS arrivi, presenze AS presenze FROM turismo WHERE sigla = '{#prov}' ORDER BY anno"}

::chart-line{data="trend" x="anno" y="arrivi,presenze" height="16rem"}

### And the coming years?

A linear trend on **overnight stays** extends the series: move the slider for
the horizon. The first run downloads the compute engine (one time only), then
the forecast updates by itself (the R² in the status says how much of the
series the trend explains).

::range[anni]{min="1" max="5" value="3" legend="Years to forecast"}

::ml-forecast{data="trend" x="anno" y="presenze" horizon="#anni" into="trendPrev"}

::chart-line{data="trendPrev" x="anno" y="presenze,previsione" height="16rem"}

:::table{path="trend" headers="Year,Arrivals,Overnight stays" pagesize="8" search="false"}
{anno} | {arrivi} | {presenze}
:::

**Overnight stays** are nights spent, **arrivals** are registered guests:
their ratio is the average length of stay.