creator function

Element Function(Element, [JSAny?, int?, List<Element?>?]) creator(
  1. String name
)

Given the specified element name, returns a function which creates an element of the given name, assuming that thisArg is the parent element.

This method is used internally by selection.append and selection.insert to create new elements. For example, this:

selection.append("div".u22);

Is equivalent to:

selection.append(d4.creator("div").u21);

See namespace for details on supported namespace prefixes, such as for SVG elements.

Implementation

Element Function(Element, [JSAny?, int?, List<Element?>?]) creator(
    String name) {
  var fullname = namespace(name);
  return fullname.split(
    (fullname) => _creatorFixed(fullname),
    (name) => _creatorInherit(name),
  );
}