@@ -288,7 +288,11 @@ function getDrawSettings(kind, selector) {
288
288
return res ;
289
289
}
290
290
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'); */
292
296
function setDefaultDrawOpt ( classname , opt ) {
293
297
let handle = getDrawHandle ( prROOT + classname , 0 ) ;
294
298
if ( handle )
@@ -422,7 +426,18 @@ async function draw(dom, obj, opt) {
422
426
* @return {Promise } with painter object
423
427
* @desc If drawing was not done before, it will be performed with {@link draw}.
424
428
* 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); */
426
441
async function redraw ( dom , obj , opt ) {
427
442
428
443
if ( ! isObject ( obj ) )
@@ -531,8 +546,8 @@ function addStreamerInfosForPainter(lst) {
531
546
* import { openFile, makeImage } from 'jsroot';
532
547
* let file = await openFile('https://root.cern/js/files/hsimple.root');
533
548
* 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 }); */
536
551
async function makeImage ( args ) {
537
552
if ( ! args ) args = { } ;
538
553
0 commit comments