From: Maxious Date: Thu, 21 Apr 2011 04:57:22 +0000 Subject: Bus Stop density heatmap X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=d1324ba9b0f3ae5f60019807e4b21548ca9eae4d --- Bus Stop density heatmap --- --- /dev/null +++ b/aws/awsStartup.sh @@ -1,1 +1,37 @@ +#!/bin/bash +#this script should be run from a fresh git checkout from github +#ami base must have yum install lighttpd-fastcgi, git, tomcat6 +#php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 +#postgres postgres-server php-pg +#http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 +cp /root/aws.php /tmp/ +mkdir /var/www/lib/staticmaplite/cache +chcon -h system_u:object_r:httpd_sys_content_t /var/www +chcon -R -h root:object_r:httpd_sys_content_t /var/www/* +chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache +chmod -R 777 /var/www/lib/staticmaplite/cache +wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ +-O /var/www/cbrfeed.zip + +createdb transitdata +createlang -d transitdata plpgsql +psql -d transitdata -f /var/www/lib/postgis.sql +# curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz +#made with pg_dump transitdata | gzip -c > transitdata.cbrfeed.sql.gz +gunzip /var/www/transitdata.cbrfeed.sql.gz +psql -d transitdata -f /var/www/transitdata.cbrfeed.sql +#createuser transitdata -SDRP +#password transitdata +#psql -d transitdata -c \"GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;\" +php /var/www/updatedb.php + +wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ +-O /tmp/Graph.obj +rm -rfv /usr/share/tomcat6/webapps/opentripplanner* +wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-webapp.war \ +-O /usr/share/tomcat6/webapps/opentripplanner-webapp.war +wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-api-webapp.war \ +-O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war +/etc/init.d/tomcat6 restart + --- /dev/null +++ b/aws/pg_hba.conf @@ -1,1 +1,75 @@ +# PostgreSQL Client Authentication Configuration File +# =================================================== +# +# Refer to the "Client Authentication" section in the +# PostgreSQL documentation for a complete description +# of this file. A short synopsis follows. +# +# This file controls: which hosts are allowed to connect, how clients +# are authenticated, which PostgreSQL user names they can use, which +# databases they can access. Records take one of these forms: +# +# local DATABASE USER METHOD [OPTIONS] +# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] +# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] +# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] +# +# (The uppercase items must be replaced by actual values.) +# +# The first field is the connection type: "local" is a Unix-domain socket, +# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an +# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket. +# +# DATABASE can be "all", "sameuser", "samerole", a database name, or +# a comma-separated list thereof. +# +# USER can be "all", a user name, a group name prefixed with "+", or +# a comma-separated list thereof. In both the DATABASE and USER fields +# you can also write a file name prefixed with "@" to include names from +# a separate file. +# +# CIDR-ADDRESS specifies the set of hosts the record matches. +# It is made up of an IP address and a CIDR mask that is an integer +# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies +# the number of significant bits in the mask. Alternatively, you can write +# an IP address and netmask in separate columns to specify the set of hosts. +# +# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5", +# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords +# in clear text; "md5" is preferred since it sends encrypted passwords. +# +# OPTIONS are a set of options for the authentication in the format +# NAME=VALUE. The available options depend on the different authentication +# methods - refer to the "Client Authentication" section in the documentation +# for a list of which options are available for which authentication methods. +# +# Database and user names containing spaces, commas, quotes and other special +# characters must be quoted. Quoting one of the keywords "all", "sameuser" or +# "samerole" makes the name lose its special character, and just match a +# database or username with that name. +# +# This file is read on server startup and when the postmaster receives +# a SIGHUP signal. If you edit the file on a running system, you have +# to SIGHUP the postmaster for the changes to take effect. You can use +# "pg_ctl reload" to do that. +# Put your actual configuration here +# ---------------------------------- +# +# If you want to allow non-local connections, you need to add more +# "host" records. In that case you will also need to make PostgreSQL listen +# on a non-local interface via the listen_addresses configuration parameter, +# or via the -i or -h command line switches. +# + + + +# TYPE DATABASE USER CIDR-ADDRESS METHOD + +# "local" is for Unix domain socket connections only +local all all trust +# IPv4 local connections: +host all all 127.0.0.1/32 trust +# IPv6 local connections: +host all all ::1/128 trust + --- a/feedback.php +++ b/feedback.php @@ -48,7 +48,7 @@ if you click on feedback from a stop page, these will get filled in automatically. else describe the location/street of the stop in one of these boxes
Suggested Stop Location (lat/long or words):
- if your device supports javascript, you can pick a location from the map above
+ --- /dev/null +++ b/include/common-db.inc.php @@ -1,1 +1,21 @@ + --- a/include/common-geo.inc.php +++ b/include/common-geo.inc.php @@ -70,6 +70,7 @@ else return round($km,2)."k"; } else return floor($km * 1000); } + function decodePolylineToArray($encoded) { // source: http://latlongeeks.com/forum/viewtopic.php?f=4&t=5 --- a/include/common-session.inc.php +++ b/include/common-session.inc.php @@ -17,7 +17,6 @@ } else { $geolocate = filter_var($_REQUEST['geolocate'], FILTER_SANITIZE_URL); - echo $_REQUEST['geolocate']; if (startsWith($geolocate, "-")) { $locateparts = explode(",", $geolocate); $_SESSION['lat'] = $locateparts[0]; @@ -52,6 +51,9 @@ session_destroy(); session_start(); } -debug(print_r($_SESSION, true) , "session"); +//debug(print_r($_SESSION, true) , "session"); +function current_time() { + return ($_SESSION['time']? $_SESSION['time'] : date("H:i:s")); +} ?> --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -74,10 +74,14 @@ .ui-listview-filter { margin: 0 !important; } - .ui-icon-navigation { + .ui-icon-navigation { background-image: url(css/images/113-navigation.png); background-position: 1px 0; } + .ui-icon-beaker { + background-image: url(css/images/91-beaker-2.png); + background-position: 1px 0; + } #footer { text-size: 0.75em; text-align: center; @@ -98,6 +102,14 @@ #extrainfo { visibility: hidden; display: none; + } + #servicewarning { + padding: 1em; + margin-bottom: 0.5em; + text-size: 0.2em; + background-color: #FF9; + -moz-border-radius: 15px; +border-radius: 15px; } // source http://webaim.org/techniques/skipnav/ #skip a, #skip a:hover, #skip a:visited @@ -169,12 +181,6 @@ '; if ($opendiv) { echo '
-
Back

' . $pageTitle . '

@@ -182,6 +188,12 @@
'; + if (!$_SESSION['service_id']) { + $overrides = getServiceOverride(); + if ($overrides['service_id']){ + echo '
Buses are running on an altered timetable today due to industrial action/public holiday. See http://www.action.act.gov.au for details.
'; + } + } } } function include_footer() @@ -224,7 +236,7 @@
- Current Time? + Current Time?
--- a/include/common-transit.inc.php +++ b/include/common-transit.inc.php @@ -4,9 +4,26 @@ 'saturday', 'weekday' ); +function getServiceOverride() { + global $conn; + $query = "Select * from calendar_dates where date = '".date("Ymd")."' and exception_type = '1'"; + debug($query,"database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + return pg_fetch_assoc($result); +} function service_period() { + if (isset($_SESSION['service_period'])) return $_SESSION['service_period']; + $override = getServiceOverride(); + if ($override['service_id']){ + return $override['service_id']; + } + switch (date('w')) { case 0: return 'sunday'; @@ -16,5 +33,24 @@ return 'weekday'; } } +function midnight_seconds() +{ + // from http://www.perturb.org/display/Perlfunc__Seconds_Since_Midnight.html + if (isset($_SESSION['time'])) { + $time = strtotime($_SESSION['time']); + return (date("G", $time) * 3600) + (date("i", $time) * 60) + date("s", $time); + } + return (date("G") * 3600) + (date("i") * 60) + date("s"); +} +function midnight_seconds_to_time($seconds) +{ + if ($seconds > 0) { + $midnight = mktime(0, 0, 0, date("n") , date("j") , date("Y")); + return date("h:ia", $midnight + $seconds); + } + else { + return ""; + } +} +?> -?> --- a/include/db/route-dao.inc.php +++ b/include/db/route-dao.inc.php @@ -1,6 +1,7 @@ CURRENT_TIME and routes.route_id = '$routeID' order by +arrival_time > '".current_time()."' and routes.route_id = '$routeID' order by arrival_time limit 1"; + debug($query,"database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + $r = pg_fetch_assoc($result); + // past last trip of the day special case + if (sizeof($r) == 0) { + $query = "select * from routes join trips on trips.route_id = routes.route_id +join stop_times on stop_times.trip_id = trips.trip_id where routes.route_id = '$routeID' order by +arrival_time DESC limit 1"; + debug($query,"database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + $r = pg_fetch_assoc($result); + } + return $r; + } + + function getTimeInterpolatedRouteAtStop($routeID, $stop_id) +{ + $nextTrip = getRouteNextTrip($routeID); + if ($nextTrip['trip_id']){ + foreach (getTimeInterpolatedTrip($nextTrip['trip_id']) as $tripStop) { + if ($tripStop['stop_id'] == $stop_id) return $tripStop; + } + } + return Array(); +} + +function getRouteTrips($routeID) { + global $conn; + $query = "select routes.route_id,trips.trip_id,service_id,arrival_time, stop_id, stop_sequence from routes join trips on trips.route_id = routes.route_id +join stop_times on stop_times.trip_id = trips.trip_id where routes.route_id = '$routeID' and stop_sequence = '1' order by +arrival_time "; debug($query,"database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); return Array(); } - return pg_fetch_assoc($result); + return pg_fetch_all($result); } - function getRoutesByDestination($destination = "", $service_period = "") { global $conn; if ($service_period == "") $service_period = service_period(); @@ -99,7 +139,7 @@ if ($service_period == "") $service_period = service_period(); if ($limit != "") $limit = " LIMIT $limit "; global $conn; - $query = "SELECT service_id,trips.route_id,route_short_name,route_long_name, + $query = "SELECT service_id,trips.route_id,route_short_name,route_long_name,min(stops.stop_id) as stop_id, min(ST_Distance(position, ST_GeographyFromText('SRID=4326;POINT($lng $lat)'), FALSE)) as distance FROM stop_times join trips on trips.trip_id = stop_times.trip_id --- a/include/db/stop-dao.inc.php +++ b/include/db/stop-dao.inc.php @@ -1,33 +1,33 @@ 0) { - if (sizeof($conditions) > 1) { - $query .= " Where ".implode(" AND ",$conditions)." "; - } - else { - $query .= " Where ".$conditions[0]." "; - } - } - $query .= " order by stop_name;"; - debug($query,"database"); + if (sizeof($conditions) > 0) { + if (sizeof($conditions) > 1) { + $query.= " Where " . implode(" AND ", $conditions) . " "; + } + else { + $query.= " Where " . $conditions[0] . " "; + } + } + $query.= " order by stop_name;"; + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); @@ -37,13 +37,13 @@ } function getNearbyStops($lat, $lng, $limit = "", $distance = 1000) { - if ($lat == null || $lng == null) return Array(); - if ($limit != "") $limit = " LIMIT $limit "; - global $conn; - $query = "Select *, ST_Distance(position, ST_GeographyFromText('SRID=4326;POINT($lng $lat)'), FALSE) as distance + if ($lat == null || $lng == null) return Array(); + if ($limit != "") $limit = " LIMIT $limit "; + global $conn; + $query = "Select *, ST_Distance(position, ST_GeographyFromText('SRID=4326;POINT($lng $lat)'), FALSE) as distance from stops WHERE ST_DWithin(position, ST_GeographyFromText('SRID=4326;POINT($lng $lat)'), $distance, FALSE) order by distance $limit;"; - debug($query,"database"); + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); @@ -53,9 +53,9 @@ } function getStopsBySuburb($suburb) { -global $conn; - $query = "Select * from stops where zone_id LIKE '%$suburb;%' order by stop_name;"; - debug($query,"database"); + global $conn; + $query = "Select * from stops where zone_id LIKE '%$suburb;%' order by stop_name;"; + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); @@ -65,60 +65,80 @@ } function getStopRoutes($stopID, $service_period) { - if ($service_period == "") $service_period = service_period(); - global $conn; - $query = "SELECT service_id,trips.route_id,route_short_name,route_long_name + if ($service_period == "") $service_period = service_period(); + global $conn; + $query = "SELECT service_id,trips.route_id,route_short_name,route_long_name FROM stop_times join trips on trips.trip_id = stop_times.trip_id join routes on trips.route_id = routes.route_id WHERE stop_id = '$stopID' AND service_id='$service_period'"; - debug($query,"database"); + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); return Array(); } return pg_fetch_all($result); - } - -function getStopTrips($stopID, $service_period = "") +} +function getStopTrips($stopID, $service_period = "", $afterTime = "") { - if ($service_period == "") $service_period = service_period(); - global $conn; - $query = "SELECT stop_times.trip_id,arrival_time,stop_id,stop_sequence,service_id,trips.route_id,route_short_name,route_long_name -FROM stop_times join trips on trips.trip_id = -stop_times.trip_id join routes on trips.route_id = routes.route_id WHERE stop_id = '$stopID' AND service_id='$service_period'"; - debug($query,"database"); + if ($service_period == "") $service_period = service_period(); + $afterCondition = "AND arrival_time > '$afterTime'"; + global $conn; + if ($afterTime != "") { + $query = " SELECT stop_times.trip_id,stop_times.arrival_time,stop_times.stop_id,stop_sequence,service_id,trips.route_id,route_short_name,route_long_name, end_times.arrival_time as end_time +FROM stop_times +join trips on trips.trip_id = +stop_times.trip_id +join routes on trips.route_id = routes.route_id , (SELECT trip_id,max(arrival_time) as arrival_time from stop_times + WHERE stop_times.arrival_time IS NOT NULL group by trip_id) as end_times +WHERE stop_times.stop_id = '$stopID' +AND stop_times.trip_id = end_times.trip_id +AND service_id='$service_period' +AND end_times.arrival_time > '$afterTime' +ORDER BY end_time"; + } + else { + $query = "SELECT stop_times.trip_id,arrival_time,stop_times.stop_id,stop_sequence,service_id,trips.route_id,route_short_name,route_long_name +FROM stop_times +join trips on trips.trip_id = +stop_times.trip_id +join routes on trips.route_id = routes.route_id +WHERE stop_times.stop_id = '$stopID' +AND service_id='$service_period' +ORDER BY arrival_time"; + } + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); return Array(); } return pg_fetch_all($result); - } -function getStopTripsWithTimes($stopID, $time = "", $service_period = "", $time_range = "") +function getStopTripsWithTimes($stopID, $time = "", $service_period = "", $time_range = "", $limit = "") { - if ($service_period == "") $service_period = service_period(); - if ($time_range == "") $time_range = (24*60*60); - if ($time == "") $time = ($_SESSION['time'] ? $_SESSION['time'] : date("h:i:00")); - $trips = getStopTrips($stopID,$service_period); - $timedTrips = Array(); - foreach ($trips as $trip) { - if ($trip['arrival_time'] != "") { - if (strtotime($trip['arrival_time']) > strtotime($time) and strtotime($trip['arrival_time']) < (strtotime($time) + $time_range)){ - $timedTrips[] = $trip; - } - } else { - $tripstarttime = getTripStartTime($trip['trip_id']); - if ($tripstarttime > $time and $tripstarttime < ($time + $time_range)) { - $timedtrip = getTimeInterpolatedTripStop($trip['trip_id'], $trip['stop_sequence']); - if (strtotime($timedtrip['arrival_time']) > strtotime($time) and $timedtrip['arrival_time'] < (strtotime($time) + strtotime($time_range))){ - $timedTrips[] = $timedTrip; - } - } - } - if (sizeof($timedTrips) > limit) break; - } - sktimesort($timedTrips,"arrival_time", true); - return $timedTrips; + if ($service_period == "") $service_period = service_period(); + if ($time_range == "") $time_range = (24 * 60 * 60); + if ($time == "") $time = current_time(); + if ($limit == "") $limit = 10; + $trips = getStopTrips($stopID, $service_period, $time); + $timedTrips = Array(); + if ($trips && sizeof($trips) > 0) { + foreach ($trips as $trip) { + if ($trip['arrival_time'] != "") { + if (strtotime($trip['arrival_time']) > strtotime($time) and strtotime($trip['arrival_time']) < (strtotime($time) + $time_range)) { + $timedTrips[] = $trip; + } + } + else { + $timedTrip = getTimeInterpolatedTripAtStop($trip['trip_id'], $trip['stop_sequence']); + if ($timedTrip['arrival_time'] > $time and strtotime($timedTrip['arrival_time']) < (strtotime($time) + $time_range)) { + $timedTrips[] = $timedTrip; + } + } + if (sizeof($timedTrips) > $limit) break; + } + sktimesort($timedTrips, "arrival_time", true); + } + return $timedTrips; } ?> --- a/include/db/trip-dao.inc.php +++ b/include/db/trip-dao.inc.php @@ -1,115 +1,186 @@ '$stop_sequence' -AND substr(stop_code,1,2) != 'Wj' ORDER BY stop_sequence"; - debug($query,"database"); + global $conn; + $query = "SELECT stop_times.trip_id,arrival_time,stop_times.stop_id,stop_lat,stop_lon,stop_name,stop_code, + stop_sequence,service_id,trips.route_id,route_short_name,route_long_name +FROM stop_times +join trips on trips.trip_id = stop_times.trip_id +join routes on trips.route_id = routes.route_id +join stops on stops.stop_id = stop_times.stop_id +WHERE trips.trip_id = '$tripID' $range ORDER BY stop_sequence"; + debug($query, "database"); $result = pg_query($conn, $query); if (!$result) { databaseError(pg_result_error($result)); return Array(); } - $pointNames = pg_fetch_all($result); - return r_implode(", ", $pointNames); + $stopTimes = pg_fetch_all($result); + $cur_timepoint = Array(); + $next_timepoint = Array(); + $distance_between_timepoints = 0.0; + $distance_traveled_between_timepoints = 0.0; + $rv = Array(); + foreach ($stopTimes as $i => $stopTime) { + if ($stopTime['arrival_time'] != "") { + // is timepoint + $cur_timepoint = $stopTime; + $distance_between_timepoints = 0.0; + $distance_traveled_between_timepoints = 0.0; + if ($i + 1 < sizeof($stopTimes)) { + $k = $i + 1; + $distance_between_timepoints += distance($stopTimes[$k - 1]["stop_lat"], $stopTimes[$k - 1]["stop_lon"], $stopTimes[$k]["stop_lat"], $stopTimes[$k]["stop_lon"]); + while ($stopTimes[$k]["arrival_time"] == "" && $k + 1 < sizeof($stopTimes)) { + $k += 1; + //echo "k".$k; + $distance_between_timepoints += distance($stopTimes[$k - 1]["stop_lat"], $stopTimes[$k - 1]["stop_lon"], $stopTimes[$k]["stop_lat"], $stopTimes[$k]["stop_lon"]); + } + $next_timepoint = $stopTimes[$k]; + $rv[] = $stopTime; + } + } + else { + // is untimed point + //echo "i".$i; + $distance_traveled_between_timepoints += distance($stopTimes[$i - 1]["stop_lat"], $stopTimes[$i - 1]["stop_lon"], $stopTimes[$i]["stop_lat"], $stopTimes[$i]["stop_lon"]); + //echo "$distance_traveled_between_timepoints / $distance_between_timepoints
"; + $distance_percent = $distance_traveled_between_timepoints / $distance_between_timepoints; + if ($next_timepoint["arrival_time"] != "") { + $total_time = strtotime($next_timepoint["arrival_time"]) - strtotime($cur_timepoint["arrival_time"]); + //echo strtotime($next_timepoint["arrival_time"])." - ".strtotime($cur_timepoint["arrival_time"])."
"; + $time_estimate = ($distance_percent * $total_time) + strtotime($cur_timepoint["arrival_time"]); + $stopTime["arrival_time"] = date("H:i:s", $time_estimate); + } else { + $stopTime["arrival_time"] = $cur_timepoint["arrival_time"]; + } + $rv[] = $stopTime; + //var_dump($rv); + } + } + return $rv; +} +function getTimeInterpolatedTripAtStop($tripID, $stop_sequence) +{ + global $conn; + // limit interpolation to between nearest actual points. + $prevTimePoint = pg_fetch_assoc(pg_query($conn," SELECT trip_id,stop_id, + stop_sequence +FROM stop_times +WHERE trip_id = '$tripID' and stop_sequence < $stop_sequence and stop_times.arrival_time IS NOT NULL ORDER BY stop_sequence DESC LIMIT 1")); + $nextTimePoint = pg_fetch_assoc(pg_query($conn," SELECT trip_id,stop_id, + stop_sequence +FROM stop_times +WHERE trip_id = '$tripID' and stop_sequence > $stop_sequence and stop_times.arrival_time IS NOT NULL ORDER BY stop_sequence LIMIT 1")); + $range = "AND stop_sequence >= '{$prevTimePoint['stop_sequence']}' AND stop_sequence <= '{$nextTimePoint['stop_sequence']}'"; + foreach (getTimeInterpolatedTrip($tripID,$range) as $tripStop) { + if ($tripStop['stop_sequence'] == $stop_sequence) return $tripStop; + } + return Array(); +} +function getTripStartTime($tripID) +{ + global $conn; + $query = "Select * from stop_times + where trip_id = '$tripID' + AND arrival_time IS NOT NULL + AND stop_sequence = '1'"; + debug($query, "database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + $r = pg_fetch_assoc($result); + return $r['arrival_time']; +} +function getActiveTrips($time) +{ + global $conn; + if ($time == "") $time = current_time(); + $query = "Select distinct stop_times.trip_id, start_times.arrival_time as start_time, end_times.arrival_time as end_time from stop_times, (SELECT trip_id,arrival_time from stop_times WHERE stop_times.arrival_time IS NOT NULL +AND stop_sequence = '1') as start_times, (SELECT trip_id,max(arrival_time) as arrival_time from stop_times WHERE stop_times.arrival_time IS NOT NULL group by trip_id) as end_times +WHERE start_times.trip_id = end_times.trip_id AND stop_times.trip_id = end_times.trip_id AND $time > start_times.arrival_time AND $time < end_times.arrival_time"; + debug($query, "database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + return pg_fetch_all($result); +} + +function viaPoints($tripid, $stop_sequence = "") +{ + global $conn; + $query = "SELECT stops.stop_id, stop_name, arrival_time +FROM stop_times join stops on stops.stop_id = stop_times.stop_id +WHERE stop_times.trip_id = '$tripid' +".($stop_sequence != "" ? "AND stop_sequence > '$stop_sequence'" : ""). +"AND substr(stop_code,1,2) != 'Wj' ORDER BY stop_sequence"; + debug($query, "database"); + $result = pg_query($conn, $query); + if (!$result) { + databaseError(pg_result_error($result)); + return Array(); + } + return pg_fetch_all($result); +} +function viaPointNames($tripid, $stop_sequence = "") +{ + $viaPointNames = Array(); + foreach(viaPoints($tripid, $stop_sequence) as $point) { + $viaPointNames[] = $point['stop_name']; + } + return r_implode(", ", $viaPointNames); } ?> --- a/index.php +++ b/index.php @@ -25,6 +25,7 @@ Busness R&D'; include_footer(true) ?> --- /dev/null +++ b/js/flotr/flotr-0.2.0-alpha.js @@ -1,1 +1,2 @@ - +//Flotr 0.2.0-alpha Copyright (c) 2009 Bas Wenneker, , MIT License. +var Flotr={version:"0.2.0-alpha",author:"Bas Wenneker",website:"http://www.solutoire.com",_registeredTypes:{lines:"drawSeriesLines",points:"drawSeriesPoints",bars:"drawSeriesBars",candles:"drawSeriesCandles",pie:"drawSeriesPie"},register:function(A,B){Flotr._registeredTypes[A]=B+""},draw:function(B,D,A,C){C=C||Flotr.Graph;return new C(B,D,A)},getSeries:function(A){return A.collect(function(C){var B,C=(C.data)?Object.clone(C):{data:C};for(B=C.data.length-1;B>-1;--B){C.data[B][1]=(C.data[B][1]===null?null:parseFloat(C.data[B][1]))}return C})},merge:function(D,B){var A=B||{};for(var C in D){A[C]=(D[C]!=null&&typeof (D[C])=="object"&&!(D[C].constructor==Array||D[C].constructor==RegExp)&&!Object.isElement(D[C]))?Flotr.merge(D[C],B[C]):A[C]=D[C]}return A},getTickSize:function(E,D,A,B){var H=(A-D)/E;var G=Flotr.getMagnitude(H);var C=H/G;var F=10;if(C<1.5){F=1}else{if(C<2.25){F=2}else{if(C<3){F=((B==0)?2:2.5)}else{if(C<7.5){F=5}}}}return F*G},defaultTickFormatter:function(A){return A+""},defaultTrackFormatter:function(A){return"("+A.x+", "+A.y+")"},defaultPieLabelFormatter:function(A){return(A.fraction*100).toFixed(2)+"%"},getMagnitude:function(A){return Math.pow(10,Math.floor(Math.log(A)/Math.LN10))},toPixel:function(A){return Math.floor(A)+0.5},toRad:function(A){return -A*(Math.PI/180)},parseColor:function(D){if(D instanceof Flotr.Color){return D}var A,C=Flotr.Color;if((A=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(D))){return new C(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]))}if((A=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(D))){return new C(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]),parseFloat(A[4]))}if((A=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(D))){return new C(parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55)}if((A=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(D))){return new C(parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55,parseFloat(A[4]))}if((A=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(D))){return new C(parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16))}if((A=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(D))){return new C(parseInt(A[1]+A[1],16),parseInt(A[2]+A[2],16),parseInt(A[3]+A[3],16))}var B=D.strip().toLowerCase();if(B=="transparent"){return new C(255,255,255,0)}return((A=C.lookupColors[B]))?new C(A[0],A[1],A[2]):false},extractColor:function(B){var A;do{A=B.getStyle("background-color").toLowerCase();if(!(A==""||A=="transparent")){break}B=B.up(0)}while(!B.nodeName.match(/^body$/i));return(A=="rgba(0, 0, 0, 0)")?"transparent":A}};Flotr.Graph=Class.create({initialize:function(B,C,A){this.el=$(B);if(!this.el){throw"The target container doesn't exist"}this.data=C;this.series=Flotr.getSeries(C);this.setOptions(A);this.lastMousePos={pageX:null,pageY:null};this.selection={first:{x:-1,y:-1},second:{x:-1,y:-1}};this.prevSelection=null;this.selectionInterval=null;this.ignoreClick=false;this.prevHit=null;this.constructCanvas();this.initEvents();this.findDataRanges();this.calculateTicks(this.axes.x);this.calculateTicks(this.axes.x2);this.calculateTicks(this.axes.y);this.calculateTicks(this.axes.y2);this.calculateSpacing();this.draw();this.insertLegend();if(this.options.spreadsheet.show){this.constructTabs()}},setOptions:function(B){var P={colors:["#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED"],title:null,subtitle:null,legend:{show:true,noColumns:1,labelFormatter:Prototype.K,labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{ticks:null,showLabels:true,labelsAngle:0,title:null,titleAngle:0,noTicks:5,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscaleMargin:0,color:null},x2axis:{},yaxis:{ticks:null,showLabels:true,labelsAngle:0,title:null,titleAngle:90,noTicks:5,tickFormatter:Flotr.defaultTickFormatter,tickDecimals:null,min:null,max:null,autoscaleMargin:0,color:null},y2axis:{titleAngle:270},points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#FFFFFF",fillOpacity:0.4},lines:{show:false,lineWidth:2,fill:false,fillColor:null,fillOpacity:0.4},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,fillOpacity:0.4,horizontal:false,stacked:false},candles:{show:false,lineWidth:1,wickLineWidth:1,candleWidth:0.6,fill:true,upFillColor:"#00A8F0",downFillColor:"#CB4B4B",fillOpacity:0.5,barcharts:false},pie:{show:false,lineWidth:1,fill:true,fillColor:null,fillOpacity:0.6,explode:6,sizeRatio:0.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:false,pie3DviewAngle:(Math.PI/2*0.8),pie3DspliceThickness:20},grid:{color:"#545454",backgroundColor:null,tickColor:"#DDDDDD",labelMargin:3,verticalLines:true,horizontalLines:true,outlineWidth:2},selection:{mode:null,color:"#B6D9FF",fps:20},mouse:{track:false,position:"se",relative:false,trackFormatter:Flotr.defaultTrackFormatter,margin:5,lineColor:"#FF3F19",trackDecimals:1,sensibility:2,radius:3},shadowSize:4,defaultType:"lines",HtmlText:true,fontSize:7.5,spreadsheet:{show:false,tabGraphLabel:"Graph",tabDataLabel:"Data",toolbarDownload:"Download CSV",toolbarSelectAll:"Select all"}};P.x2axis=Object.extend(Object.clone(P.xaxis),P.x2axis);P.y2axis=Object.extend(Object.clone(P.yaxis),P.y2axis);this.options=Flotr.merge((B||{}),P);this.axes={x:{options:this.options.xaxis,n:1},x2:{options:this.options.x2axis,n:2},y:{options:this.options.yaxis,n:1},y2:{options:this.options.y2axis,n:2}};var H=[],C=[],K=this.series.length,N=this.series.length,D=this.options.colors,A=[],G=0,M,J,I,O,E;for(J=N-1;J>-1;--J){M=this.series[J].color;if(M!=null){--N;if(Object.isNumber(M)){H.push(M)}else{A.push(Flotr.parseColor(M))}}}for(J=H.length-1;J>-1;--J){N=Math.max(N,H[J]+1)}for(J=0;C.length=D.length){J=0;++G}}for(J=0,I=0;J'+F+"
").select(".flotr-dummy-div")[0];dim=A.getDimensions();A.remove();return dim}},loadDataGrid:function(){if(this.seriesData){return this.seriesData}var A=this.series;var B=[];for(i=0;i"];var F=[''];F.push(" ");for(D=0;D'+(L[D].label||String.fromCharCode(65+D))+"");C.push("")}F.push("");for(B=0;B");for(D=0;D"+G+"")}F.push("")}C.push("");K.update(C.join("")+F.join(""));if(!Prototype.Browser.IE){K.select("td").each(function(N){N.observe("mouseover",function(O){N=O.element();var P=N.previousSiblings();K.select("th[scope=col]")[P.length-1].addClassName("hover");K.select("colgroup col")[P.length].addClassName("hover")});N.observe("mouseout",function(){K.select("colgroup col.hover, th.hover").each(function(O){O.removeClassName("hover")})})})}var H=new Element("div",{className:"flotr-datagrid-toolbar"}).insert(new Element("button",{type:"button",className:"flotr-datagrid-toolbar-button"}).update(this.options.spreadsheet.toolbarDownload).observe("click",this.downloadCSV.bind(this))).insert(new Element("button",{type:"button",className:"flotr-datagrid-toolbar-button"}).update(this.options.spreadsheet.toolbarSelectAll).observe("click",this.selectAllData.bind(this)));var A=new Element("div",{className:"flotr-datagrid-container",style:"left:0px;top:0px;width:"+this.canvasWidth+"px;height:"+this.canvasHeight+"px;overflow:auto;"});A.insert(H);K.wrap(A.hide());this.el.insert(A);return K},selectAllData:function(){if(this.tabs){var B,A,E,D,C=this.constructDataGrid();this.showTab("data");(function(){if((E=C.ownerDocument)&&(D=E.defaultView)&&D.getSelection&&E.createRange&&(B=window.getSelection())&&B.removeAllRanges){A=E.createRange();A.selectNode(C);B.removeAllRanges();B.addRange(A)}else{if(document.body&&document.body.createTextRange&&(A=document.body.createTextRange())){A.moveToElementText(C);A.select()}}}).defer();return true}else{return false}},downloadCSV:function(){var D,A='"x"',C=this.series,E=this.loadDataGrid();for(D=0;D0){var C,A,D,H,F,B,I,E;for(C=0;C0&&!J[C].hide){if(!I.used){I.datamin=I.datamax=B[0][0]}if(!E.used){E.datamin=E.datamax=B[0][1]}I.used=true;E.used=true;for(D=B.length-1;D>-1;--D){H=B[D][0];if(HI.datamax){I.datamax=H}}for(A=1;AE.datamax){E.datamax=F}}}}}}}this.findXAxesValues();this.calculateRange(G.x);this.extendXRangeIfNeededByBar(G.x);if(G.x2.used){this.calculateRange(G.x2);this.extendXRangeIfNeededByBar(G.x2)}this.calculateRange(G.y);this.extendYRangeIfNeededByBar(G.y);if(G.y2.used){this.calculateRange(G.y2);this.extendYRangeIfNeededByBar(G.y2)}},calculateRange:function(D){var F=D.options,C=F.min!=null?F.min:D.datamin,A=F.max!=null?F.max:D.datamax,E;if(A-C==0){var B=(A==0)?1:0.01;C-=B;A+=B}D.tickSize=Flotr.getTickSize(F.noTicks,C,A,F.tickDecimals);if(F.min==null){E=F.autoscaleMargin;if(E!=0){C-=D.tickSize*E;if(C<0&&D.datamin>=0){C=0}C=D.tickSize*Math.floor(C/D.tickSize)}}if(F.max==null){E=F.autoscaleMargin;if(E!=0){A+=D.tickSize*E;if(A>0&&D.datamax<=0){A=0}A=D.tickSize*Math.ceil(A/D.tickSize)}}D.min=C;D.max=A},extendXRangeIfNeededByBar:function(A){if(A.options.max==null){var D=A.max,B,I,F,E,H=[],C=null;for(B=0;BD)||(E.candleWidth+A.datamax>D)){D=A.max+I.bars.barWidth}if(F.stacked&&F.horizontal){for(j=0;jD)||(E.candleWidth+A.datamax>D)){D=A.max+F.barWidth}if(F.stacked&&!F.horizontal){for(j=0;j-1;--i){s=this.series[i];s.xaxis.values=s.xaxis.values||[];for(j=s.data.length-1;j>-1;--j){s.xaxis.values[s.data[j][0]]={}}}},calculateTicks:function(D){var B=D.options,E,H;D.ticks=[];if(B.ticks){var G=B.ticks,I,F;if(Object.isFunction(G)){G=G({min:D.min,max:D.max})}for(E=0;E1)?I[1]:B.tickFormatter(H)}else{H=I;F=B.tickFormatter(H)}D.ticks[E]={v:H,label:F}}}else{var A=D.tickSize*Math.ceil(D.min/D.tickSize),C;for(E=0;A+E*D.tickSize<=D.max;++E){H=A+E*D.tickSize;C=B.tickDecimals;if(C==null){C=1-Math.floor(Math.log(D.tickSize)/Math.LN10)}if(C<0){C=0}H=H.toFixed(C);D.ticks.push({v:H,label:B.tickFormatter(H)})}}},calculateSpacing:function(){var L=this.axes,N=this.options,H=this.series,D=N.grid.labelMargin,M=L.x,A=L.x2,J=L.y,K=L.y2,F=2,G,E,C,I;[M,A,J,K].each(function(P){var O="";if(P.options.showLabels){for(G=0;GO.length){O=P.ticks[G].label}}}P.maxLabel=this.getTextDimensions(O,{size:N.fontSize,angle:Flotr.toRad(P.options.labelsAngle)},"font-size:smaller;","flotr-grid-label");P.titleSize=this.getTextDimensions(P.options.title,{size:N.fontSize*1.2,angle:Flotr.toRad(P.options.titleAngle)},"font-weight:bold;","flotr-axis-title")},this);I=this.getTextDimensions(N.title,{size:N.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title");this.titleHeight=I.height;I=this.getTextDimensions(N.subtitle,{size:N.fontSize},"font-size:smaller;","flotr-subtitle");this.subtitleHeight=I.height;if(N.show){F=Math.max(F,N.points.radius+N.points.lineWidth/2)}for(E=0;E'];D=H.x;if(D.options.showLabels){for(E=0;E'+G.label+"
")}}D=H.x2;if(D.options.showLabels&&D.used){for(E=0;E'+G.label+"
")}}D=H.y;if(D.options.showLabels){for(E=0;E'+G.label+"")}}D=H.y2;if(D.options.showLabels&&D.used){I.save();I.strokeStyle=D.options.color||J.grid.color;I.beginPath();for(E=0;E'+G.label+"");I.moveTo(this.plotOffset.left+this.plotWidth-8,this.plotOffset.top+this.tVert(G.v,D));I.lineTo(this.plotOffset.left+this.plotWidth,this.plotOffset.top+this.tVert(G.v,D))}I.stroke();I.restore()}F.push("");this.el.insert(F.join(""))}}},drawTitles:function(){var D,C=this.options,F=C.grid.labelMargin,B=this.ctx,A=this.axes;if(!C.HtmlText&&this.textEnabled){var E={size:C.fontSize,color:C.grid.color,halign:"c"};if(C.subtitle){B.drawText(C.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,E)}E.weight=1.5;E.size*=1.5;if(C.title){B.drawText(C.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,E)}E.weight=1.8;E.size*=0.8;E.adjustAlign=true;if(A.x.options.title&&A.x.used){E.halign="c";E.valign="t";E.angle=Flotr.toRad(A.x.options.titleAngle);B.drawText(A.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+A.x.maxLabel.height+this.plotHeight+2*F,E)}if(A.x2.options.title&&A.x2.used){E.halign="c";E.valign="b";E.angle=Flotr.toRad(A.x2.options.titleAngle);B.drawText(A.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-A.x2.maxLabel.height-2*F,E)}if(A.y.options.title&&A.y.used){E.halign="r";E.valign="m";E.angle=Flotr.toRad(A.y.options.titleAngle);B.drawText(A.y.options.title,this.plotOffset.left-A.y.maxLabel.width-2*F,this.plotOffset.top+this.plotHeight/2,E)}if(A.y2.options.title&&A.y2.used){E.halign="l";E.valign="m";E.angle=Flotr.toRad(A.y2.options.titleAngle);B.drawText(A.y2.options.title,this.plotOffset.left+this.plotWidth+A.y2.maxLabel.width+2*F,this.plotOffset.top+this.plotHeight/2,E)}}else{D=['
'];if(C.title){D.push('
'+C.title+"
")}if(C.subtitle){D.push('
'+C.subtitle+"
")}D.push("
");D.push('
');if(A.x.options.title&&A.x.used){D.push('
'+A.x.options.title+"
")}if(A.x2.options.title&&A.x2.used){D.push('
'+A.x2.options.title+"
")}if(A.y.options.title&&A.y.used){D.push('
'+A.y.options.title+"
")}if(A.y2.options.title&&A.y2.used){D.push('
'+A.y2.options.title+"
")}D.push("
");this.el.insert(D.join(""))}},drawSeries:function(A){A=A||this.series;var C=false;for(var B in Flotr._registeredTypes){if(A[B]&&A[B].show){this[Flotr._registeredTypes[B]](A);C=true}}if(!C){this[Flotr._registeredTypes[this.options.defaultType]](A)}},plotLine:function(I,F){var O=this.ctx,A=I.xaxis,K=I.yaxis,J=this.tHoz.bind(this),M=this.tVert.bind(this),H=I.data;if(H.length<2){return }var E=J(H[0][0],A),D=M(H[0][1],K)+F;O.beginPath();O.moveTo(E,D);for(var G=0;G=L&&N>K.max){if(L>K.max){continue}C=(K.max-N)/(L-N)*(B-C)+C;N=K.max}else{if(L>=N&&L>K.max){if(N>K.max){continue}B=(K.max-N)/(L-N)*(B-C)+C;L=K.max}}if(C<=B&&C=B&&C>A.max){if(B>A.max){continue}N=(A.max-C)/(B-C)*(L-N)+N;C=A.max}else{if(B>=C&&B>A.max){if(C>A.max){continue}L=(A.max-C)/(B-C)*(L-N)+N;B=A.max}}if(E!=J(C,A)||D!=M(N,K)+F){O.moveTo(J(C,A),M(N,K)+F)}E=J(B,A);D=M(L,K)+F;O.lineTo(E,D)}O.stroke()},plotLineArea:function(J,D){var S=J.data;if(S.length<2){return }var L,G=0,N=this.ctx,Q=J.xaxis,B=J.yaxis,E=this.tHoz.bind(this),M=this.tVert.bind(this),H=Math.min(Math.max(0,B.min),B.max),F=true;N.beginPath();for(var O=0;O=P&&R>Q.max){if(P>Q.max){continue}C=(Q.max-R)/(P-R)*(A-C)+C;R=Q.max}else{if(P>=R&&P>Q.max){if(R>Q.max){continue}A=(Q.max-R)/(P-R)*(A-C)+C;P=Q.max}}if(F){N.moveTo(E(R,Q),M(H,B)+D);F=false}if(C>=B.max&&A>=B.max){N.lineTo(E(R,Q),M(B.max,B)+D);N.lineTo(E(P,Q),M(B.max,B)+D);continue}else{if(C<=B.min&&A<=B.min){N.lineTo(E(R,Q),M(B.min,B)+D);N.lineTo(E(P,Q),M(B.min,B)+D);continue}}var I=R,K=P;if(C<=A&&C=B.min){R=(B.min-C)/(A-C)*(P-R)+R;C=B.min}else{if(A<=C&&A=B.min){P=(B.min-C)/(A-C)*(P-R)+R;A=B.min}}if(C>=A&&C>B.max&&A<=B.max){R=(B.max-C)/(A-C)*(P-R)+R;C=B.max}else{if(A>=C&&A>B.max&&C<=B.max){P=(B.max-C)/(A-C)*(P-R)+R;A=B.max}}if(R!=I){L=(C<=B.min)?L=B.min:B.max;N.lineTo(E(I,Q),M(L,B)+D);N.lineTo(E(R,Q),M(L,B)+D)}N.lineTo(E(R,Q),M(C,B)+D);N.lineTo(E(P,Q),M(A,B)+D);if(P!=K){L=(A<=B.min)?B.min:B.max;N.lineTo(E(K,Q),M(L,B)+D);N.lineTo(E(P,Q),M(L,B)+D)}G=Math.max(P,K)}N.lineTo(E(G,Q),M(H,B)+D);N.closePath();N.fill()},drawSeriesLines:function(C){C=C||this.series;var B=this.ctx;B.save();B.translate(this.plotOffset.left,this.plotOffset.top);B.lineJoin="round";var D=C.lines.lineWidth;var A=C.shadowSize;if(A>0){B.lineWidth=A/2;var E=D/2+B.lineWidth/2;B.strokeStyle="rgba(0,0,0,0.1)";this.plotLine(C,E+A/2);B.strokeStyle="rgba(0,0,0,0.2)";this.plotLine(C,E);if(C.lines.fill){B.fillStyle="rgba(0,0,0,0.05)";this.plotLineArea(C,E+A/2)}}B.lineWidth=D;B.strokeStyle=C.color;if(C.lines.fill){B.fillStyle=C.lines.fillColor!=null?C.lines.fillColor:Flotr.parseColor(C.color).scale(null,null,null,C.lines.fillOpacity).toString();this.plotLineArea(C,0)}this.plotLine(C,0);B.restore()},drawSeriesPoints:function(C){var B=this.ctx;B.save();B.translate(this.plotOffset.left,this.plotOffset.top);var D=C.lines.lineWidth;var A=C.shadowSize;if(A>0){B.lineWidth=A/2;B.strokeStyle="rgba(0,0,0,0.1)";this.plotPointShadows(C,A/2+B.lineWidth/2,C.points.radius);B.strokeStyle="rgba(0,0,0,0.2)";this.plotPointShadows(C,B.lineWidth/2,C.points.radius)}B.lineWidth=C.points.lineWidth;B.strokeStyle=C.color;B.fillStyle=C.points.fillColor!=null?C.points.fillColor:C.color;this.plotPoints(C,C.points.radius,C.points.fill);B.restore()},plotPoints:function(C,E,I){var A=C.xaxis,F=C.yaxis,J=this.ctx,D,B=C.data;for(D=B.length-1;D>-1;--D){var H=B[D][0],G=B[D][1];if(HA.max||GF.max){continue}J.beginPath();J.arc(this.tHoz(H,A),this.tVert(G,F),E,0,2*Math.PI,true);if(I){J.fill()}J.stroke()}},plotPointShadows:function(D,B,F){var A=D.xaxis,G=D.yaxis,J=this.ctx,E,C=D.data;for(E=C.length-1;E>-1;--E){var I=C[E][0],H=C[E][1];if(IA.max||HG.max){continue}J.beginPath();J.arc(this.tHoz(I,A),thi