具有多个数据表的应用程序不会正确创建本地数据过滤器大家好,我正在尝试制作一个引用多个数据表的应用程序,并且在该应用程序中有适用于每个数据表中的图形的数据过滤器。 当我插入本地数据过滤器时,列选项是正确的。 但是,当我运行该应用程序时,所有本地数据过滤器都将引用我上次打开的任何数据表。 两者都说他们在应用程序构建器中引用了正确的数据表,但是在应用程序启动期间这不知何故发生了变化。
例如,使用两个示例数据集:
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当然,这看起来并不完全像您拥有的那样,但也许它对您来说足够好。