svgwrite
stable

Contents

  • Overview
  • SVG References
  • Additional SVG Documentation
  • SVG Implementation Status

Modules

  • svgwrite module
  • utils module

Structural Objects

  • BaseElement
  • Drawing
  • SVG
  • Group
  • Defs
  • Symbol
  • Marker
  • Use
  • Hyperlink
    • Parent Classes
    • SVG Attributes
    • Standard SVG Attributes
  • 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 module
  • Set
  • AnimateMotion
  • Animate
  • AnimateColor
  • AnimateTransform
  • SVG Animation Attributes

Filter Effects

  • Introduction
  • Filter Element
  • Filter Primitives Overview
  • Common SVG Attributes for Filter Primitives
  • feBlend Filter Element
  • feColorMatrix Filter Element
  • feComponentTransfer Filter Element
  • feComposite Filter Element
  • feConvolveMatrix Filter Element
  • feDiffuseLighting Filter Element
  • feDisplacementMap Filter Element
  • feFlood Filter Element
  • feGaussianBlur Filter Element
  • feImage Filter Element
  • feMerge Filter Element
  • feMorphology Filter Element
  • feOffset Filter Element
  • feSpecularLighting Filter Element
  • feTile Filter Element
  • feTurbulence Filter Element
  • feDistantLight Filter Element
  • fePointLight Filter Element
  • feSpotLight Filter Element

MixIns

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

Extensions

  • Inkscape Extension
svgwrite
  • Docs »
  • Hyperlink
  • Edit on GitHub

Hyperlink¶

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.

See also

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

Hyperlink.__init__(href, target='_blank', **extra)¶
Parameters:
  • 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 Attributes¶

  • 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).

Standard SVG Attributes¶

  • Core Attributes
  • Conditional Processing Attributes
  • Graphical Event Attributes
  • Presentation Attributes
  • XLink Attributes
Next Previous

© Copyright 2014-2019, Manfred Moitzi <me@mozman.at> Revision cd10a7ed.

Built with Sphinx using a theme provided by Read the Docs.