g6/packages/site/docs/manual/middle/elements/advanced-style/texture.en.md
2023-02-02 10:31:36 +08:00

723 B

title order
Fill with Texture in G6 5

G6 support filling a shape with texture with Image or Data URL.

img

p is the flag for using texture; the text in green can be modified to satisfy your requirements; a is a way of repeating of the texture, which can be changed into:

  • a: Repeat in horizontal and vertical; - x: Repeat only in horizontal; - y: Repeat only in vertical; - n: No repeat.

Assign the fill as below while Configurating the Node or Edge:

shape.attr('fill', 'p(a)https://gw.alipay.com/cube.png');