2014-01-02

Custom Booklets

Experimental support for custom booklets is up at:

http://travellermap.com/booklet.html

I've tested this in Chrome and Firefox. If it works in IE it will require at least IE9. You can use your own data or pick an existing sector, although for an existing sector it's faster to just use http://travellermap.com/booklet.html?sector=name

A lot of "fancy" script and Web Platform APIs are used, so it may be fragile. To fetch custom images using form within a page requires using the FormData, XMLHttpRequest with response type Blob and FileReader, and since there's a gob of asynchronous processing that needs to go on I bit the bullet and used ECMAScript 6 "Promisespolyfill I had sitting around. If none of that makes sense, you can take away that it's more programming voodoo than usual.

I also had to implement HTTP POST support for the sector data and sector metadata APIs; it's pretty boring - they just parse what you send and spit it back out, but it can be used to parse SEC and get T5 Tab Delimited, or MSEC and get JSON out.

Ω

25 comments:

agorski said...

Seems to work fine in Safari on Mavericks but the page order seems odd if you actually want to print out a booklet instead of just printing out 2 pages per sheet.

77topaz said...

Hmm... worlds with atmospheres D-F no longer count as having fluid hydrographics? They seem to be rendered the same as codes 2-9 now.

Joshua Bell said...

@agorski:

True. Great for putting in a 3-ring binder, though! There's a TODO item for generating them as PDF on the server, which would be properly paginated.

@77topaz:

Yeah, intentional - about 3 months back, per discussion with DonM

https://github.com/inexorabletash/travellermap/commit/1da420184ea327ec74c57db4d12891b2b896dfe7

77topaz said...

I've finished sector data for Spangele Sector and uploaded it to Explorerbase!

BeRKA said...

This is utterly cool and useful!

Joshua Bell said...

@77topaz: Do you have a text file for Spangele anywhere in a plain text file? The data on explorerbase always requires some munging to be useful since the spaces are collapsed. :(

It looks like you can use wikitext markup on explorer base - could you post the files with:

[[code]]
sector data here...
[[code]]

to preserve the formatting?

77topaz said...

I'll try and see if that works.

77topaz said...

Hm, using [[code]] just inserted < span > blocks of code on each line, and it didn't even fit the collapsing spaces as far as I can tell. :/

77topaz said...

I had to remove the [[code]] stuff as it only made things worse, by inserting extra code everywhere (it didn't even fix the collapsing spaces). Since there are few inhabited worlds in this particular sector, I don't there should be many problems with the "non-code" data.

Craig A. Glesner said...

Well, I have an iPad and its version of Safari and my Far Stars sector (which works fine with the Post function) and when I try it I just get a "Processing Data". This hangs up and refuses to go further and I have waited 5 and the second time 20 minutes so it wasn't like I was got antsy and impatient.

Any ideas?

Reaver said...

Fantastic utility. Thanks.

However, when I now render a sector (for example the Spinward Marches), the allegiance borders are not drawn either on the sector map or the sub sector maps. The borders used to draw when I used the utility a week ago. Has something changed?

Joshua Bell said...

Whoops, something broke. I'll fix tonight.

Joshua Bell said...

Borders are fixed, sorry about that.

Reaver said...

Hey Joshua,

I tried using the booklet generator again (as of Friday, Jan 17 @ 1:40pm EST) and the borders and x-boat routes were still not being displayed.

Were your fixes posted to the Traveller map site?

Joshua Bell said...

Hmmm, yeah, maybe I pushed the wrong file. I'll fix.

Reaver said...

Hi Joshua,

Some further investigation revealed that if I use "http://www.travellermap.com/sector.htm?sector=Spinward%20Marches" to generate the booklet then everything works fine.

However, if I use the GUI at "http://travellermap.com/booklet.html" to generate the booklet, then borders and x-boat routes are not displayed.

I hope this helps.

Joshua Bell said...

booklet.html is fixed. sector.html will be removed soon, it's an older version.

Sorry about that.

Reaver said...

Hi Joshua,

Sorry to keep harping on this, but as of Saturday morning, booklet.html is not working properly. It still does not display borders and x-boat routes (tested using Safari and Firefox on OSX 9.1).

Furthermore, on comparing with the output from sector.html, the booklet.html output also does not display all the extended UWP information. What I mean is the Remarks get truncated; {Ix}, (Cx), [Ex], Nobles, and Worlds is missing. Compare the outputs for the planet Regina to see what I mean.

Sorry to be such a pest. Keep up the great work.

Please realize that this site is fantastic and appreciated by all us Traveller fans.

Joshua Bell said...

@Reaver - thanks for your patience.

There were two bugs causing the borders to disappear, one affecting both data via GUI and data via URL, and one affecting just data via GUI. I fixed the former but didn't also test the latter.

Should be fixed.

The "truncated data" is because the page was pulling "legacy" format rather than T5SS format. At the risk of confusing users, I'll make it pull T5SS format and see how it goes.

Reaver said...

Hi Joshua,

Borders and x-boats are back!!! Yay!

However, all the UWP information is missing. Each subsector world listing now say there are no worlds in the subsector even though the map correctly displays all the worlds.

Joshua Bell said...

Ugh. Try now?

Reaver said...

No change. UWP data is still missing.

Joshua Bell said...

Hrm, works in Chrome and Firefox but not Safari. That's odd. Looking...

Joshua Bell said...

Okay, I believe I've fixed it in Safari, but please let me know.

(I also fixed CORS preflight requests, which Safari was using but wouldn't have affected using the service from the site itself.... but did hold up local debugging in Safari.)

https://github.com/inexorabletash/travellermap/commit/849e4395c4768767c6c8739901caa92139c7aa95

Reaver said...

Hi Joshua,

Everything now looks good when using Safari. Hip-Hip-Hurray!!!

Your diligence in fixing this problem is much appreciated. Thanks.