Trying to Center TextBlock Text in a Node

I have the following Node Template:

        var texttemplate = GO(go.Node, "Horizontal", 
                      GO(go.TextBlock,
                                                new go.Binding("text", "text"), 
                                                new go.Binding("font", "fontType"),
                                                    new go.Binding("textAlign", "textAlign")
                                                ),
                                                    new go.Binding("location", "shapePosition"),
                                                    new go.Binding("angle", "rotation"),
                                                  new go.Binding("width", "width"), 
                                                  new go.Binding("height", "height"),
                                                    new go.Binding("layerName", "layer")
                                                
                                            )

When I pass this Template the following data:

  width: 180
  height: 20
  text: "Row: N_LFT  Seat: 19"
  textAlign: "center"

The text is not actually centered. What should I do?

Here is a screenshot of the selected Part which demonstrates that width of the Node far surpasses the Text Width, which, according to my probably incorrect understanding, should cause the textAlign: center to be applied.

TextBlock.textAlign controls where within the bounds of the TextBlock the text glyphs are drawn. It does not change the size or position of the TextBlock.

Does the blue rectangle in your screenshot actually show the bounds of the TextBlock? If so, I’m surprised that the text isn’t centered within that blue box.

It shows the bounds of the Node which contains the TextBlock. So I suppose I need to explicitly set the width and height of the TextBlock to be equivalent to the parent Node dimensions, so that the textAlign property, when set to equal "center", moves the text to be centered within the above blue box?

If I understand you correctly, yes, I think you have the right idea.

Alternatively, use a Panel such that the TextBlock is in the middle of the Panel. For example, you could use a Spot Panel.