Database News

I finally managed to whip one of my long-standing Strathspey SCD Database enhancements into shape to a point where I feel reasonably confident about releasing it into the wild. So … drum roll … please welcome the Graphical Dance List Editor!

SCDDB Graphical List Editor

The problem we're trying to solve is the following: You're making the programme for an upcoming event and you have a good selection of dances you want to use, but now you have to put them in a suitable order. Of course you want to avoid a situation where three dances in a row start with “cross, cast, half a figure of eight” or there are lots of dances with reels of three in the first half of the programme and none in the second. Sure, in the textual list you can always click on the “diagram” icon to pop up a diagram for a dance (if the database has one) and check, but wouldn't it be nice to be able see all the diagrams all the time? That would make it a lot easier to tell at a glance whether there is something weird about your programme.

This is where the Graphical List Editor comes in. You can access it by activating the “Graphical” switch near the top of the “Edit Dance List” page for the list in question. This will replace the usual tabular display of dances by one where diagrams for the dances on the list are arranged in columns (in order, top to bottom then left to right). You can drag and drop the diagrams in order to change their position in the sequence; the trick behind this is to pay attention to the top edge of the diagram, which will determine where the diagram goes if it is moved. If you want to slot in a dance between two others, then drag the diagram of that dance such that its top edge is in the empty space between the two other dances. If you drop the diagram there, the other two dances will make room to accommodate your dance. Easy!

The grey vertical line separates the actual list from the “scratch space”, which can be used to store dances that haven't yet been assigned a place in the list. The editor doesn't make an attempt to reorder the dances in the scratch space – these pretty much stay where they're dropped – but will move them out of the way if the demarcation line moves (which it will if enough dances are added or removed to the actual list).

Clicking on the “x in a circle” icon in the top left of a diagram removes that dance from the list. You will also notice that the coloured bar at the left edge of a diagram corresponds to the colour we're using for that dance type in the textual lists – red for reels, yellow (or “jaune” as our French friends would say) for jigs, blue for strathspeys and green for medleys. This makes the dance types a lot easier to see.

You can of course use the standard “Add dance” and “Add other item” boxes at the bottom of the diagram to add more dances (and other items), which will appear at the end of the list in the left-hand part of the editor. Dances without diagrams and other items will just be displayed as fairly short placeholder boxes. In fact it is not a problem to start with a completely empty list and just add stuff. If a column becomes too tall, a new one will be started automatically; in theory this can go on infinitely but you will have to scroll to see the end of the list, and at some point your browser will probably object because web pages can be only so many pixels wide. (The height of the graphical editor's working area has been carefully picked to look good on my rather big screen; it is hard to adjust this automatically but I may eventually make this a per-list configuration item to be changed in the list settings.)

The graphical and textual editors for a list are synchronised such that any changes in the graphical editor will also be applied to the textual editor and vice versa. You can amuse yourself by opening the textual editor for a list in one window and the graphical editor for the same list in another, and watch how changes in one magically appear in the other. Of course this also works if several people are looking at the list on several different computers.

I have deliberately not tried to replicate every feature of the textual editor in the graphical editor, so you will still need to use the textual editor to set times, assign recordings, or add notes to items. There are several reasons for this – one is that it is surprisingly difficult to put a pop-up menu on a dance diagram in the graphical editor, because the graphical editor is based on SVG and the pop-up menus are based on HTML. Those two work together after a fashion but are not completely compatible. (I actually figured out a way to do it but then thought better of it; it would have been too hackish for comfort.) The “x in a circle” icon, OTOH, is a much more straightforward proposition.

Anyway, this is a nice little feature and I hope it will be useful to some people (including myself). As usual, if you have comments or suggestions then let's have them. And there are more things coming down the pipe, too.