4

みんな、おはよう、

私はこの問題に数日間取り組んできましたが、解決策がわかりません。私は調査して無駄にグーグルで検索しました。どんな助け/洞察も大歓迎です。クリックすると自動的に日付フィルター (1/1/15 から開始) を通過し、1/2 -1/5 を通過して新しくフィルターされたマーカー レイヤーでマップを更新するボタンを作成しようとしています。関数。フィルターが 1/1 から 1/5 をステップスルーするようになりました。ただし、進行中にマップの視覚化が更新されないため、ユーザーに表示されるのは、1/1 から 1/5 へのジャンプとその間の一時停止だけです (ステップごとにスリープ タイマーを使用しています)。以下のコードを含めました。IronPython を学習したばかりで、ビジュアライゼーションを更新するために何を呼び出す必要があるかわかりません。Visualization.Refresh() が機能しません。本当にありがとう!

import Spotfire.Dxp.Application.Filters as filters
import Spotfire.Dxp.Application.Filters.ItemFilter
import time
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import DataProperty, DataType, DataPropertyAttributes, DataPropertyClass
from Spotfire.Dxp.Application.Visuals import MarkerLayer

myPanel = Document.ActivePageReference.FilterPanel
myFilter= myPanel.TableGroups[2].GetFilter("Date (Daily)")

myFilter.FilterReference.TypeId = FilterTypeIdentifiers.ItemFilter
itemFilter = myFilter.FilterReference.As[filters.ItemFilter]()

whichCol = itemFilter.DataColumnReference
count = 0
while count < 5:

    count = count +1
    if (whichCol.Properties.PropertyExists("CurrentStep") == False):
        myProp = DataProperty.CreateCustomPrototype("CurrentStep",0,DataType.Integer,DataPropertyAttributes.IsVisible|DataPropertyAttributes.IsEditable)
        Document.Data.Properties.AddProperty(DataPropertyClass.Column, myProp)
        whichCol.Properties.SetProperty("CurrentStep",0)
        Document.Properties["DateTest"] = "1/1/15" 
        time.sleep(1)

    else:
        time.sleep(1)
        whichVal = whichCol.Properties.GetProperty("CurrentStep")
        #print whichVal
        #print itemFilter.Values.Count
        if (whichVal == itemFilter.Values.Count):
            whichCol.Properties.SetProperty("CurrentStep",0)
            Document.Properties["DateTest"] = "1/1/15"
        else:
            itemFilter.Value = itemFilter.Values.Item[whichVal]
            whichCol.Properties.SetProperty("CurrentStep",whichVal+1)
            Document.Properties["DateTest"] =  itemFilter.Value
4

2 に答える 2

5

私の理解では、これは IronPython を使用して行うことはできません。私が持っていた同様の質問に対する彼の回答から niko を引用します: Tibco Spotfire でのデータ変更のアニメーション化 「IronPython エンジンは、実行が完了するまで Spotfire をロックします。」だから私は、散布図をアニメーション化しようとしたのと同じ方法であなたの問題に取り組みました... IPの代わりにJSを使用しました。使用しているデータセットにアクセスできないため、日付の代わりに 1 から 100 までの id 列を持つランダム データセットを使用しました。データ制限カスタム式 [id]=${FilterValue} を設定します。{FilterValue} は、整数型がデフォルト値 1 に設定されたドキュメント プロパティです。次に、次の HTML と JS を使用して、プロパティを 1 から反復処理しました。 100。注: これは SF 7.0 で「暗い」ビジュアル テーマを使用して行いました。「ライト」テーマまたは SF 6.X では、HTML と JS の両方でボタンに異なる色を定義する必要があります。リクエストに応じて、.dxp をドロップボックスにアップロードして、ここで共有できます。 これが役立つことを願っています。HTML:

