create function

Selection create(
  1. String name
)

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

d4.create("svg"); // equivalent to svg:svg
d4.create("svg:svg"); // more explicitly
d4.create("svg:g"); // an SVG G element
d4.create("g"); // an HTML G (unknown) element

This method assumes the HTML namespace, so you must specify a namespace explicitly when creating SVG or other non-HTML elements; see namespace for details on supported namespace prefixes.

Implementation

Selection create(String name) {
  return select(creator(name)(document.documentElement!).u22);
}