cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
lala
Level IX

How can modify this script to trigger when the cursor points?

It used to be click-triggered

gbFrame = (gb0 << report)[FrameBox(1)];
gbFrame << Set Graphlet(
    Picture(
        try(Close(dzK, NoSave));
        Current Data Table(dt);
        dzK = dt << Subset(
            Output Table("K"),
            Selected Rows(0),
            Rows(dt << Get Selected Rows()),
            Selected columns only(0)
        );
        dzK << Set Window Size(800, 500);
        dzK << Move Window(100, 1800);
        w = "High";
        Column(w) << Set Property("Color Gradient", {"Green to White to Red", Range({Col Min(Column(w)), Col Max(Column(w)), Col Mean(Column(w))})})
                  << Color Cell by Value;
        try(dzK << Delete Table Property("Source"));
    ),
    Reapply(1)
);

Thanks!

 

6 REPLIES 6
lala
Level IX

Re: How can modify this script to trigger when the cursor points?

In addition, the click triggered often occurs this phenomenon, error after the crash

Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.

Please contact JMP Technical Support to report this problem so 
that it can be investigated. 

Exception Stack Trace:
   at WinHost.AnalysisView.sizeMoveInProgress(Boolean bSizing, Boolean bAutoSizingFlag)
   at WinHost.AnalysisView.setWindowSize(Int32 width, Int32 height)
   at WPFDisplayWindowImpl.setWindowSize(WPFDisplayWindowImpl* , generic_point<int>* , generic_point<int>* requestedSize)
   at HeadPartition.cursorTrack(HeadPartition* , GCanvas* , generic_point<int> )
   at WPFDisplayWindowImpl.cursorTrack(WPFDisplayWindowImpl* , generic_point<int> where)
   at WinHost.AnalysisView.OnMouseMove(MouseButtons mb, Point point)
   at WinHost.ClientGrid.OnMouseMove(MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
<Truncated>
hogi
Level XII

Re: How can modify this script to trigger when the cursor points?

I love it to use the Hover Label framework to trigger an action.

 

option a) use "Click" to trigger actions via mouse clicks.

option b) use "picture" to trigger immediate actions once the mouse touches a data point (this is even faster than the generation of the hover label)

 

For me, the "Immediate action" was too uncontrolled - I started to move the mouse between the data points!

 

My final solution: 
Stay with "Picture", so no click is needed.
But let the user press CTRL to trigger the action:

hogi_0-1744174520570.png

 

from Re: actions via mouseover ? - use a modifier Key 👉🔳 

hogi
Level XII

Re: How can modify this script to trigger when the cursor points?

Maybe add a timer such that the action is not triggered 5x per second.

lala
Level IX

Re: How can modify this script to trigger when the cursor points?

2025-04-09_14-00-10.png

lala
Level IX

Re: How can modify this script to trigger when the cursor points?

Against one of the expert's scripts to modify, or only click to trigger.

gbFrame = (gb0 << report)[FrameBox(1)];
gbFrame << Set Graphlet(
    Picture(
Include("C:\Subset.jsl");
    ),
		Click(Include("C:\Subset.jsl");)
    //Reapply(1)
);

Thanks!

2025-04-09_13-50-00.png

AprilNolan
Level I

Re: How can modify this script to trigger when the cursor points?

Try using raycasting to detect cursor position and trigger action.

View more...
Per attivare l'evento quando il cursore punta su qualcosa, è consigliabile utilizzare un gestore di eventi legato al movimento del cursore o alla posizione del passaggio del mouse. Adoro immergermi in questo tipo di logica: è simile a come i giochi da Gratowin casino ti tengono agganciato con meccaniche interattive. Precisione, tempismo e un pizzico di creatività sono fondamentali sia nello scripting che nel gaming!

Recommended Articles