动画化Tibco Spotfire中的数据更改 [英] Animating Data Changes in Tibco Spotfire

查看:99
本文介绍了动画化Tibco Spotfire中的数据更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在这里的第一篇文章,因此,如果我在礼节上未能遵守礼节,请原谅我.

This is my first post here, so please forgive me if I fail at etiquette somewhere along the way.

我正在研究POC,以对Tibco Spotfire 7.0中的可视化动画进行动画处理,这将允许用户通过迭代一组过滤器或迭代基于预先设置的数据更改来查看数据随时间的变化.确定的条件集. TIBCOmmunity已经为此目的定义了一个自定义工具 http://tibcoanalytics.com/spotfire/archive/totw/2011-01-16.html .但是,我的任务是证明可以在Iron Python脚本中完成此操作. POC在概念上非常简单,我需要一个动作控件来将散点图上的点绕圆移动.以下是到目前为止我正在使用的Python.我遇到的问题是迫使Spotfire更新/刷新循环中的可视化效果.帮助吗?

I am working on a POC dealing with animating a visualization within Tibco Spotfire 7.0 which will allow a user to see changes in data over time by iterating through a set of filters or by iterating through alterations to the data based on a pre-determined set of conditions. TIBCOmmunity already defines a custom tool for this purpose http://tibcoanalytics.com/spotfire/archive/totw/2011-01-16.html. However, it is my task to show that this can be done within an Iron Python script. The POC is rather simple in concept, I need an Action Control to move a point on a scatter plot around in a circle. Below is the Python I'm working with so far. The issue I am having is forcing Spotfire to update/refresh the visualization inside the loop. Help?

import time
import math
R = Rad; #parameter containing the radius of the circle
x_0 = xc; #parameter containing the center x coord
y_0 = yc; #parameter containing the center y coord

t=0.00
while t<(2*math.pi):
    x = R*(math.cos(t)) + x_0;
    y = R*(math.sin(t)) + y_0;
    t+=0.01
    Document.Properties['xc'] = x
    Document.Properties['yc'] = y
    #code to force the visualization/document to refresh/update goes here
    time.sleep(1/360)

推荐答案

这不能直接回答您的问题,但是为您提供了一种创建可以与文档属性进行交互的计时器的方法.抱歉,我没有时间提供明确的答案.因此不要随意将其标记为接受-也许其他人有更好的选择.

this does not directly answer your question but provides you with a method of creating a timer that can interact with document properties. sorry that I don't have time to provide an explicit answer. as such feel free not to mark it accepted -- maybe someone else has a better one.

您的代码无法正常工作的原因是因为IronPython引擎锁定了Spotfire,直到执行完成为止.假设可视化没有更新并不遥不可及:实际上,整个应用程序都不会更新!您可以通过将sleep值设置为1秒来测试我在评论中提到的内容.

the reason that your code doesn't work is because the IronPython engine locks Spotfire until execution is completed. you're not far off in assuming that the visualization doesn't update: in fact the entire application doesn't update! you can test this as I mentioned in my comment by setting the sleep value to 1 second.

我前段时间创建了此DXP 说明如何允许IronPython和Javascript代码在文本区域内相互交互. IP-> JS 页面应为您提供有关如何构建动画解决方案的一些线索.

I created this DXP some time ago to illustrate how to allow IronPython and Javascript code to interact with each other inside of textareas. the IP->JS page should give you some clues on how to build your animation solution.

这里幕后发生的事情:

  1. <div>内的Spotfire属性控件(输入区域)允许用户输入文本
  2. 名为update的Javascript函数定期运行:var timer = setInterval(update, 1000);
  3. update函数使用JQuery通过其父级<div>:var text_in = $("#input_container").text();
  4. 来访问输入区域.
  5. update最后用修改后的文本替换输出"容器<div>中的文本:$("#output_container").html(rainbowize(text_in));
  1. a Spotfire Property Control (Input area) inside of a <div> allows the user to enter text
  2. a Javascript function called update runs periodically: var timer = setInterval(update, 1000);
  3. the update function uses JQuery to access the input area via its parent <div>: var text_in = $("#input_container").text();
  4. update finally replaces the text in an "output" container <div> with the modified text: $("#output_container").html(rainbowize(text_in));

您可以修改此示例,以使用JQuery将其输出到文档属性链接的输入区域.换句话说,使用Javascript计时器setInterval()代替time.sleep().

you can modify this example to use JQuery to output to a document property-linked input area. in other words, use the Javascript timer setInterval() instead of time.sleep().

我希望我在解释这一点上做得不错.让我知道是否不清楚:)

I hope I've done a decent job of explaining that. let me know if it was unclear :)

这篇关于动画化Tibco Spotfire中的数据更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