Page 1 of 3

How to make diagrams

Posted: Fri Apr 23, 2010 11:10 pm
by Joaz Banbeck
A diagram of a go board consists of 6 parts:

1) The opening tag, which is the word 'go' enclosed in brackets. This usually goes on one line by itself.

2) One line which includes several display codes and the label.
                              It starts with two dollar signs ('$$')

                              Next is optional, either a 'B or a 'W', indicating what color is the first move. ( If not specified, it defaults to 'B'. )

                              An optional lower case 'c' can be added for coordinates.

                              An optional lower case 'm' can be added, followed by one or more digits to indicate the number of the first move. ( Defaults to 'm1' )


3) The top of the board, which is two dollar signs and a row of dashes. ( '$$---------------' )

4) Multiple - up to 19 - lines which define the board. Each line should start with two dollar signs ('$$').
                              A period (".") is an empty intersection.

                              A comma (",") is a star point.

                              A vertical line ( "|" )( usually a shifted tab key ) is the edge of the board


5) The bottom of the board, which is two dollar signs and a row of dashes. ( '$$---------------' )

6) The closing tag, which is the word '/go' enclosed in brackets. This usually goes on one line by itself.


Strictly speaking, only parts 1 and 6 are necessary. In practice, usually only 3 or 5 are skipped to form portions of a board.

====================================================================================================================

Here it is:

Click Here To Show Diagram Code
[go]$$c This is a label for the diagram. Remember to replace it with something relevant.
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]

Directly above this sentence, there should be a sentence in blue that says "Click here to show diagram code". It will show you all 6 parts put together.

====================================================================================================================


The above generates a blank board. Now let's look at putting something on the board. To do this, replace the periods with letters, numbers, or other symbols.

X = black stone
O = white stone
* = half black and half white
V = half wood and half white
A = half wood and half black

B = black stone with circle
W = white stone with circle
C = circle on empty intersection
# = black stone with square
@ = white stone with square
S = square on empty intersection
Y = black stone with triangle
Q = white stone with triangle
T = triangle on empty intersection
Z = black stone with X
P = white stone with X
M = X on empty intersection
? = shading

Click Here To Show Diagram Code
[go]$$Wcm31 Thanks to Kirby, \n we can now put line breaks \n in the label. \nAgain, click on the blue line \n below to see how it is done.
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . X X X . . A . * . V . . O O O . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . B . . . . . C . . . . . W . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . # . . . . . S . . . . . @ . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . Y . . . . . T . . . . . Q . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . Z . . . . . M . . . . . P . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . 1 . 2 . 3 . 4 . 5 . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . a . b . c . d . x . y . z . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]


You can also use lowercase letters which appear literally.


Also, a hyphen can be used like this:

Click Here To Show Diagram Code
[go]$$W
$$ -------------------------------
$$ - . . . . . . . - . . . . . . .
$$ - . . . . . . . - . . 1 . . . .
$$ - . 0 3 X . . . - . X O X 3 . .
$$ - . . 4 5 . . . - . . X O . . .
$$ - . . 6 1 . . . - . 2 X O . . .
$$ - . 9 7 8 . . . - . O O X 5 . .
$$ - . . 2 . . . . - . 4 X 6 . . .
$$ - . . . . . . . - . . . . . . .
$$ - . . . . . . . - . . . . . . .[/go]



Lines and Arrows:

Click Here To Show Diagram Code
[go]$$Bc Example: using arrows to show influence
$$ ------------------
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . O O O . O . . .
$$ | . O X X X . . . .
$$ | . X . . . . . . .
$$ | . . X . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ {AR C14 C11}
$$ {AR 5:6 5:9}[/go]


As it is hard to visualize and edit such lines in edit mode, lines and arrows are specified in extra lines - usually after the diagram. The code for the above diagram looks like this:
$$ {AR C14 C11}
$$ {AR 5:6 5:9}
The syntax basically is "$$ {command point1 point2}".
Command can be either ''AR'' for arrows or ''LN'' for lines. Coordinates can be given in two different ways:
1) Board coordinates: this is the usual Go coordinate system. Points are denoted as A1 .. T19. For this to work the diagram has to be anchored in at least one corner, i.e. center diagrams cannot use this method. IOW, if you can switch on coordinates with the $$c option, then this method works.
2) Relative coordinates: points are denoted in 'X:Y' syntax. X and Y are a coordinate system with the root being in the upper left - numbering starts at 1:1. The second arrow in the example uses this system. These coordinates will always work, as they do not rely on borders and corners.

EDIT(10-10-15): For those who don't want to learn the nuts and bolts, Herman Hiddema has a very useful tool at http://hiddema.nl/diagrammer/

Re: How to make diagrams

