大家好,
我目前正在使用数据过滤器开发一个数据提取界面。我可以构建这个界面,问题出在 JMP19 中过滤器的列布局上。
在 JMP17 中,筛选器的列位于 LineUpBox() 函数内。LineUpBox 函数有两个实用函数:NCol 和 Spacing,它们允许我将列排列在多行上,并在列之间添加空格。
Tree Structure of the Data Filter in JMP17Tree Structure of the Data Filter in JMP17JMP17 中数据过滤器的树状结构
然而,在 JMP19 中,数据筛选器的树状结构发生了变化:LineUpBox() 被向上移动,列的父级是一个没有 NCol() 和 Spacing() 函数的 ListBox()。我可以使用 << Set Horizontal(1) 函数,但只能设置一行,显示效果也不理想。
(或许这项更改是在 JMP18 中发生的,我没有在这个版本中尝试过)。
Tree Structure in JMP19Tree Structure in JMP19JMP19中的树状结构
您知道如何在 JMP19 和 JMP17 中排列筛选器的列吗?
我尝试在内部创建一个新的 LineUpBox() 对象,并将边框框作为子对象移动,但这样会导致筛选功能丢失,而且无法轻松删除旧的边框框。我知道可以通过创建一个新的 Window() 对象,并在其中为筛选条件的每一列创建一个 ListBox() 对象来实现类似的效果,但我更喜欢使用数据筛选器,因为它具有条件属性,而且可以轻松地将其应用于不同的表格和不同的列。
下面是一个两列的示例(但实际上我可以添加更多列)。它在 JMP17 中可以正常工作(两列水平显示),但在 JMP19 中则不行。
Window from JMP17Window from JMP17JMP17窗口
f_extraction = Function({dt, cols_list, nbColsLine = 2, spacingLine = 30},
my_window = New Window("Extraction with filter",
Border Box(
Left(20), Top(10), Right(20), Bottom(10),
V List Box(
Panel Box("",
Eval(
Eval Expr(
// Creation of the Data Filter, with two columns as an example
df = dt << Data Filter(
Show Counts(0),
Conditional(1),
Show Histograms and Bars(0),
Add Filter(
Columns(Expr(cols_list)),
Display(cols_list, "List Display"),
)
)
)
);
// Here, the columns of the filter are reorderer in two columns with a space of 30 between them
// This is where I have the problem in JMP19 compared to JMP17 because the Tree Structure is different
(df << report)[Lineup Box( 2 )] << N Col( nbColsLine );
(df << report)[Lineup Box( 2 )] << Spacing( spacingLine );
For( i = 1, i <= N Items( cols_list ), i++,
(df << report)[ListBoxBox( i )] << Set Size( 180, 220 )
);
// We delete some buttons and check boxes that we don't need
(df << report)[Button Box( 4 )] << Delete;
(df << report)[Button Box( 3 )] << Delete;
(df << report)[Button Box( 2 )] << Delete;
(df << report)[CheckBoxBox( 4 )] << Delete;
(df << report)[CheckBoxBox( 3 )] << Delete;
(df << report)[CheckBoxBox( 2 )] << Delete;
(df << report)[CheckBoxBox( 1 )] << Delete;
(df << report)[Outline Box( 1 )] << Set Title( "Data Table Filters" );
),
Spacer Box(Size(0, 20)),
Button Box("OK",
// Script where I retrieve the user selection
)
)
)
)
);
// Example
Try(Close(Data Table("Big Class"), No Save));
dt = Open( "$SAMPLE_DATA/Big Class.jmp", Invisible);
f_extraction(dt, {"sex", "name"})
感谢您的帮助 !
可惜的是,依赖这种类型的结构很容易崩溃, https://www.hyrumslaw.com/ 。
我认为仅仅修改显示框是无法轻松解决问题的。数据筛选器结构的更改也导致我工作中管理的一些插件的界面出现问题,但原因不同,而且(希望……)处理起来比尝试将筛选器组织成网格要容易得多。
左边是 JMP18,右边是 JMP19。

是的,我知道这不是应对这些可能发生变化的结构的最佳方法!
我想暂时就先这样吧,谢谢分享你的经验 