JavaScript in Canvas Dashboards?

Hey folks. I saw a post on using TextBlocks to specify custom CSS stylings, but couldn’t find one on adding JavaScripts. Is this possible? I tried a similar method of adding a script element and added it to the bottom of my canvas layout. However, it seems the browser doesn’t parse the script or execute it.

I was actually trying to get the ‘Fit to width’ feature be dynamic. As of now, if I collapse/expand the navigation menu or resize the browser window, I need to manually click the ‘Fit to width’ button to have it recalculate the zoom % for the transform matrix styling. In pretty much all other tools, for example PDF Viewers, when you resize the window, the document is automatically resized to the available width, without manual intervention.

Please implement this behaviour as a feature request, and preferably also have a dedicated placeholder for css styling and javascripting, instead of using hacky TextBlock CSS solutions.

1 Like

Hi Shahid :raising_hand_man:,
Thank you for raising this issue!

Duly noted about the dynamic ‘Fit to width’ behavior for canvas dashboards. I have forwarded it to my team, and we’ll surely look into improving it in the future.

Regarding JavaScripts: Due to security reasons, Holistics does not support JS in text blocks.

I’ll be sure to keep you updated on any news for the ‘Fit to width’ option. In the meantime, let me know if you have any questions. Cheers!

@vu.duong Thank you. Ideally the ‘Fit to width’ choice and auto resizing should continue when opening other canvas dashboards. We implemented custom navigation on top. So our users can view in 100% side panel collapsed mode, and use the maximum browser width, without loosing navigation.

1 Like

Ah, I see. Thank you for sharing, @shahidt. That’s a very interesting setup :+1:

In that case, it would be a great idea to allow the ‘Fit to width’ option to not only (1) size dynamically to the viewport, but also (2) persist while I jump between canvas dashboards. Well noted!