Brand the bike tool -- ungap the map, after all!

And print big numbers consistently for mode shift
This commit is contained in:
Dustin Carlino 2021-10-11 20:44:22 -07:00
parent 56323116e1
commit d050c885c8
2 changed files with 13 additions and 10 deletions

View File

@ -10,7 +10,7 @@ mod trip;
use map_gui::tools::{grey_out_map, open_browser, CityPicker};
use widgetry::{
EventCtx, GfxCtx, HorizontalAlignment, Key, Line, Panel, ScreenDims, SimpleState, State, Text,
TextExt, VerticalAlignment, Widget,
VerticalAlignment, Widget,
};
pub use self::explore::ExploreMap;
@ -46,6 +46,10 @@ impl Tab {
.image_path("system/assets/pregame/logo.svg")
.image_dims(50.0)
.build_widget(ctx, "about A/B Street"),
Line("Ungap the Map")
.small_heading()
.into_widget(ctx)
.centered_vert(),
map_gui::tools::change_map_btn(ctx, app)
.centered_vert()
.align_right(),
@ -188,8 +192,7 @@ impl About {
Line("Data from OpenStreetMap, King County GIS, King County LIDAR").small(),
])
.into_widget(ctx),
"This is a simplified version. Check out the full version below.".text_widget(ctx),
ctx.style().btn_outline.text("abstreet.org").build_def(ctx),
ctx.style().btn_outline.text("Read more").build_def(ctx),
]))
.build(ctx);
<dyn SimpleState<_>>::new_state(panel, Box::new(About))
@ -200,8 +203,8 @@ impl SimpleState<App> for About {
fn on_click(&mut self, _: &mut EventCtx, _: &mut App, x: &str, _: &Panel) -> Transition {
if x == "close" {
return Transition::Pop;
} else if x == "abstreet.org" {
open_browser("https://abstreet.org");
} else if x == "Read more" {
open_browser("https://a-b-street.github.io/docs/software/ungap_the_map/index.html");
}
Transition::Keep
}

View File

@ -64,7 +64,7 @@ impl State<App> for ShowGaps {
match self.top_panel.event(ctx) {
Outcome::Clicked(x) => {
if x == "read about how this prediction works" {
open_browser("https://a-b-street.github.io/docs/software/bike_network/tech_details.html#predict-impact");
open_browser("https://a-b-street.github.io/docs/software/ungap_the_map/tech_details.html#predict-impact");
return Transition::Keep;
} else if x == "Calculate" {
let change_key = app.primary.map.get_edits_change_key();
@ -158,8 +158,8 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
ctx,
Text::from(Line(format!(
"{} / {} trips, based on these thresholds",
data.filtered_trips.len(),
data.all_candidate_trips.len()
prettyprint_usize(data.filtered_trips.len()),
prettyprint_usize(data.all_candidate_trips.len())
))),
pct(data.filtered_trips.len(), data.all_candidate_trips.len()),
),
@ -171,8 +171,8 @@ fn make_top_panel(ctx: &mut EventCtx, app: &App) -> Panel {
ctx,
Text::from(Line(format!(
"{} / {} trips would switch",
data.results.num_trips,
data.all_candidate_trips.len()
prettyprint_usize(data.results.num_trips),
prettyprint_usize(data.all_candidate_trips.len())
))),
pct(data.results.num_trips, data.all_candidate_trips.len()),
),