具有多個數據表的應用程序不會正確創建本地數據過濾器大家好,我正在嘗試製作一個引用多個數據表的應用程序,並且在該應用程序中有適用於每個數據表中的圖形的數據過濾器。 當我插入本地數據過濾器時,列選項是正確的。 但是,當我運行該應用程序時,所有本地數據過濾器都將引用我上次打開的任何數據表。 兩者都說他們在應用程序構建器中引用了正確的數據表,但是在應用程序啟動期間這不知何故發生了變化。
例如,使用兩個示例數據集:
JMP App(
Set Name( "Application" ),
Set Description(
"An empty workspace for creating custom applications with one or more windows and scripts"
),
Auto Launch( 1 ),
Snap To Grid( 1 ),
Show Grid( 1 ),
Show Properties( 1 ),
Show Sources( 1 ),
Group By Category( 1 ),
Dashboard Mode( 0 ),
Parameters,
Tables(
DataTable1 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
Set Label( "Body Fat" ),
Set Location( "Full Path" ),
Set Invisible( 0 )
),
DataTable2 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
Set Label( "Body Measurements" ),
Set Location( "Full Path" ),
Set Invisible( 0 )
)
),
Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.
) ),
Allocate(
Module1 = Plan(
PreAllocate,
Script(JSL Quote(// This script is executed when a new module instance is
// created. The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created. Variables declared here are
// scoped to the ModuleInstance namespace.
// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);
thisModuleInstance << Create Objects;
// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").
) ),
Allocate(
List1 = V List Box();
Splitter1 = H Splitter Box();
DataFilter1 = DataTable1 << Data Filter( Local );
Report3 = Platform(
DataTable1,
Bivariate(
Y( :Name( "Height (inches)" ) ),
X( :Name( "Weight (lbs)" ) )
)
);
Splitter2 = H Splitter Box();
DataFilter2 = DataTable2 << Data Filter( Local );
Report2 = Platform(
DataTable2,
Bivariate( Y( :Head ), X( :Mass ) )
);
),
Organize(
Reparent( Splitter2( Report2 ) );
Reparent( Splitter2( DataFilter2 ) );
Reparent( List1( Splitter2 ) );
Reparent( Splitter1( Report3 ) );
Reparent( Splitter1( DataFilter1 ) );
Reparent( List1( Splitter1 ) );
Relocate( List1( 160, 160 ) );
),
Initialize(
List1 << Background Color( 2147483647 );
List1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
List1 << Enabled( 1 );
List1 << Horizontal Alignment( "Default" );
List1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
List1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
List1 << Text Color( 2147483647 );
List1 << Vertical Alignment( "Default" );
List1 << Visibility( "Visible" );
List1 << set horizontal( 0 );
Splitter1 << Background Color( 2147483647 );
Splitter1 << Border(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter1 << Enabled( 1 );
Splitter1 << Horizontal Alignment( "Default" );
Splitter1 << Margin(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter1 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter1 << Text Color( 2147483647 );
Splitter1 << Vertical Alignment( "Default" );
Splitter1 << Visibility( "Visible" );
Splitter1 << Dockable( 0 );
Splitter1 << Set Width( 835 );
Splitter1 << Set Height( 497 );
Splitter1 << Set Sizes( {0.5, 0.5} );
Splitter1 << set horizontal( 1 );
Splitter1 << Set Min Size( 835, 497 );
Splitter1 << Set Max Size( 835, 497 );
Splitter1 << Set Auto Stretching( 1, 1 );
Splitter2 << Background Color( 2147483647 );
Splitter2 << Border(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter2 << Enabled( 1 );
Splitter2 << Horizontal Alignment( "Default" );
Splitter2 << Margin(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter2 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
);
Splitter2 << Text Color( 2147483647 );
Splitter2 << Vertical Alignment( "Default" );
Splitter2 << Visibility( "Visible" );
Splitter2 << Dockable( 0 );
Splitter2 << Set Width( 648 );
Splitter2 << Set Height( 338 );
Splitter2 << Set Sizes( {0.5, 0.5} );
Splitter2 << set horizontal( 1 );
Splitter2 << Set Min Size( 648, 338 );
Splitter2 << Set Max Size( 648, 338 );
Splitter2 << Set Auto Stretching( 1, 1 );
)
)
),
Initialize(
Module1 << Auto Launch( 1 );
Module1 << Set Module Type( "Report" );
Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
Module1 << Set Min Size( 0, 0 );
Module1 << Set Max Size( 30000, 30000 );
Module1 << Set Auto Stretching( ., . );
)
) << Edit回复:具有多個數據表的應用程序將無法正確創建本地數據過濾器我可以確認 JMP 15.2 及更高版本將解決此問題。 應用程序中的多個本地數據過濾器將保持與相應數據表的連接。
回复:具有多個數據表的應用程序將無法正確創建本地數據過濾器這有效! 太感謝了! 我在尋找解決方法時陷入了死胡同,主要是因為我認為我再也看不到創建應用程序的腳本了。 當我的應用程序變得足夠大時(60 多個平台有 28 個以上的本地數據過濾器和顯示元素來容納它們),“保存腳本”選項似乎只是給我應用程序的自定義腳本部分。 事實證明,它只是將所有 Allocate 函數放在一行中。 當我點擊重新格式化腳本時,它顯示了數百個額外的行。 我猜這不一定是錯誤,但我認為您可能想要了解它。
當我按照您建議的步驟操作時,一切正常。 不過,我希望這在未來的迭代中得到修復,因為在返回腳本以編輯過濾器以使其正確之前,我需要創建整個應用程序。
回复:具有多個數據表的應用程序將無法正確創建本地數據過濾器您好卡梅倫,感謝您的回复。 這實際上是我最初擁有它的方式,但這會產生一系列問題。 在應用程序的其他地方,我編寫了腳本設置以應用於這些過濾器(在我的實際應用程序中有十幾個)。 當它作為平台的一部分包含時,我無法弄清楚如何使用腳本訪問過濾器。 基本上我無法弄清楚如何為我的平台編寫命令腳本,只有它們的顯示項目。 這是一個單獨的問題,但如果您碰巧知道如何解決這個問題,那也會有所幫助!
回复:具有多個數據表的應用程序將無法正確創建本地數據過濾器你好,
我可以復制你所看到的。 儘管這只是一種解決方法,但請嘗試以下操作:
1. 根據您提供的腳本。 將最後一行更改為運行而不是編輯,然後嘗試運行腳本。 在我手中,您的腳本會執行我期望的操作。
2. 當您構建應用程序時,將數據表的位置更改為名稱,而不是當前數據表。
Tables(
DataTable1 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
Set Label( "Body Fat" ),
Set Location( "name" ),
Set Invisible( 0 )
),
DataTable2 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
Set Label( "Body Measurements" ),
Set Location( "name" ),
Set Invisible( 0 )
)
),
位置選項在底部。
有時“分配”指針不是預期的。 因此,在腳本中,仔細檢查過濾器 1 是否指向表 1,過濾器 2 是否指向表 2。
Allocate(
List1 = V List Box();
Splitter1 = H Splitter Box();
DataFilter1 = DataTable1 << Data Filter( Local );
Report3 = Platform(
DataTable1,
Bivariate(
Y( :Name( "Height (inches)" ) ),
X( :Name( "Weight (lbs)" ) )
)
);回复:具有多個數據表的應用程序將無法正確創建本地數據過濾器你好@DopeAgonist ,
這是非常奇怪的行為,可能值得開發人員注意。我驗證了您描述的從頭開始構建應用程序的內容,並將腳本中的本地數據過濾器關聯更改為正確的表。我能夠通過在腳本中手動添加適當的數據過濾器來顯示它們
Splitter1 << Prepend(DataTable1 << Data Filter("Local"));
Splitter2 << Prepend(DataTable2 << Data Filter("Local"));但這仍然行不通。無論您採用哪種方式,由於某種原因,本地數據過濾器都沒有正確連接到表。更改任何過濾器的值都不會影響表中的行選擇。
如果您從要拉入應用程序的分析平台創建數據過濾器,那麼過濾器就會起作用。例如:
JMP App(
Set Name( "Application" ),
Set Description(
"An empty workspace for creating custom applications with one or more windows and scripts"
),
Auto Launch( 1 ),
Snap To Grid( 1 ),
Show Grid( 1 ),
Show Properties( 1 ),
Show Sources( 1 ),
Group By Category( 1 ),
Dashboard Mode( 0 ),
Parameters,
Tables(
DataTable1 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
Set Label( "Body Fat" ),
Set Location( "Full Path" ),
Set Invisible( 1 )
),
DataTable2 = GuiTable(
Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
Set Label( "Body Measurements" ),
Set Location( "Full Path" ),
Set Invisible( 1 )
)
),
Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.
) ),
Allocate(
Module1 = Plan(
PreAllocate,
Script(JSL Quote(// This script is executed when a new module instance is
// created. The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created. Variables declared here are
// scoped to the ModuleInstance namespace.
// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);
thisModuleInstance << Create Objects;
// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").
) ),
Allocate(
Report2 = Platform(
DataTable2,
Bivariate(
Y( :Head ),
X( :Mass ),
Automatic Recalc( 1 ),
Local Data Filter
)
);
Report1 = Platform(
DataTable1,
Bivariate(
Y( :Name( "Height (inches)" ) ),
X( :Name( "Weight (lbs)" ) ),
Automatic Recalc( 1 ),
Local Data Filter
)
);
),
Organize(
Relocate( Report1( 0, 0 ) );
Relocate( Report2( 10, 680 ) );
),
Initialize( Glue() )
)
),
Initialize(
Module1 << Auto Launch( 1 );
Module1 << Set Module Type( "Report" );
Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
Module1 << Set Min Size( 0, 0 );
Module1 << Set Max Size( 30000, 30000 );
Module1 << Set Auto Stretching( ., . );
)
) << Edit當然,這看起來並不完全像您擁有的那樣,但也許它對您來說足夠好。