@@ -16,16 +16,17 @@ import { downloadButton } from '../../../common/downloadButton.js';
1616import { isOnLeftSideOfViewport } from '../../../common/utils.js' ;
1717import { defaultRowAttributes , qcObjectInfoPanel } from './../../../common/object/objectInfoCard.js' ;
1818import { h , iconResizeBoth , info } from '/js/src/index.js' ;
19+ import { downloadRootImageButton } from '../../../common/downloadRootImageButton.js' ;
1920
2021/**
2122 * Builds 2 actionable buttons which are to be placed on top of a JSROOT plot
2223 * Buttons shall appear on hover of the plot
2324 * @param {Model } model - root model of the application
24- * @param {object } tabObject - tab dto representation
25+ * @param {TabObject } tabObject - tab dto representation
2526 * @returns {vnode } - virtual node element
2627 */
2728export const objectInfoResizePanel = ( model , tabObject ) => {
28- const { name } = tabObject ;
29+ const { name, options : drawingOptions = [ ] , ignoreDefaults } = tabObject ;
2930 const { filterModel, router, object, services } = model ;
3031 const isSelectedOpen = object . selectedOpen ;
3132 const objectRemoteData = services . object . objectsLoadedMap [ name ] ;
@@ -35,6 +36,10 @@ export const objectInfoResizePanel = (model, tabObject) => {
3536 . forEach ( ( [ key , value ] ) => {
3637 uri += `&${ key } =${ encodeURI ( value ) } ` ;
3738 } ) ;
39+ const { displayHints = [ ] , drawOptions = [ ] } = objectRemoteData ?. payload ?? { } ;
40+ const toUseDrawingOptions = Array . from ( new Set ( ignoreDefaults
41+ ? drawingOptions
42+ : [ ...drawingOptions , ...displayHints , ...drawOptions ] ) ) ;
3843 return h ( '.text-right.resize-element.item-action-row.flex-row.g1' , {
3944 style : 'visibility: hidden; padding: .25rem .25rem 0rem .25rem;' ,
4045 } , [
@@ -63,12 +68,18 @@ export const objectInfoResizePanel = (model, tabObject) => {
6368 h ( '.p1' , qcObjectInfoPanel ( objectRemoteData . payload , { } , defaultRowAttributes ( model . notification ) ) ) ,
6469 ) ,
6570 ] ) ,
66- objectRemoteData . isSuccess ( ) &&
67- downloadButton ( {
68- href : model . objectViewModel . getDownloadQcdbObjectUrl ( objectRemoteData . payload . id ) ,
69- title : 'Download object' ,
70- id : `download-button-${ objectRemoteData . payload . id } ` ,
71- } ) ,
71+ objectRemoteData . isSuccess ( ) && [
72+ downloadRootImageButton (
73+ `${ objectRemoteData . payload . name } .png` ,
74+ objectRemoteData . payload . qcObject . root ,
75+ toUseDrawingOptions ,
76+ ) ,
77+ downloadButton ( {
78+ href : model . objectViewModel . getDownloadQcdbObjectUrl ( objectRemoteData . payload . id ) ,
79+ title : 'Download root object' ,
80+ id : `download-button-${ objectRemoteData . payload . id } ` ,
81+ } ) ,
82+ ] ,
7283 h ( 'a.btn' , {
7384 title : 'Open object plot in full screen' ,
7485 href : uri ,
0 commit comments