Posted: Fri Apr 23, 2010 11:50 pm
by mic
Is there a way to create an empty board without copy and paste of an already existing board or typing in all by myself? If yes, I unfortunately have not found it, if not, this would be a nice feature for a button in the editor.

- Mic

Re: How to make diagrams

Posted: Sat Apr 24, 2010 7:12 am
by zenith
People probably have these already (or just copy/paste from existing ones) but I thought I'd stick these empty templates here for reference.

whole board:
$$B 19x19 board
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------


Just a corner:
$$B Corner
$$ ------------------
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . , . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .



Having buttons that load the different layouts within [go] tags would be nice, although I'm not sure how it would be done.

Re: How to make diagrams

Posted: Fri Apr 30, 2010 6:09 pm
by fwiffo
This doesn't cover every option. It uses the same code as Sensei's library, so you can take a look at the Sensei's page on how diagrams work. That page misses a few options related searching, but you can read about them on the Sensei's help page on position search. We don't have a position search function here, but you can use those options in your diagrams.

Re: How to make diagrams

Posted: Mon May 03, 2010 12:00 pm
by Fedya
mic wrote:Is there a way to create an empty board without copy and paste of an already existing board or typing in all by myself? If yes, I unfortunately have not found it, if not, this would be a nice feature for a button in the editor.


qGo has an Import/Export feature, although it includes the coordinates. That, and you have to go through the preferences to change the notation for Black stones -- I believe it uses # by default.

Re: How to make diagrams

Posted: Sun Jun 13, 2010 5:09 pm
by Harleqin
These threads are doubtlessly important, but they now appear constantly at the "View unread posts" list, which is very annoying.

Re: How to make diagrams

Posted: Sun Jun 13, 2010 6:03 pm
by Dante31
Thank you for posting this. Nothing quite like a diagram to show what you mean.

Re: How to make diagrams

Posted: Mon Jun 21, 2010 1:55 pm
by daniel_the_smith
SL has a tool to make a diagram from an SGF, I think it deserves a mention here: http://senseis.xmp.net/tools/sgf2diagram.php

Re: How to make diagrams

Posted: Wed Feb 09, 2011 8:48 am
by Mark356
A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?

Re: How to make diagrams

Posted: Wed Feb 09, 2011 8:53 am
by Kirby
Mark356 wrote:A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?


I see what you're referring to. It may have something to do with the update I made yesterday. I'm investigating it now.

Re: How to make diagrams

Posted: Wed Feb 09, 2011 9:12 am
by Kirby
Mark356 wrote:A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?


Were your diagrams working before?

I can find two issues in the diagrams in your study journal, which might make all of your problems go away:

1.) Do not add extra line breaks after the title line. An example of this is here:

Code: Select all

[go]$$W 

$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . O . . . . . . . . . . . . . O . . |
$$ | . . . . . . . . . . . . X . . . . . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . O O . . . . . . X . O 8 . X . . |
$$ | . . O O X O O . O , . . 6 4 5 9 . . . |
$$ | . . X X X X . . . O . X 2 O 7 X 0 . . |
$$ | . . . . . . . X X O . 1 3 . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$  ---------------------------------------[/go]


Above, you do not need the extra newline after the title line.

2.) You do not need extra spaces before your lines:

Code: Select all

[go]$$B 
  $$ --------------------
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . 3 1 . X . . . |
  $$ , . 4 2 O . , . . . |
  $$ . . . . . . O . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ , . . . . . , . . . |[/go]


Here, there are two leading spaces before each of the lines (except for the title line). If you remove the leading spaces, you should be good to go.

---

Both of these are issues that I can work on fixing by doing some extra parsing of the text, but in the meantime, if you want your diagrams to work, you should be able to apply these format modifications.

Re: How to make diagrams

Posted: Wed Feb 09, 2011 11:08 am
by Mark356
No, they weren't working before. I'd been wondering what was wrong, and wondering if maybe it was just me, since sometimes I'll make a diagram that other people can see but I can't.

But they're fixed now! Apparently it was just a space issue. I don't know how some of those extra spaces got in there, but at least for one of the posts, once they were in one diagram, they were in all of them, since I mostly pasted from one to the next. But it was a simple matter to remove them, and now they look fine. Thanks so much!

Re: How to make diagrams

Posted: Thu Mar 03, 2011 8:23 am
by Kirby
Line wrapping functionality has been added to the diagram annotation feature: viewtopic.php?f=14&t=3340

Re: How to make diagrams

Posted: Thu Jun 09, 2011 2:00 pm
by thequietcenter
It'z too bad when you link to a particular move number in Eidogo you cant export that as SGF :)

Re: How to make diagrams

Posted: Thu Jun 16, 2011 2:22 pm
by thequietcenter
Maybe there should be a way to simply provide SGF for a game and have it display the game at the last move played instead of the first move.