Feature #362

Allow specifying an interaction in the session state such as clicking on a record to open a URL.

Added by Andy Dufilie over 6 years ago. Updated about 6 years ago.

Status:ResolvedStart date:08/09/2011
Priority:NormalDue date:11/18/2011
Assignee:Kyle Monico% Done:

100%

Category:Internal Code RefactoringEstimated time: (Total: 65.00 h)
Target version:1.0
Complexity:Medium OIC Priority:
Required by:Grand Rapids, Michigan

Description

Example interactions for record click:
- open a URL corresponding to that record
- pop up a box with more information on that record (show values in a table from a long list of columns)

The main idea of this feature is that we are specifying the behavior of Weave in the session state. This feature request is about the architectural change required to be able to specify this type of customizable interaction.

The other option (instead of specifying a function in the session state) is to allow adding an event listener at runtime through a JavaScript call that runs a JavaScript function.


Subtasks

Feature #696: Add an option to disable the probe tooltip (not disable probing completely, just disable the tooltip)ResolvedAndy Dufilie


Related issues

Related to Weave - Other #215: Refactor InteractiveVisualization to pull out the mouse interactions into separate classes Resolved 07/11/2011
Related to Weave - Feature #187: Add the ability to display a visualization in a probe window Open 07/01/2011

History

#1 Updated by Andy Dufilie about 6 years ago

  • Description updated (diff)

#2 Updated by Andy Dufilie about 6 years ago

  • Estimated time set to 40.00
  • Parent task set to #496
  • Required by set to Grand Rapids, Michigan

#3 Updated by Chris Stefanich about 6 years ago

  • Due date set to 12/01/2011

#4 Updated by Chris Stefanich about 6 years ago

  • Due date changed from 12/01/2011 to 11/18/2011

#5 Updated by Andy Dufilie about 6 years ago

  • Assignee set to Kyle Monico

#6 Updated by Andy Dufilie about 6 years ago

  • Target version set to 1.0

#7 Updated by Kyle Monico about 6 years ago

There's a demo here
http://129.63.8.210:8080/weave.html?file=graph_demo.xml&editable=true

Look in the session state under WeaveProperties. There's a LinkableHashMap named "eventListeners". Each LinkableEventListener has 3 fields

1. event - The name of the event to trigger the listener.
2. target - The relevant tool for this listener. If this is empty, the script is always executed.
3. script - This is code for the Weave Compiler. This code is executed only if the event occurred on the target or if the event occurred but the target is empty. If the target is specified, then the script will receive the target object (a MapTool or CompoundBarChartTool, for example) as the this pointer.

This line in the script is tricky:

issueString && (urlRequestInstance.url = "http://bugs.oicweave.org/issues/" + issueString)
&& navigateToURL(urlRequestInstance); 

That statement first checks issueString evaluates to true. Then it checks the second param which is assigning the url to the URLRequest variable. Then it executes the navigateToURL code. The compiler doesn't have support for if statements yet, but this works for the time being.

Let me know if you have any questions.

#8 Updated by Kyle Monico about 6 years ago

  • Status changed from Open to Resolved

#9 Updated by Andy Dufilie about 6 years ago

I renamed "macroEvents" to "eventListeners" because I didn't want this to confuse the meaning of "macro".

Also available in: Atom PDF