Jump to content
  • How to maximize/restore a visualization using IronPython in Spotfire®


    The example below illustrates how to maximize and restore a visualization using an Iron Python script.

    Introduction

    The example below illustrates how to maximize and restore a visualization using an Iron Python script.

    To restore your visualization's specific layout you need to create a special bookmark selecting only the *Page Layout and Visualization* option. You can either create an Action Control to apply the bookmark or apply the bookmark programatically

    Code samples

    Maximize visualization

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    # Maximize the given Visualization
    
    import Spotfire.Dxp.Application.Layout as Layout
    
    Document.ActivePageReference.ActiveVisualReference = vis
    
    Document.ActivePageReference.ApplyLayout(Layout.TileMode.Maximize)
     

    Restore layout

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    # Restore the layout by applying a bookmark
    
    from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
    from Spotfire.Dxp.Application               import BookmarkComponentFlags
    
    bookmarkManager = Application.Document.Context.GetService(BookmarkManager)
    
    myBookmark      = bookmarkManager.Search('name::"Restore"')[0]
                      # assuming that bookmark 'Restore' exists
    
    components      = BookmarkComponentFlags.PageConfiguration | 
                      BookmarkComponentFlags.FilterOrganization
    
    bookmarkManager.Apply(myBookmark, components)
     

    References

    License:   TIBCO BSD-Style License


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...