Skip to content

Commit 38d935d

Browse files
committed
Add README
1 parent 01e611e commit 38d935d

File tree

1 file changed

+121
-0
lines changed
  • lib/node_modules/@stdlib/plot/components/svg/defs

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Definitions
2+
3+
> [SVG][svg] plot definitions.
4+
5+
6+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
7+
8+
<section class="intro">
9+
10+
</section>
11+
12+
<!-- /.intro -->
13+
14+
<!-- Package usage documentation. -->
15+
16+
<section class="usage">
17+
18+
## Usage
19+
20+
``` javascript
21+
var Defs = require( '@stdlib/plot/components/svg/defs' );
22+
```
23+
24+
#### Defs()
25+
26+
Returns a `Defs` instance.
27+
28+
``` javascript
29+
var node = new Defs();
30+
// returns <Defs>
31+
```
32+
33+
---
34+
35+
### Methods
36+
37+
<a name="method-render"></a>
38+
39+
#### Defs.prototype.render()
40+
41+
Renders an instance as a [virtual DOM tree][virtual-dom].
42+
43+
``` javascript
44+
var node = new Defs();
45+
46+
var vtree = node.render();
47+
/* e.g., returns
48+
{
49+
'tagName': 'defs',
50+
'properties': {
51+
'namespace': void 0
52+
},
53+
'children': [],
54+
'namespace': 'http://www.w3.org/2000/svg',
55+
'count': 0,
56+
'hasWidgets': false,
57+
'hasThunks': false,
58+
'descendantHooks': false,
59+
'hooks': void 0,
60+
'key': void 0
61+
}
62+
*/
63+
```
64+
65+
</section>
66+
67+
<!-- /.usage -->
68+
69+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
70+
71+
<section class="notes">
72+
73+
</section>
74+
75+
<!-- /.notes -->
76+
77+
<!-- Package usage examples. -->
78+
79+
---
80+
81+
<section class="examples">
82+
83+
## Examples
84+
85+
``` javascript
86+
var toHTML = require( 'vdom-to-html' );
87+
var defs = require( '@stdlib/plot/components/svg/defs' );
88+
89+
// Create a new component:
90+
var node = defs();
91+
92+
// Render as a virtual DOM tree:
93+
var vtree = node.render();
94+
95+
// Transform the virtual DOM tree to HTML:
96+
var html = toHTML( vtree );
97+
// returns <defs></defs>
98+
```
99+
100+
</section>
101+
102+
<!-- /.examples -->
103+
104+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
105+
106+
<section class="references">
107+
108+
</section>
109+
110+
<!-- /.references -->
111+
112+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
113+
114+
<section class="links">
115+
116+
[svg]: https://www.w3.org/Graphics/SVG/
117+
[virtual-dom]: https://github.com/Matt-Esch/virtual-dom
118+
119+
</section>
120+
121+
<!-- /.links -->

0 commit comments

Comments
 (0)