Commit Graph

5114 Commits

Author SHA1 Message Date
Dustin Carlino
e4707ca223 Ehem, fix build break in web from last commit. Hard to test a single commit against both native/web, because switching targets clears the entire build cache... 2020-10-09 14:04:56 -07:00
Dustin Carlino
1ae4c6e41f Make the web CityPicker do all of the same stuff that app.switch_map does 2020-10-09 14:02:08 -07:00
Dustin Carlino
1de7065562 Move a few things from App down to PerMap: layer, suspended_sim,
prebaked
2020-10-09 13:50:30 -07:00
Dustin Carlino
906dc0a8e5 Rearrange responsibilities of App::new and PerMap::new, to prepare for
cleaning up switch_map
2020-10-09 13:35:51 -07:00
Dustin Carlino
dd0df29571 Suppress the trip summaries tab if we have no prebaked data to compare to 2020-10-09 13:04:36 -07:00
Dustin Carlino
b9d3052c87 Show the elapsed time in the web loading screen, to kind of reassure people things aren't frozen 2020-10-09 09:14:24 -07:00
Dustin Carlino
f1ec2fa4c4 Convert more doc comments for abstutil, convert_osm, geom, sim 2020-10-08 21:13:08 -07:00
Dustin Carlino
93c295b9ae Convert comments on public things to doc comments for map_model. 2020-10-08 20:45:41 -07:00
Dustin Carlino
7236fa558f Fix clicking on regions in citypicker. #21 2020-10-08 17:02:08 -07:00
Dustin Carlino
17416d9fd6 Start deploying the web build to s3... #21 2020-10-08 16:29:06 -07:00
Dustin Carlino
31854344ec Proper loading screen for web. #21 2020-10-08 15:07:23 -07:00
Dustin Carlino
62b3af324b Bundle data/MANIFEST.json in wasm. Now loading all maps from HTTP works! #21 2020-10-08 14:41:02 -07:00
Dustin Carlino
4d66e4e91d Make the city picker list maps from the manifest, not local files. #21 2020-10-08 14:26:35 -07:00
Dustin Carlino
fd004a59bf Fix a few broken dropbox links caused by doing the cutover in the previous commit 2020-10-08 13:57:49 -07:00
Dustin Carlino
d09ead3672 Use serde for data/MANIFEST 2020-10-08 13:14:40 -07:00
Dustin Carlino
989d5243b1 Move the data/manifest utils to abstutil, so the game crate can know
about all files that exist, even if they're not downloaded locally
(native) or to load other maps (web)
2020-10-08 12:50:18 -07:00
Dustin Carlino
d1d1d1532c Silence warnings when compiling wasm 2020-10-08 12:26:54 -07:00
Dustin Carlino
fa4981787d Bake less huge data files into the .wasm. #21
This has the effect of breaking the city loader, because it lists
bundled files to discover other cities. Going to rethink that next.
2020-10-08 11:33:10 -07:00
Dustin Carlino
64bc4ee318
On the web, load different maps by making asynchronous HTTP calls. #21 (#364)
* On the web, load different maps by making asynchronous HTTP calls. #21

This is a very strange, specializd approach; it's unclear how it'll
generalize to reading scenarios and prebaked results. Ideally we could
call abstutil::read_binary as we currently do and somehow hide this async
trickery underneath, but I'm not sure how yet. In the meantime, this
moves us forward with the hack well-contained.

