4 return new THREE.SVGRenderer();
11 if ((typeof doc==
'undefined') && (typeof window==
'object')) doc = window.document;
20 createElementNS:
function(ns,kind) {
24 setAttribute:
function(name, value) {
25 this._wrapper.path_attr[name] = value;
30 console.error(
'not supported element for SVGRenderer', kind);
37 style: this.svg_style,
38 setAttribute:
function(name, value) {
39 this._wrapper.svg_attr[name] = value;
41 appendChild:
function(node) {
42 this._wrapper.accPath +=
'<path style="' + this._wrapper.path_attr[
'style'] +
'" d="' + this._wrapper.path_attr[
'd'] +
'"/>';
43 this._wrapper.path_attr = {};
45 removeChild:
function(node) {
52 rndr = Create(doc_wrapper);
54 rndr.doc_wrapper = doc_wrapper;
56 rndr.makeOuterHTML =
function() {
58 var wrap = this.doc_wrapper;
60 var _textSizeAttr =
' viewBox="' + wrap.svg_attr[
'viewBox'] +
'" width="' + wrap.svg_attr[
'width'] +
'" height="' + wrap.svg_attr[
'height'] +
'"';
62 var _textClearAttr =
'';
64 if (wrap.svg_style.backgroundColor) _textClearAttr =
' style="background:' + wrap.svg_style.backgroundColor +
'"';
66 return '<svg xmlns="http://www.w3.org/2000/svg"' + _textSizeAttr + _textClearAttr +
'>' + wrap.accPath +
'</svg>';
70 rndr.setPrecision(precision);