@@ -288,7 +288,11 @@ function getDrawSettings(kind, selector) {
288288 return res ;
289289}
290290
291- /** @summary Set default draw option for provided class */
291+ /** @summary Set default draw option for provided class
292+ * @example
293+ import { setDefaultDrawOpt } from 'https://root.cern/js/latest/modules/draw.mjs';
294+ setDefaultDrawOpt('TH1', 'text');
295+ setDefaultDrawOpt('TH2', 'col'); */
292296function setDefaultDrawOpt ( classname , opt ) {
293297 let handle = getDrawHandle ( prROOT + classname , 0 ) ;
294298 if ( handle )
@@ -422,7 +426,18 @@ async function draw(dom, obj, opt) {
422426 * @return {Promise } with painter object
423427 * @desc If drawing was not done before, it will be performed with {@link draw}.
424428 * Otherwise drawing content will be updated
425- * @public */
429+ * @public
430+ * @example
431+ * import { openFile } from 'https://root.cern/js/latest/modules/io.mjs';
432+ * import { draw, redraw } from 'https://root.cern/js/latest/modules/draw.mjs';
433+ * let file = await openFile('https://root.cern/js/files/hsimple.root');
434+ * let obj = await file.readObject('hpxpy;1');
435+ * await draw('drawing', obj, 'colz');
436+ * let cnt = 0;
437+ * setInterval(() => {
438+ * obj.fTitle = `Next iteration ${cnt++}`;
439+ * redraw('drawing', obj, 'colz');
440+ * }, 1000); */
426441async function redraw ( dom , obj , opt ) {
427442
428443 if ( ! isObject ( obj ) )
@@ -531,8 +546,8 @@ function addStreamerInfosForPainter(lst) {
531546 * import { openFile, makeImage } from 'jsroot';
532547 * let file = await openFile('https://root.cern/js/files/hsimple.root');
533548 * let object = await file.readObject('hpxpy;1');
534- * let png64 = await makeImage({ format: 'png', object, option: 'lego2,pal67 ', width: 1200, height: 800 });
535- * let pngbuf = await makeImage({ format: 'png', as_buffer: true, object, option: 'lego2,pal67 ', width: 1200, height: 800 }); */
549+ * let png64 = await makeImage({ format: 'png', object, option: 'colz ', width: 1200, height: 800 });
550+ * let pngbuf = await makeImage({ format: 'png', as_buffer: true, object, option: 'colz ', width: 1200, height: 800 }); */
536551async function makeImage ( args ) {
537552 if ( ! args ) args = { } ;
538553
0 commit comments