Fixing Blank Custom Spotfire Mod Visualizations in PDF Exports

Fixing Blank Custom Spotfire Mod Visualizations in PDF Exports

book

Article ID: KB0137710

calendar_today

Updated On:

Products Versions
Spotfire Analyst All

Description

This issue originates from custom code (Note: This is not a product issue.) calling the context.signalRenderComplete() API too early, before the visualization has fully rendered. Spotfire relies on this signal to determine when the visualization is ready for export or capture.

If this signal is sent too early—especially when the visualization has not yet received necessary data (for example, lacking values on the x-axis)—the export process will capture a blank or incomplete visual.

An additional contributing factor can be the Spotfire Mod employing multiple readers with independent callback functions, each attempting to render the visualization separately. This can lead to inconsistent rendering behavior and premature signaling of completion.

Resolution

To reliably ensure your custom Spotfire Mod visualizations appear in PDF exports, implement the following strategies:

  1. Ensure Timely Signaling: Call context.signalRenderComplete() only after the visualization has been fully rendered and all required data is available. This guarantees that Spotfire captures the complete visual state.

  2. Centralize Rendering Logic: Refactor the code to utilize a single reader and a unified rendering logic, instead of multiple readers with separate callback functions. This promotes consistent rendering and simplifies the signaling process.

  3. Optimize Re-renders: Employ the hasValueChanged API to manage re-renders effectively and prevent unnecessary rendering operations. This ensures that context.signalRenderComplete() is called only when data or values have actually changed, improving the Spotfire Mod's efficiency.
     

By ensuring that the rendering process is complete before signaling, PDF exports and previews will consistently capture the accurate visual state.

Issue/Introduction

In some instances, custom Spotfire Mods visualizations do not appear in exported PDF files or during export previews within Spotfire. This behavior can be intermittent and may affect custom Spotfire Mods based on their implementation.

Additional Information