Skip to content

Commit f4e56a6

Browse files
committed
Update example
1 parent e7f1b1f commit f4e56a6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • lib/node_modules/@stdlib/plot/examples

lib/node_modules/@stdlib/plot/examples/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
'use strict';
2020

21-
var toHTML = require( 'vdom-to-html' );
2221
var randn = require( '@stdlib/random/base/box-muller' );
2322
var Float64Array = require( '@stdlib/array/float64' );
2423
var now = require( '@stdlib/time/now' );
@@ -43,15 +42,16 @@ var plt = plot( [x], [y], {
4342
'width': 600,
4443
'height': 480,
4544
'xScale': 'time',
46-
'xTickFormat': '%H:%M'
45+
'xTickFormat': '%H:%M',
46+
'renderFormat': 'html'
4747
});
4848

4949
// Render as a virtual DOM tree:
50-
var vtree = plt.render();
50+
var vtree = plt.render( 'vdom' );
5151
console.log( JSON.stringify( vtree ) );
5252

53-
// Transform the virtual DOM tree to HTML:
54-
var html = toHTML( vtree );
53+
// Render as HTML:
54+
var html = plt.render();
5555
console.log( html );
5656

5757
// Listen for 'render' events (e.g., when triggered due to changes in state):
@@ -63,6 +63,6 @@ function update() {
6363
plt.width = 720;
6464
}
6565

66-
function onRender( vtree ) {
67-
console.log( toHTML( vtree ) );
66+
function onRender( html ) {
67+
console.log( html );
6868
}

0 commit comments

Comments
 (0)