Hey, I have the following template: a go.Part
with a shape and a picture.
const nodeTemplate = $(
go.Part,
go.Panel.Spot,
{
isClipping: true,
resizable: true,
scale: 1,
// Transparent cannot cast a shadow
background: "red",
isShadowed: true,
},
$(go.Shape, "Circle", { strokeWidth: 0 }),
$(go.Picture, img, {
stretch: go.GraphObject.Fill,
})
);
I want to associate a shadow specifically with the shape or the picture, but I’m facing some issues:
- I don’t want the panel to have a background - it should be transparent.
- The
isShadowed
property doesn’t work with a transparent background as it is mentionned in the doc. - I can’t apply
isShadowed
directly to the picture or shape.
I’ve tried several approaches, such as:
- Setting
isClipping
on thego.Part
. - Using
go.Brush
, which technically works, but it’s extremely difficult to maintain for different shapes, resizing…
Is there a simpler way to achieve this? How can I associate the shadow to the circle or the picture ?
This is a Codesandbox example: https://codesandbox.io/p/sandbox/gojs-custom-shadow-forum-qmpl2c