<div id="button1" style="padding: 2px; border: 3px outset grey; border-image: none; text-decoration: none; cursor:pointer;    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;position:relative;
    user-select: none;width:13em;display:block;;"><font color="white" size="2" style="margin:0px 0px 0px 1px">Cycle Filters</font>
</div>


<div id='FilterValue' style='display:none'>
<SpotfireControl id="b986fa43508a484da22f6b42d510061f" />
</div>

JS:

var button=document.getElementById(button1);
var doc=document.getElementById(doc);

t=0;
var CycleFilters = function(){
    if (t<=100)
    {       
        $("#FilterValue input").val(t).blur();
        t+=1;
    }

}




var mouseDown=function()
{
   button.style.background="#202020";
   button.style.border="3px inset grey";
   button.style.padding="4px 0px 0px 4px";
   button.onmouseup=mouseUp;
   button.onmouseout=mouseOut;
   button.onmouseover=mouseOver;

}

function mouseUp() {
    button.style.background="none";
    button.style.border="3px outset grey";
    button.style.padding="2px 2px 2px 2px";
    button.onmouseover=mouseOver2;
    t=0.00;
    setInterval(CycleFilters,1000)
    //document.getElementById('mySpotfireControlx').firstChild.value = 20;
    //$("#mySpotfireControlx input").val(20).blur();
    //document.getElementById('mySpotfireControly').firstChild.value = 10;
    //$("#mySpotfireControly input").val(10).blur();



}
function mouseOut()
{
    button.style.background="none";
    button.style.border="3px outset grey";
    button.style.padding="2px 2px 2px 2px";
}
function mouseOver()
{   
    button.style.background="#202020";
    button.style.border="3px inset grey";
    button.style.padding="4px 0px 0px 4px";
}
function mouseOver2()
{
    button.onmousedown=mouseDown;
}


button.onmouseover=mouseOver2;
button.onmouseout=mouseOut;

document.documentElement.addEventListener('mouseup', function(e)
{
button.onmouseover=mouseOver2;
})
于 2015-09-11T14:33:46.730 に答える
2

ここに画像の説明を入力

Spotfire ビジュアライゼーションをアニメーション化する方法の詳細については、こちらを参照してください。


  1. フィルタ設定、ブックマーク、または ironPython を使用したものを適用するアクション コントロール ボタンを作成します。
  2. アクション コントロール ボタン ボタンを何度もトリガーするスクリプトを作成します (例のようにオプションで開始ボタンと停止ボタンを使用)。

html

<div id='spotfireButton' style='display:none'>
 <SpotfireControl id="y0ursp07f1r3c0n7r01IdH3r3" />
</div>

<SPAN id=startButton>Start</SPAN>
<SPAN id=stopButton style='display:none'>Stop</SPAN>

パイソン

#changes RangeFilter low and high bounds in small increments
from Spotfire.Dxp.Application.Filters import RangeFilter, ValueRange
from Spotfire.Dxp.Data import IndexSet

#get a reference to the range filter in question
filt=Document.FilteringSchemes[0].Item[myDataTable].Item[myDataTable.Columns.Item["b"]].As[RangeFilter]()

delta = .1
if(filt.ValueRange.High.ToString() == "High"): #reset filters
 idx = IndexSet(myDataTable.RowCount,True)
 min = myDataTable.Columns["b"].RowValues.GetMinValue(idx).Value
 filt.ValueRange = ValueRange(min,min+delta)
 print filt.ValueRange
else:
  filt.StepBodyUp()

JavaScript

var pid
var speed = .5 //change filter 2/second
start = function(){
 pid = setInterval(function(){
   $("#spotfireButton input").click()
 },speed*1000)
 $('#stopButton').show()
 $('#startButton').hide()
}

stop = function(){
 clearInterval(pid)
   $('#dd').text("stopped " + pid)
 $('#stopButton').hide()
 $('#startButton').show()
}
s
$("#stopButton").button().on('click',stop)

$("#startButton").button().on('click',start)
于 2016-02-04T18:02:43.180 に答える