你好,
我編寫了一個腳本,可以在圖形生成器輪廓上附加用於採樣深度的滑塊。 但是,使用滑塊時地圖沒有響應和變化。
我相信一切都被正確引用,並且日誌沒有任何錯誤,但是當我移動滑塊時沒有任何變化。
腳本附後。
Names Default to Here(1);
dt = Currentdatatable();
datacolumn=column(dt, "End Depth");
new window ("RFIS Contour Plot Depth Filtering",
window:gb = Graph Builder(
Size( 599, 514 ),
Show Control Panel( 0 ),
Variables(
X( :Longitude ),
Y( :Latitude ),
Color(
Transform Column( "Log[SUM TOC NORM]", Formula( Log( :SUM TOC NORM ) ) )
)
),
Elements(
Contour(
X,
Y,
Legend( 5 ),
Line( 1 ),
Boundary( 0 ),
Number of Levels( 10 ),
Alpha( 95.1827841988282 ),
Smoothness( 0.01 )
),
Points( X, Y, Legend( 6 ) )
),
Local Data Filter(
Add Filter(
columns( :Sample Code, :Area ),
Where( :Area == "AOI" ),
Display(
:Sample Code,
"Single Category Display",
Find( Set Text( "" ) )
)
)
),
SendToReport(
Dispatch(
{},
"Longitude",
ScaleBox,
{Scale( "Geodesic" ), Format( "Best", 15 ), Min( -122.777380897341 ),
Max( -122.674219621177 ), Inc( 0.025 ), Minor Ticks( 0 )}
),
Dispatch(
{},
"Latitude",
ScaleBox,
{Scale( "Geodesic" ), Format( "Fixed Dec", 15, 2 ),
Min( 45.5156964729219 ), Max( 45.6018236979199 ), Inc( 0.05 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties(
0,
{gradient(
{Color Theme(
{"Green Yellow Red Copy", 16387, {"Green", "Yellow",
{252, 11, 11}}, {0.273504273504274, 0.5,
0.789173789173789}}
), Width( 12 )}
)},
Item ID( "Log[SUM TOC NORM]", 1 )
)
), Legend Model(
6,
Properties(
0,
{gradient(
{Color Theme(
{"Green Yellow Red Copy", 16387, {"Green", "Yellow",
{252, 11, 11}}, {0.273504273504274, 0.5,
0.789173789173789}}
), Width( 12 ), N Labels( 10 )}
)},
Item ID( "Log[SUM TOC NORM]", 1 )
),
Properties( 1, {Marker Size( 4 )}, Item ID( "Latitude", 1 ) )
)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "RFIS Contour Plot Depth Filtering" )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Background Map(
Images(
"Web Map Service",
"http://wms2.mapsavvy.com/WMSService.svc/f8e454cf75bf41a882e5126809b56a45/WMSLatLon",
"Aerial"
)
), Grid Line Order( 2 ), Reference Line Order( 3 )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {5, [0], 6, [-1, -1]} ), Position( {0, -1, -1} )}
)
),
),
H List Box(
Text Box("Depth"),
window:slmin = col min(datacolumn);
window:slmax = col max(data column);
window:slider1 = SliderBox(window:slmin, window:slmax, window:slmax,
scale=Matrix( {slmin,slmax} );
scale=scale`;
window:gb <<SENDTOREPORT></SENDTOREPORT>謝謝
這是一些使用滑塊來操縱本地數據過濾器下限的代碼(我不知道是否可以更改該值,因此我將其刪除並重新創建它,但看起來很順利 - 至少對於小數據量而言)。
names default to here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
minval = min(:height<<GETVALUES>= 51 & :height <= 70 ) ),
Close Outline(1)
);
// add a slider to control the minimum value of the data filter
vlb << append(
SliderBox(minval,maxval,::var,
df << delete(:height);
df <<ADDFILTER>= ::var ) )
)
)</ADDFILTER></GETVALUES>
如果您想控製過濾器的下限和上限,您可以使用 RangeSliderBox。
(ps:這是一個稍微草率的代碼 - 當滑塊框運行時df變量不再在範圍內;該代碼有效,但實際上我會將變量放在命名空間中,然後在滑塊腳本中重建對命名空間的引用)。