openlectures / subway.js

Javascript app to display an interactive subway map.
18 stars 6 forks source link

Arrow goes haywire after scaling #21

Open kenlimmj opened 11 years ago

kenlimmj commented 11 years ago

After changing blocksize and station radius, the connector radius has to be manually elucidated, and the arrow itself has to be scaled up or down separately when scaling the track size. Ideally these should all tag to blocksize.

kenlimmj commented 11 years ago

Oh, realized also that diagonal arrows are not supported. So if a track comes in at a straight diagonal (e.g. from 1,1 to 2,2), then have to straighten it out before applying the arrow

yichenshen commented 11 years ago

I'll fix the diagonal arrow thing soon, as by right if I make the joints round on the track you can force a diagonal in without making it look too ugly. Implementing that part on the GUI is a different story.

kenlimmj commented 11 years ago

Just saw this repo JS:

https://github.com/bramp/js-sequence-diagrams/blob/master/src/sequence-diagram.js

It's basically a UML Diagram generator written in JS, but they've use Raphael for the graphics library. They draw arrowheads! Haven't gotten the chance to look at the code in detail, but from a cursory glance it looks like it'd be around line 403 onwards.

yichenshen commented 11 years ago

yup, but all their arrows are black, Raphael has a bug which turns all arrowheads into the last colour you feed into it. E.g. I draw a blue track, then I draw a red track, both with arrowheads, then blue track will have red arrowhead.

They're updating Raphael again though (finally), so hopefully in a short while it'll get fixed. The we can set arrowheads like they do, with Element.attr("arrow-head","round") or sth like that.

I'm rather interested in their arrangement methods too, maybe we can use something from it.