本文整理汇总了Golang中github.com/ajstarks/svgo.SVG.Gid方法的典型用法代码示例。如果您正苦于以下问题:Golang SVG.Gid方法的具体用法?Golang SVG.Gid怎么用?Golang SVG.Gid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/ajstarks/svgo.SVG
的用法示例。
在下文中一共展示了SVG.Gid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: relationsGroup
func (c *Canvas) relationsGroup(canvas *svg.SVG) {
canvas.Gid("relations")
defer canvas.Gend()
for _, relation := range c.relations {
relation.usage(canvas)
}
}
示例2: servicesGroup
func (c *Canvas) servicesGroup(canvas *svg.SVG) {
canvas.Gid("services")
defer canvas.Gend()
for _, service := range c.services {
service.usage(canvas, c.iconIds)
}
}
示例3: definition
func (c *Canvas) definition(canvas *svg.SVG) {
canvas.Def()
defer canvas.DefEnd()
// Service block.
canvas.Group(`id="serviceBlock"`,
`transform="scale(0.8)"`)
io.WriteString(canvas.Writer, assets.ServiceModule)
canvas.Gend() // Gid
// Relation health circle.
canvas.Gid("healthCircle")
canvas.Circle(
healthCircleRadius,
healthCircleRadius,
healthCircleRadius,
fmt.Sprintf("stroke:%s;fill:none;stroke-width:%dpx", relationColor, relationLineWidth),
)
canvas.Circle(
healthCircleRadius,
healthCircleRadius,
healthCircleRadius/2,
fmt.Sprintf("fill:%s", relationColor),
)
canvas.Gend()
// Service and relation specific defs.
for _, relation := range c.relations {
relation.definition(canvas)
}
for _, service := range c.services {
service.definition(canvas, c.iconsRendered, c.iconIds)
}
}