Next steps for web: stop bundling in all of data/system in the .wasm,
now that we can load from HTTP.
2020-10-08 10:51:13 -07:00
Dustin Carlino
69c8ce4cbe Before the .wasm loads, display "Loading" 2020-10-07 23:02:10 -07:00
Dustin Carlino
79e313da24 When crashing, dump edits to a file instead of STDOUT. They take too much space and sometimes overflow the terminal's buffer. 2020-10-07 15:53:27 -07:00
Dustin Carlino
2c3fd09378 Add an example Python tool that works with the JSON map export. Support
specifying trip endpoints by building or intersection when importing
traffic demand data.
2020-10-07 15:37:59 -07:00
Dustin Carlino
536429f37f Fix lakeslice again. Some manually fixed traffic signals weren't
imported, because they referenced way IDs from before the service road
import. That happened after a bad Cargo.lock merge undid the effects of
pinning to the latest seattle_traffic_signals.
2020-10-07 15:06:03 -07:00
Michael Kirk
2ed916e89f
show parking intent (#362) 2020-10-07 14:16:58 -07:00
Dustin Carlino
0f806b2055 Document the sim crate 2020-10-06 18:25:39 -07:00
Dustin Carlino
a3b7ed18cd Cache the unedited map, for #361 2020-10-06 16:58:48 -07:00
Dustin Carlino
84e50d561d Workaround one case of #361 in an expensive way: temporarily revert
map edits when viewing the "before" version of a trip.
2020-10-06 15:35:11 -07:00
Dustin Carlino
d844646cb9 Implement per-road caps for #325, necessitating a tiny map edits version
bump.
2020-10-06 14:17:55 -07:00
Dustin Carlino
24c20e1599 Add a layer to visualize congestion caps. #325 2020-10-06 13:47:53 -07:00
Dustin Carlino
6fd8422cf5 Woops, fix headless build break 2020-10-06 13:05:23 -07:00
Dustin Carlino
34920064ed Fix some Unicode characters crashing in web (ea9ce84336) 2020-10-06 09:17:09 -07:00
Dustin Carlino
68a5731e41 Fix mistake in git merge 2020-10-05 20:32:08 -07:00
Dustin Carlino
f258c50595 Organize import blocks using https://github.com/dabreegster/organize_rust_imports 2020-10-05 20:29:22 -07:00
Dustin Carlino
27d94945c6 Manually move mod block after the use block, to match what CLion does. 2020-10-05 20:29:22 -07:00
Dustin Carlino
41ecd62e69 Support textures on the web as well 2020-10-05 19:50:52 -07:00
Dustin Carlino
b9eda7305a Fix the web canvas size. I was mixing examples improperly; our code appends a canvas to the DOM dynamically, so we don't need to hardcode one. 2020-10-05 19:50:52 -07:00
Dustin Carlino
6cce3b1946 Make z-order changes work on web too, restoring tooltips 2020-10-05 19:50:52 -07:00
Dustin Carlino
982b0bc194 Support opening new browser tabs on web. The webbrowser crate claims it's experimental, but works fine for me, and the impl is pretty much what I'd try anyway. 2020-10-05 19:50:52 -07:00
Dustin Carlino
bb6dbb0731 Switch from stdweb to websys for #21.
When I added web support in February, it was easier to get started with
stdweb, since it has the nice cargo web tool. However, stdweb is
unmaintained, winit is deprecating support for it, and the next steps
for web (downloading maps dynamically) have better support for web-sys.

With Alvin's guidance, I got
https://github.com/dabreegster/minimal_websys_winit_glow_demo working
first. This PR cuts A/B Street over too.

I tested abst and the widgetry demo in both native and web. The only
major regression from stdweb is the canvas placement and size. I
attempted some fixes, but at this point, I'll leave it as a smaller
followup instead.
2020-10-05 19:50:52 -07:00
Michael Kirk
14cbb0f0c1
update panels and their scrollbars when window resizes (#358)
* match unfork to fork

TBH I don't know of problem currently being caused by this, but it
seemed wrong to unfork without a matching fork.

* variable rename (no behavior change)

"c" was holdover from when panels were called composites

* resize container dims when window resizes

* make panel.top_level private

* Show/Hide scrollbars as window is resized

* alignment demo

* Fix scrollbar positioning

* separate out scrollbar work so we can profile it easier

* mem::replace is more concise than mem::swap

* fixup size of MaxPercent

* restore scroll position after redrawing scroll bars
2020-10-05 17:46:50 -07:00
Dustin Carlino
ac342445ed Cleanup: Use roxmltree instead of quick-xml to parse kml 2020-10-05 16:25:11 -07:00
Dustin Carlino
5706226790 Also lift list_all_objects. Now the native/web IO stuff has a smaller surface area, making it easier to add more web support for #21. 2020-10-05 15:03:49 -07:00
Dustin Carlino
e5365254e9 Make load_all_objects IO-backend (native/web) agnostic 2020-10-05 14:48:34 -07:00
Dustin Carlino
e973d1e5a1 Organize abstutil io into a native and web crate 2020-10-05 14:16:29 -07:00
Dustin Carlino
dd252d45e2 Remove the long unusued abstutil Profiler (originally for measuring cumulatively how long part of an inner loop takes) 2020-10-05 12:23:26 -07:00
Dustin Carlino
67268f5461 Organize abstutil a little better. Split out modules for generating the data/ paths and for working with serde. 2020-10-05 12:20:52 -07:00
Dustin Carlino
178404bd0e Remove unused RNG stuff from abstutil, and start to think about how to tease it apart a bit 2020-10-05 11:48:29 -07:00
Dustin Carlino
a5cf5877e6 Experiment with focusing on negative space 2020-10-05 10:13:28 -07:00
Dustin Carlino
8e49aac42f Make traffic seitan close roads that agents are about to use, causing a
crash. And start to figure out the debugging story.
2020-10-05 08:49:16 -07:00
Dustin Carlino
5b84ac897c new release 2020-10-04 15:34:54 -07:00