GithubHelp home page GithubHelp logo

trynmaps / opentransit-map Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 15.0 7.84 MB

Web-app for OpenTransit

Home Page: http://opentransit.city

License: Apache License 2.0

HTML 1.46% CSS 4.00% JavaScript 94.07% Dockerfile 0.47%

opentransit-map's People

Contributors

akeimach avatar akgupta89 avatar alessandro-pianetta avatar ckrajewski avatar dependabot[bot] avatar eddyionescu avatar enginaryum avatar fruit13ok avatar hathix avatar jimleeisme avatar komali2 avatar lukemccrae avatar roshkins avatar sgoel avatar sravanti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

opentransit-map's Issues

K/T line vehicles not displaying

  • only affects the K/T route
  • probably because the API lists the K/T as KT but the web-app tries to get K/T instead from the routes map that is returned

Develop locally without requiring local backend

This makes onboarding new members a lot easier as they won't have to set up the entire backend.

This will work by using the Prod API (already publicly accessible) instead of the local endpoint by default. This means that it'll be set to Prod by default.

show route number in side dashboard when route is clicked

Removed the good first issue tag from this because it seemed relatively complicated (unsure of whether deck.gl components support this) and unnecessary (I don't think that all map elements have to be interactive - a well-designed control panel should be enough).

Endless websocket errors

See #58 for more issues related to the same bit of code.

Whatever relay is, it's filling the console with websocket errors, such as:

index.js:970 WebSocket connection to 'ws://localhost:8734/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

colour different route segments differently

As part of visualizing speed, route segments (where a segment is from one stop to the next) should be coloured - in red/yellow/green similar to how you'd see it on Google Maps.

Notes:

  • stops and routes are currently displayed using the Muni GeoJson file. For geographical stuff, the Turf.Js is pretty solid (it's being used the the API)
  • the API doesn't return any speed-related data, so just make a random number for the speed
  • also adding a toggle for whether to visualize speed would also be useful

Hovering over datetimepicker highlights both buttons

I added a border override for the datetimepicker component in the css file, but both buttons highlight when you hover over one.

There needs to be an override for css hovering and make the buttons hover over seperately

add a live mode to the map

  • add a toggle for "live"
  • when toggled, it'll automatically update the date/time every 15 seconds, which will trigger a map update
  • we could use Relay subscriptions for this, which would also involve making changes to the API as to send events. Just adding a timer and refetching everything will be a lot easier and can be improved in the future.

show message for when api returns no buses

it's possible to choose a time for which we don't have any data - the client has no way of knowing if that's the case in advance though.

What the API does now: returns an empty list of buses
What the client does now: nothing (ie. renders the empty list of buses)
What the client should do: same as now - but show an error message (either a pop-up or in a red-textfield in the Time section)

add dropdown to choose different cities

Currently OpenTransit only works for San Francisco. We want to add support for other cities, starting with Toronto. This ticket is making a dropdown for choosing a city. It should be placed above the routes list and below the toggles.

select one stop or two stops on the same route

Selecting a stop will be needed in order to show reliability data for that stop - while selecting two would be needed for showing travel-times/speeds/reliability within that segment.
The flow could work like this:

  1. selecting a stop selects it
  2. selecting another stop on the same route (edit 5/16/18: and direction) creates a segment of the route
  3. selecting any other stop will make that stop alone selected -> go to step 1

Part 1: Print out to console.log the selected stop IDs (either 0, 1, or 2 can be printed out)
Part 2: Make selected stops a different colour (or icon)
Part 3: Get the subsection of the route (if two stops are selected)
Part 4: Draw that subsection (if two stops are selected)

Let's have a PR for each part and merge before moving onto the next one. Also gave this the "mini-project" tag (think of it as a "Story" in JIRA :)

converting from bootstrap to material-ui

Is there a reason why we use bootstrap instead of something like Material-UI?

Bootstrap is dependent on jQuery for certain functionality which doesn't play nice with React. Using Material-UI seems like a more modern UI approach, and it uses the same grid system. We're also not heavily reliant on Bootstrap yet, so it seems switching would seem relatively painless.

Just a discussion, curious how everyone feels on it.

upgrade to react 16 and latest deck.gl+map.gl versions

Since first making this repo, React got a huge upgrade to 16, while deck.gl had multiple major releases. Same for Relay and GraphQL. Based on projects I started more recently, our map should lag a lot less. That said, I tried upgrading a few months ago and the zoom button broke. Still, we should update our packages. This PR tracks updating all packages such that the web-app will stay stable.

sort routes in sidebar

  • right now there's no sorting - it's shown in the same order as defined in the GeoJSON
  • they should be sorted like this:

C
E
F
J
K
L
M
N
PH
PM
T

1
...
14
14R
14X
...

replace blue markers with an actual bus facing in the appropriate direction

[ideas/details added 3/1/18]
I'm unsure of how we'd represent northbound/southbound - in other transit maps all either buses look the same (Transit) or use really ugly images (Nextbus). I was thinking of using this image I made for a project last year (https://www.facebook.com/transibot/photos/a.632218450301186.1073741826.631950076994690/639876799535351/?type=1&theater) and rotating the "antenna" around the bus as to suggest its direction. Using its SVG we could also colour it according to the route.

make control panel visible/hidden

Try using OpenTransit on your phone in portrait mode (landscape currently works semi-decently). In order to make our site mobile-friendly (or at least not anti-mobile), the control panel shouldn't cover the entire map.

The easiest way to do this that'll work for all types of mobile screens is likely to hide the control panel. This ticket tracks adding a border/vertical button to the control panel that when tapped shows/hides the screen.

Invalid prop type applied to Map component (plus several others)

There are one, or possibly three, bugs regarding how the App is initialized and sets up the Map component.

The code:

App.jsx

  loadRelay() {
    return (
      <QueryRenderer
        environment={this.state.environment}
        query={graphql`
            query AppAllVehiclesQuery($agency: String!, $startTime: String!, $endTime: String!) {
              ...Map_trynState
            }
          `}
        variables={{
          agency: 'muni',
          startTime: Date.now() - 15000,
          endTime: Date.now(),
        }}
        render={({ error, props }) => {
          if (error) {
            return <div>{error.message}</div>;
          } else if (props) {
            return (
              <Map trynState={props} />
            );
          }
          return <div>Loading</div>;
        }}
      />
    );
  }

This issue is about how the {props} variable passed to <Map> is bad somehow. Error is in browser:

index.js:2177 Warning: Failed prop type: Invalid prop `relay` of type `object` supplied to `Map`, expected a single ReactElement.
    in Map (created by Relay(Map))
    in Relay(Map) (at App.jsx:49)
    in ReactRelayQueryRenderer (at App.jsx:32)
    in div (at App.jsx:60)
    in App (at index.jsx:10)

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.