Jump to content

I have been struggling with a script to enable pages to be rendered matching a template page. This is more of an algorithmic problem. Spotfire outputs the panels coordinates and input to set up a panel is via the Layout Definition,


Mark Mickunas

Recommended Posts

Convert:

|-----------------|-----------|

|panel1          |panel3    |

|                 |           |

|-----------------|           |

|panel2          |           |

|                 |------------|

|                 |panel4    |

|-----------------|-----------|

panel1 coords

  (0,0):    (458,0):

  (0,247):    (458,247):

panel2 coords

  (0,247):    (458,247):

  (0,645):    (458,645):

panel3 coords

  (458,0):    (1458,0):

  (458,503):    (1458,503):

panel4 coords

  (458,503):    (1458,503):

  (458,645):    (1458,645):

To:

layout.BeginSideBySideSection()

layout.BeginStackedSection(31)

layout.Add(panel1,38)

layout.Add(panel2,62)

layout.EndSection()

layout.BeginStackedSection(69)

layout.Add(panel3,78)

layout.Add(panel4,22)

layout.EndSection()

layout.EndSection()

Link to comment
Share on other sites

Hello Mark,

I was unable to find a good solution for this either so I reached out to one of the developers of this functionality. His answer was that he does not believe this general issue can be solved using the available API:s.

So, I'm afraid I can only point you to the TIBCO Ideas Portal (https://ideas.tibco.com) and suggest that you create an idea for this.

Note: I should mention that this is based on some speculation on our end of what your exact use case is though - if you describe it in more detail, it's possible that some solution can be identified (and others here in the community might have ideas).

Link to comment
Share on other sites

Thank you so much for responding, Fredrik. I agree the API is not the main impediment. I feel this is mostly an algorithmic problem. I have a python script hundreds of lines long trying to code a solution and am still not there. I have dug out old programming textbooks and reviewed graphing and linear algebra matrix techniques but have come up empty.
Link to comment
Share on other sites

Hi Mark,

The proportion arguments to LayoutDefinition.BeginStackedSection(Visual, Single) and LayoutDefinition.BeginStackedSection(Single) should be passed as decimal values. You should get the desired layout using the following (notice the decimal points):

layout = LayoutDefinition()

layout.BeginSideBySideSection()

layout.BeginStackedSection(.314)

layout.Add(panel1,.38)

layout.Add(panel2,.62)

layout.EndSection()

layout.BeginStackedSection(.686)

layout.Add(panel3, .78)

layout.Add(panel4, .22)

layout.EndSection()

layout.EndSection()

page.ApplyLayout(layout)

Of course, the final coordinates depend on the application window size.

Did I understand your request correctly?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...