Forum Discussion
BUG Clone visual API does not create independent visual
HI Marco57,
As the document mentioned, this clone function will receive the filter effects and visual layout(size, locations). It did not directly get the corresponding data fields that use in target visual designs.
According to your descriptions, it seems like you want to get different filter effects to dynamically change the visual designs.
For this requirement, I think you need to do some customization with its render to initiation function to force refresh the current layout and render new styles if possible. (BTW, I check the document but found they are packaged functions and not support any parameters so you can't custom their processing)
Regards,
Xiaoxin Sheng
- Marco575 years agoHelper III
Hi Anonymous ,
Thanks for your answer. The clone function is indeed not expecting dataFields input but its aim is to be able to clone separate visuals so you could modify them independently. It is not explained by the documentation that all the cloned visuals would effectively be sharing all same dataFields.
It is very limiting that cou can't edit your visual once cloned, it is one of the purpose of cloning actually.
From your last part, should I get that there are actually no means at all to clone a visual and customize it expcet regarding it filters and layout? ( which is very poor to be honest from an API point of view).
Thanks,
Rgds.
Marc.
- Anonymous5 years agoNot applicable
Hi Marco57,
>>From your last part, should I get that there are actually no means at all to clone a visual and customize it expcet regarding it filters and layout? ( which is very poor to be honest from an API point of view).
It sounds like my description makes you confused with use these functions. They mean the 'render'/'onload' functions not include parameters, so you can't directly send parameters to them.
It does not mean you can't interact with them, you can refer to the following link to add some processing to do custom after the function finished.
report.on('loaded', function(event) { reportPages = await report.getPages(); });The clone visual contents are processed by clone function internal, I haven't found they share any official interface or parameters of 'visual object' that allow you to customize. (so if these visual objects are designed with singleton mode, it may cause the issue that you mention)
For this scenario, maybe you need to check the visual class and manually to processing with its contents.
Regards,
Xiaoxin Sheng
- Marco575 years agoHelper III
Anonymous
Thanks for the follow up.
I understand there are no means/workaround to duplicate a visual and edit it by our means except when this editing concerns filtered content/layout.
Well this is awfully limiting its usage, on the desktop you can simply do ctrl+c, ctrl+v and with the full API this is even not possible.
Thanks.
Rgds,
Marc.