Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visualization #83

Merged
merged 5 commits into from
Jun 26, 2023
Merged

Add visualization #83

merged 5 commits into from
Jun 26, 2023

Conversation

PierrickP
Copy link
Collaborator

@PierrickP PierrickP commented Aug 29, 2022

Add a visualization tool to get an overview of the GBFS feed

image

I changed the homepage to have 2 different pages, validation /validator and visualization /visualization.

ℹ️ https://gbfs-validator.netlify.app/?url=XXX will be correctly redirected to /validator

Features

  • Summary of stations / vehicles counts
  • Show a dot for each freefloating vehicles
    • color per form factor
    • popup to get all details (vehicule_type_id / plan_id are expended)
  • Show a dot for each stations
    • color according to the number of vehicles inside
    • popup to get all details (merge of station_informations and station_logs)
  • Show polygons of geofencing zones
  • popup with details

Missing

  • Better colors for geofencing zones according to rules
  • Pricing tables / Simulator

I created a new function to only return content's feed (faster than also validate).

I tested with multiple feeds / versions (not 3.0) but some issues can be still there.
Invalid feed can show nothing or break the page.

⚠️ I used my own Mapbox key (https://github.com/MobilityData/gbfs-validator/pull/83/files#diff-c5580fd8f5f02724fac95dbe8fa01c1ecd4efee526378be9f0b96b1d84704c99R40)
MobilityData can create an account a use their own key (Should be totally free for the number of visitors, but a credit card may be required).
We can switch to another tiles' server.

@netlify
Copy link

netlify bot commented Aug 29, 2022

Deploy Preview for gbfs-validator ready!

Name Link
🔨 Latest commit 632f22f
🔍 Latest deploy log https://app.netlify.com/sites/gbfs-validator/deploys/64941197a4ccc40009a1c659
😎 Deploy Preview https://deploy-preview-83--gbfs-validator.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

tdelmas added a commit to tdelmas/gbfs-validator that referenced this pull request Jun 8, 2023
…ad1e

2b6ad1e FIX: replaces name field with localized string (MobilityData#82)
abe71f2 Fix invalid json, no trailing commas (MobilityData#83)

git-subtree-dir: gbfs-validator/versions/schemas
git-subtree-split: 2b6ad1ec46824413bbf477c556744e99991f814c
@MobilityData MobilityData deleted a comment from netlify bot Jun 9, 2023
@MobilityData MobilityData deleted a comment from netlify bot Jun 9, 2023
@MobilityData MobilityData deleted a comment from netlify bot Jun 9, 2023
@MobilityData MobilityData deleted a comment from netlify bot Jun 9, 2023
@MobilityData MobilityData deleted a comment from netlify bot Jun 9, 2023
@PierrickP PierrickP marked this pull request as ready for review June 9, 2023 15:43
Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

functions/feed.js Show resolved Hide resolved
functions/validator.js Show resolved Hide resolved
@PierrickP
Copy link
Collaborator Author

Hi @davidgamez, on my last commit I added a new function that exposes the openapi schema of the api.
It can be imported into Postman to get the available endpoints with parameters.

image

@davidgamez
Copy link
Member

Hi @davidgamez, on my last commit I added a new function that exposes the openapi schema of the api. It can be imported into Postman to get the available endpoints with parameters.

image

Thanks!

Comment on lines 40 to 41
const MAPBOX_KEY =
'pk.eyJ1IjoicGllcnJpY2twIiwiYSI6ImNsaWluZjl6bDF3emQzZW9iZHZ2NDd5MDMifQ.FCTTnlXknFjxmw9NLemYsQ'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @PierrickP for this amazing contribution!

We set up an environment variable in Netlify to avoid exposing the Mapbox key in the code.

We created three tokens under MobilityData Mapbox account and added to Netlify VITE_MAPBOX_API_KEY per context:

  • PROD
  • STAGING - branch the preview deployment
  • LOCAL - local netlify cli

Please let us know if you agree with this approach. Thank you!

Suggested change
const MAPBOX_KEY =
'pk.eyJ1IjoicGllcnJpY2twIiwiYSI6ImNsaWluZjl6bDF3emQzZW9iZHZ2NDd5MDMifQ.FCTTnlXknFjxmw9NLemYsQ'
const MAPBOX_KEY = import.meta.env.VITE_MAPBOX_API_KEY

cc @davidgamez

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an excellent improvement. Thanks for that. I've stored the Tokens in 1Password, in the Public transit vault.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 i made the changes

@@ -0,0 +1 @@
{"imports":{"netlify:edge":"https://edge.netlify.com/v1/index.ts"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it any reason why we need this file? I think we can delete the file and potentially add .netlify folder to .gitignore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Signed-off-by: Pierrick <mulotmail@gmail.com>
Signed-off-by: Pierrick <mulotmail@gmail.com>
Signed-off-by: Pierrick <mulotmail@gmail.com>
Signed-off-by: Pierrick <mulotmail@gmail.com>
Signed-off-by: Pierrick <mulotmail@gmail.com>
@PierrickP
Copy link
Collaborator Author

I rebased, if everybody is ok, can we merge ?

CONTRIBUTING.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@davidgamez
Copy link
Member

I rebased, if everybody is ok, can we merge ?

Merging now!

@davidgamez davidgamez merged commit 22d1b07 into master Jun 26, 2023
@davidgamez davidgamez deleted the feature/visualization branch June 26, 2023 15:42
tdelmas added a commit to tdelmas/gbfs-validator that referenced this pull request Jun 28, 2023
…058d

22b058d fix: incorrect spec for "languages" property in system_information.json (MobilityData#90)
e9d891b Refer to later versions in gbfs_versions.json (MobilityData#87)
fbd3ced Add v3.0 to v3.0-RC schemas (MobilityData#88)
ef0d9a6 Fix schemas for v3.0-RC (MobilityData#85)
2b6ad1e FIX: replaces name field with localized string (MobilityData#82)
abe71f2 Fix invalid json, no trailing commas (MobilityData#83)
f43170e V3.0-RC Schemas  (MobilityData#79)
680df70 Update pr-to-project.yml
c2c30a2 Typo fix in geofencing_zones.json (MobilityData#78)
c9be765 Create pr-to-project.yml
0a17875 Create issues-to-project.yml
30e5a3a Update README.md

git-subtree-dir: gbfs-validator/versions/schemas
git-subtree-split: 22b058dc4a358baf451e006cde74775075929b3d
richfab pushed a commit that referenced this pull request Jun 29, 2023
* Git ignore for schemas subtree

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Squashed 'gbfs-validator/versions/schemas/' changes from 5273f96..22b058d

22b058d fix: incorrect spec for "languages" property in system_information.json (#90)
e9d891b Refer to later versions in gbfs_versions.json (#87)
fbd3ced Add v3.0 to v3.0-RC schemas (#88)
ef0d9a6 Fix schemas for v3.0-RC (#85)
2b6ad1e FIX: replaces name field with localized string (#82)
abe71f2 Fix invalid json, no trailing commas (#83)
f43170e V3.0-RC Schemas  (#79)
680df70 Update pr-to-project.yml
c2c30a2 Typo fix in geofencing_zones.json (#78)
c9be765 Create pr-to-project.yml
0a17875 Create issues-to-project.yml
30e5a3a Update README.md

git-subtree-dir: gbfs-validator/versions/schemas
git-subtree-split: 22b058dc4a358baf451e006cde74775075929b3d

* remove dot files in schemas

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* v3-RC validation

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Remove unused file

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Add `serverOpts` required in Windows

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Fix typo `recommended`

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* update test for 3.0-RC , 3.0 and upcoming minor versions

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* fix after rebase

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Recommended.

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>

* Squashed 'gbfs-validator/versions/schemas/' changes from 22b058d..5f12243

5f12243 Patch manifest.json (#91)

git-subtree-dir: gbfs-validator/versions/schemas
git-subtree-split: 5f12243d5735a608eef697212a627b9090eea31a

---------

Signed-off-by: Tom <1955774+tdelmas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants