I think this works:
[code] var $ = go.GraphObject.make;
var white = “rgba(255,255,255,0.5)”;
var color = “rgba(127,127,255,0.5)”;
var endbrush = $(go.Brush, go.Brush.Radial, { 0: white, 1: color });
var midbrush = $(go.Brush, go.Brush.Linear, { 0: color, 0.5: white, 1: color });
myDiagram.nodeTemplateMap.add("SpecialBrush",
$(go.Part, "Table",
{ resizable: true, rotatable: true },
new go.Binding("desiredSize", "size").makeTwoWay(),
$(go.RowColumnDefinition, { column: 0, sizing: go.RowColumnDefinition.None }),
$(go.Panel,
{ column: 0, stretch: go.GraphObject.Vertical },
new go.Binding("width", "size", function(s) { return s.height/2; }),
$(go.Shape, "Circle",
{ stretch: go.GraphObject.Fill },
new go.Binding("width", "size", function(s) { return s.height; }),
{ stroke: null, strokeWidth: 0, fill: endbrush })
),
$(go.RowColumnDefinition, { column: 1, sizing: go.RowColumnDefinition.ProportionalExtra }),
$(go.Shape,
{ column: 1, stretch: go.GraphObject.Fill },
{ stroke: null, strokeWidth: 0, fill: midbrush }),
$(go.RowColumnDefinition, { column: 2, sizing: go.RowColumnDefinition.None }),
$(go.Panel,
{ column: 2, stretch: go.GraphObject.Vertical, angle: 180 },
new go.Binding("width", "size", function(s) { return s.height/2; }),
$(go.Shape, "Circle",
{ stretch: go.GraphObject.Fill },
new go.Binding("width", "size", function(s) { return s.height; }),
{ stroke: null, strokeWidth: 0, fill: endbrush })
)
));
myDiagram.model.addNodeData({ category: "SpecialBrush", size: new go.Size(140, 40) });[/code]
Here is the above Part plus a copy that was resized:
This uses clipping of the two Circle Shapes to just show half of the circular gradient.
This also uses data binding to maintain the correct widths as the user resizes the whole Part. Of course if you don’t need to support resizing, you can hard-code the actual width and height values.
But when the total width is less than the height, it just clips the right end of the whole part. One could customize the ResizingTool to prevent that.