Skip to content

Commit

Permalink
Release 2024-04-16 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut authored Apr 16, 2024
2 parents 8fd0efb + 3de2730 commit 7d94fb0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
24 changes: 21 additions & 3 deletions src/components/PageHome/data/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Data documentation - data for survey result charts on /beteiligung
# Data documentation - data for survey result charts and XLSX on /beteiligung

We manually copy the survey data from Trassenscout

## Data update
## Data update diagrams

1. Open [trassenscout.de](trassenscout.de/rs8/surveys/1)

Expand All @@ -20,4 +20,22 @@ OR

_only users with status ADMIN can copy data_

- replace the data hold by surveyResultData in src/components/PageHome/data/survey-result-data.ts
- replace the data hold by surveyResultDataCharts in src/components/PageHome/data/survey-result-data.ts

## Data update XLSX

1. Open [trassenscout.de](trassenscout.de/rs8/surveys/1)

OR

1. run TS locally
2. get data from production db:

- `npm run db:getDump`
- `npm run db:restoreDump`

3. navigate to /rs8/surveys/1

- Find buttons at the bottom of the page to download CSVs
- manually export an xlsx file with three sheets (each CSV)
- replace the file in public dir
2 changes: 1 addition & 1 deletion src/components/PageHome/data/survey-result-data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const surveyResultData = [
export const surveyResultDataCharts = [
{
questionLabel: 'Würden Sie den RS 8 nutzen?',
data: [
Expand Down
22 changes: 20 additions & 2 deletions src/pages/beteiligung.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import React from 'react'
import { FundingFooter } from '~/components/Funding'
import { ImageSlide } from '~/components/Images'
import { Layout, Section } from '~/components/Layout'
import { LinkExternal, buttonStyles } from '~/components/Link'
import { MetaTags } from '~/components/MetaTags/MetaTags'
import { BarChart } from '~/components/PageHome/BarChart'
import { surveyResultData } from '~/components/PageHome/data/survey-result-data'
import { surveyResultDataCharts } from '~/components/PageHome/data/survey-result-data'
import { H2, HeadingContentPage, P } from '~/components/Text'

export const Head = () => (
Expand Down Expand Up @@ -49,7 +50,7 @@ const IndexPage: React.FC<PageProps> = ({ location }) => {
<Section>
<H2>Ergebnisse der Umfrage (482 Teilnahmen)</H2>
<div className="space-y-4">
{surveyResultData.map((r) => (
{surveyResultDataCharts.map((r) => (
<div key={r.questionLabel} className="border rounded pt-2 pb-3.5">
<P className="border-b pb-2 px-3.5 font-bold">
{r.questionLabel}
Expand All @@ -60,6 +61,23 @@ const IndexPage: React.FC<PageProps> = ({ location }) => {
</div>
))}
</div>
<H2>Rohdaten der Beteiligung herunterladen</H2>
<P>
Daten stehen als Open Data unter der{' '}
<LinkExternal href="https://opendatacommons.org/licenses/odbl/">
ODbL
</LinkExternal>{' '}
Lizenz zur weiteren Auswertung zur Verfügung.
</P>
<a
href="/survey-results.xlsx"
download={`Export-RS8-Beteiligungsergebnisse-${new Date().toLocaleDateString(
'de-DE',
)}.xlsx`}
className={buttonStyles}
>
XLSX herunterladen
</a>
</Section>

<Section className="mb-40">
Expand Down
Binary file added static/survey-results.xlsx
Binary file not shown.

0 comments on commit 7d94fb0

Please sign in to comment.