Contents Menu Expand Light mode Dark mode Auto light/dark mode
svgwrite 1.4.3 文档
svgwrite 1.4.3 文档

内容/Contents

  • 概述
    • 核心属性
    • 条件处理属性
    • 文档事件属性
    • 图形事件属性
    • 演示属性
    • XLink 属性
  • SVG 参考
  • 其他 SVG 文档
  • SVG 实现状态

模块/Modules

  • svgwrite 模块
  • utils 模块

结构对象/Structural Objects

  • BaseElement
  • Drawing
  • SVG
  • Group
  • Defs
  • Symbol
  • Marker
  • Use
  • Hyperlink
  • Script
  • Style

绘制对象/Graphical Objects

  • Path
  • Line
  • Rect
  • Circle
  • Ellipse
  • Polyline
  • Polygon
  • Basic Shapes Examples
  • Image

文本对象/Text Objects

  • Text
  • TSpan
  • TRef
  • TextPath
  • TextArea

绘图服务/Paint server

  • 线性渐变/LinearGradient
  • 径向渐变/RadialGradient
  • 图案/Pattern
  • SolidColor

遮盖/Masking

  • ClipPath
  • Mask

动画/Animation

  • animate 模块
  • Set
  • AnimateMotion
  • Animate
  • AnimateColor
  • AnimateTransform
  • SVG 动画属性
    • Animation Events Attributes
    • Animation Target Attributes
    • Animation Timing Attributes
    • Animation Value Attributes
    • Animation Addition Attributes

滤镜效果/Filter Effects

  • Introduction
  • Filter Element
  • 滤镜原语概述
  • 滤镜原语的通用svg属性
  • feBlend 滤镜元素
  • feColorMatrix 滤镜元素
  • feComponentTransfer 滤镜元素
  • feComposite 滤镜元素
  • feConvolveMatrix 滤镜元素
  • feDiffuseLighting 滤镜元素
  • feDisplacementMap 滤镜元素
  • feFlood 滤镜元素
  • feGaussianBlur 滤镜元素
  • feImage 滤镜元素
  • feMerge 滤镜元素
  • feMorphology 滤镜元素
  • feOffset 滤镜元素
  • feSpecularLighting 滤镜元素
  • feTile 滤镜元素
  • feTurbulence 滤镜元素
  • feDistantLight 滤镜元素
  • fePointLight 滤镜元素
  • feSpotLight 滤镜元素

MixIns

  • ViewBox Mixin
  • Transform Mixin
  • XLink Mixin
  • Presentation Mixin
  • MediaGroup Mixin
  • Markers Mixin
  • Clipping Mixin

扩展/Extensions

  • Inkscape 扩展
Back to top

Hyperlink#

Hyperlink 类代表 SVG a 元素。

The Hyperlink class represents the SVG a element.

class svgwrite.container.Hyperlink(href, target='_blank', **extra)#

The a element indicate links (also known as Hyperlinks or Web links).

The remote resource (the destination for the link) is defined by a <URI> specified by the XLink xlink:href attribute. The remote resource may be any Web resource (e.g., an image, a video clip, a sound bite, a program, another SVG document, an HTML document, an element within the current document, an element within a different document, etc.). By activating these links (by clicking with the mouse, through keyboard input, voice commands, etc.), users may visit these resources.

A Hyperlink is defined for each separate rendered element contained within the Hyperlink class; add sublements as usual with the add method.

参见

http://www.w3.org/TR/SVG11/linking.html#AElement

Hyperlink.__init__(href, target='_blank', **extra)#
参数:
  • href (string) – hyperlink to the target resource

  • target (string) – '_blank|_replace|_self|_parent|_top|<XML-name>'

  • extra – additional SVG attributes as keyword-arguments

父类#

Parent Classes

  • svgwrite.base.BaseElement

  • svgwrite.mixins.Transform

  • svgwrite.mixins.Presentation

SVG 属性#

SVG Attributes

  • class – string

    为元素分配一个或多个 CSS 类名。

  • style – string

    允许直接在指定元素上定义每个元素的 CSS 样式规则。

  • externalResourcesRequired – bool

    False:如果文档渲染可以继续进行,即使外部资源不可用;否则为 True。

  • transform – 使用 svgwrite.mixins.Transform 接口。

  • xlink:href – string – href 参数。

  • xlink:show – 'new|replace'

    使用 target 属性。

  • xlink:actuate – 'onRequest'

    此属性为支持 XLink 的处理器提供文档信息,指示应用程序应仅在触发用于遍历的加载后事件时,从起始资源跳转到目标资源。

  • target – string – target 参数。

    此属性指定目标窗口、框架、面板、标签页或其他相关显示上下文(例如 HTML 或 XHTML 的 frame、iframe 或 object 元素)中的名称或部分,以便在链接激活时打开文档。

    • _replace:当前 SVG 图像在相同的矩形区域内被链接内容替换,且位于相同的框架中。

    • _self:当前 SVG 图像在相同的框架内被链接内容替换。如果未指定 target 属性,则该值为默认值。

    • _parent:当前 SVG 图像的直接父框架集被链接内容替换。

    • _top:整个窗口或标签页的内容(包括任何框架)被链接内容替换。

    • _blank:请求在一个新的未命名窗口或标签页中显示链接内容。如果失败,则效果与 _top 相同。

    • <XML-Name>:指定用于显示链接内容的框架、面板或其他相关显示上下文的名称。如果该名称已存在,则复用该窗口并替换其内容;如果不存在,则创建新的窗口(类似于 _blank,但该窗口具有指定的名称)。

  • class – string

    assigns one or more css-class-names to an element

  • style – string

    allows per-element css-style rules to be specified directly on a given element

  • externalResourcesRequired – bool

    False: if document rendering can proceed even if external resources are unavailable else: True

  • transform – use svgwrite.mixins.Transform interface

  • xlink:href – string – href parameter

  • xlink:show – 'new|replace'

    use the target attribute

  • xlink:acuate – 'onRequest'

    This attribute provides documentation to XLink-aware processors that an application should traverse from the starting resource to the ending resource only on a post-loading event triggered for the purpose of traversal.

  • target – string – target parameter

    This attribute specifies the name or portion of the target window, frame, pane, tab, or other relevant presentation context (e.g., an HTML or XHTML frame, iframe, or object element) into which a document is to be opened when the link is activated.

    • _replace: The current SVG image is replaced by the linked content in the same rectangular area in the same frame as the current SVG image.

    • _self: The current SVG image is replaced by the linked content in the same frame as the current SVG image. This is the lacuna value, if the target attribute is not specified.

    • _parent: The immediate frameset parent of the SVG image is replaced by the linked content.

    • _top: The content of the full window or tab, including any frames, is replaced by the linked content

    • _blank: A new un-named window or tab is requested for the display of the linked content. If this fails, the result is the same as _top

    • <XML-Name>: Specifies the name of the frame, pane, or other relevant presentation context for display of the linked content. If this already exists, it is re-used, replacing the existing content. If it does not exist, it is created (the same as _blank, except that it now has a name).

标准 SVG 属性#

Standard SVG Attributes

  • Core Attributes

  • Conditional Processing Attributes

  • Graphical Event Attributes

  • Presentation Attributes

  • XLink Attributes

Next
Script
Previous
Use
Copyright © 2014-2019, Manfred Moitzi <me@mozman.at>
Made with Sphinx and @pradyunsg's Furo
On this page
  • Hyperlink
    • Hyperlink
      • Hyperlink.__init__()
    • 父类
    • SVG 属性
    • 标准 SVG 属性