Palette item vertical single line

I want to create a palette with one vertical line. How can this be implemented?

My code:

this.testPalette.nodeTemplate = $(
    go.Node, 'Vertical',
        { locationObjectName: 'test', locationSpot: go.Spot.Center },
        { width: 80, height: 80 },
        { name: 'test' }
        new go.Binding('text', 'text'))

I just tried this:

      myPalette =
        $(go.Palette, "myPaletteDiv",
            nodeTemplate: $(go.Node,
                            $(go.Shape, "LineV",
                              { strokeWidth: 3, width: 80, height: 80 },
                              new go.Binding("stroke", "color"))

Of course you don’t need to have a Binding for the color of the vertical line – you could hard-code that in your template, especially if you are only going to have one of them.

Sorry for my incorrect question.

I hope create palette with several standard nodes. I want them to be located in one line and not shifted to a new line.

The default behavior is to put them all in one row and then wrap them to fit in the viewport. This is implemented by the Palette.layout, which is a GridLayout.

But if you don’t mind there maybe being a horizontal scrollbar, then you can set GridLayout.wrappingWidth to a large number, so that it won’t (ever?) need to wrap. When initializing the Palette, perhaps:

$(go.Palette, . . .,
    "layout.wrappingWidth": Infinity,
    . . .


This worked for me:

this.testPalette.layout = $(go.GridLayout, { wrappingWidth: 9999 });

And what can work if I need to display the data in the palette in one column?

If the Palette’s DIV is the correct width, that will be the default behavior. But you can force it by setting GridLayout.wrappingColumn to 1.

Thanks Walter. It’s worked.