Function create

  • Given the specified element name, returns a single-element selection containing a detached element of the given name in the current document.

    Type Parameters

    • K extends "symbol" | "filter" | "g" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap

    Parameters

    • name: K

      tag name of the element to be added.

    Returns Selection<ElementTagNameMap[K], undefined, null, undefined>

  • Given the specified element name, returns a single-element selection containing a detached element of the given name in the current document.

    Type Parameters

    Parameters

    • name: string

      Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, such as for SVG elements.

    Returns Selection<NewGElement, undefined, null, undefined>