Javascript Timeline Visualisation - java

I am planning to collect some data on the execution of requests within a Java Tomcat container. Each request is fulfilled by data retreived by multiple threads and I want to display this execution with a graphic similar to the Google App Engine App Stats tool:
Can anyone suggest a javascript library for drawing this kind of chart? I'm not even sure what the proper name would be for this. Searching for timelines turns up things like http://timeglider.com/jquery/ which seems to do something different.

It looks like a simple timeline with overlapping bars like in a bullet chart. You can see one example here in Protovis. If you know a bit of javascript, you can program one in D3.js, the successor of Protovis. There is a complete example in the demos that come with the download.

Related

The use of image processing to extract data from a diagram

I have a data flow diagram (a diagram that looks like a flow chart). It has a set of specific geometrical components like rectangles, circles, ellipses and arrows.
What I'm trying to achieve is to detect these shapes and be able to know which component is connected to which component (through the lines) and finally read the text inside each one to extract data from the diagram and do further processing. It is also notable to mention that the diagram will not be drawn by hand but computer generated so we don't have to worry about angles and ratios being inaccurate.
I'm currently working in Java and I was wondering if this is going to be possible since Java is not the best language when it comes to image processing (correct me if I'm wrong). And if it's possible I'd you guys to point out where I should start looking.
I think Java is fine, and it has many libraries to process images. ImageJ is just one example. Personally, I like to use Python, so I write scripts in this language using Java API of the DMelt platform. Look at the documentation of this projecst, wiki. Here is a link to a few examples.
Doing this in Java wasn't a great idea because mainly the lack of online resources. After a good amount of research, I found that the best and the easiest approach was the use of C# and Emgu CV which is a cross platform .Net wrapper to the OpenCV image processing library.
This example helped me to get started with detecting basic geometrical shapes like Lines, Rectangles and Triangles.

JFreeChart on Web

First, I am a final year student. We are creating a KPI and we saw JFree chart can be used to display charts. Now we have a problem about deciding whether the software is web based or not (Major votes came for a Desktop application. Only 1 is there for web based solution. ).
However, this what we have to do;
Display data using Charts
Colors of the areas of the chart MUST change during run time (eg: if < 90% attendance 'RED', if > 90% attendance 'GREEN')
When the user clicks on the particular area of the chart, display all the relevant data as a 'Tool Tip Text Box' or something. When mouse over, display some summary.
There will be 6 KPI's in the dashboard.
KPI's are belong to 2 categories, HR and PROJECTS.
Now my question is, what is the easy way of doing it? Web Based or Desktop? Will JFreeChart support these functions when it is in web? Please help!
First the long answer, then the short one. If you are using JFreeChart on the web, you have two options:
Display the charts in an applet, which will allow you to do basically all the stuff that JFreeChart supports, including the ones you mentioned above.
Use JFreeChart on the server side to generate images that will be served by the server. In this case, #2 will be difficult because you will have to refresh pages, #3 will be very hard or even almost impossible
Given the above, the short answer is: I suggest you build a desktop application, it will be easier to deal with charting.
From my experience is better use a Javascript Library to generate a gantt chart and later integrate with any framework Java Web. You could use some libraries for example:
Twproject Gantt
JQuery Gantt
JSGantt Improved
JQuery.Gantt
Finally There is an option with cost: Daylot Gantt
If you want to use JFreechart It can be used to render an image and post it on the page, you also could use some form of jquery based chart ploting. Either way you would have to take control of refreshing the data. In standalone app it might be somewhat easier.
you can use these JFreeCharts the requirements you have specified.
JFree charts will display the charts as images. But there are some methods which will display the tooltips and the summary, You have to implement those methods based on your requirements.

Getting a clue at / debug a huge Java Swing App I've inherited

I've been given the task to implement a new end-user functionality into a Java/Swing application. The task to implement is relatively easy and straightforward. What is cumbersome is the existing app to be modified.
It comprises dozens of classes which often break the 2000 lines barrer and sometimes reach 10000 lines.
Documentation is non existent and it is unfeasible to read all the source code to get the big picture of it.
The app itself is basically a GUI tool to draw diagrams (e.g. flowcharts) and is open-source (I can post the link to the source code if it helps).
So far I've managed to import the source code into an Eclipse project and use the SwingExplorer plugin to identify some of the GUI components.
The most 'interesting' part of the app is the canvas onto which the diagram is drawn. It is implemented as a single class (about 9700 lines long) that inherits from JComponent.
The parts of the displayed diagram can't be selected in SwingExplorer: the whole canvas is only identified as a single instance of the aforementioned class.
I hence guess that this huge single class is taking care of all the user interactions and AWT drawing operations for the diagram and returning just some kind of image buffer to display (but this is a huge guess).
My modification involves doing computation on the diagram as it is being drawn on the canvas. Therefore it is going to be a new class which will receive and process events broadcast during the creation of specific elements of the diagram, and then do some computation on them.
My main problem is: how to debug the event flow? How can I follow the flow of execution when drawing a diagram and see which events are generated, processed and also get an idea of where in memory the objects being drawn reside?
I know this question might seem too generic, but I'm really clueless and looking for a starting point.
Thanks in advance only for taking the time to read through ;)
Regards,
Marco
In NetBeans, I use File > New Project > Java Project with Existing Sources to allow easy navigation. Most IDEs have a similar feature.
Use Run > Generate Javadoc; even without comments, the Overview, Index, Use and Tree links may be useful.
Set breakpoints in the debugger and use Window > Debugging > Call Stack to answer question like, "How did I get here.
Run the code in the integrated Profile > Profile Project mode to see principle execution threads.

how can i make UI automation in java by which i can capture button or menu of any external application dynamically

I want to automate an external application, but I have several problems:
How can I recognize a button or other field of an external application in Java?
I use the Robot class in Java for making notepad automation where I open notepad, select file menu, and save or exit, etc.
The problem is, it needs X,Y coordinates for the mouse pointer to go to the proper location.
I want to make it more dynamic, i.e. it should recognize the file menu of a running notepad anywhere on the desktop.
How can this be done in Java? Is there any class in Java I can use to do this?
Thanks everyone to give me response, I want to be more specific i want to know how can i make ui automation by using any tool if it is not possible in java or using any api of java.automation tool must be freeware.....i am searching net for that i found AutoIt is like that.But if any one do this type of things please share his/her experiance means is it possible to do that in AutoIt or not possible if not then which tool do that kind of things.
It is easy to integrate Sikuli into a Java-application since it is written in Java. Sikuli uses image recognition to find elements visible on the screen like buttons and such. It is very easy to use and provides an alternative for tasks that are difficult to handle with static positioning, like finding moving windows and such.
Take a look at this: http://sikuli.org/docx/faq/030-java-dev.html
Hope this helps!
You should have a look at Sikuli. It takes as inputs images of the ui elements to select an area in the targeted app. It's a UI Automation Application
That's a bit difficult to install (at least on Debian/Ubuntu, where I tested it), as you'll need a recent version of OpenCV, a particular version of JXGrabKey but the quality of the program worth the trip. Good Luck
Java doesn't have an API to examine the UI of another application; that would be a very big security risk.
Which is why the Robot class can only record events (key presses, mouse movements and clicks) but not which UI element was involved in most cases.
It would be possible to do more if the external application was written in Java because then, you could analyze the objects in memory but for obvious reasons, this isn't possible for C++ or .NET applications.

Interactive Charts for web application

We are working on a web based application (implemented in JAVA) on commodity prices and one part of it is interactive charting. I provide a simplified example here. We have a table in Mysql database where we have information on commodity prices in US states and counties. One aspect of the application is to create interactive plots based on user choice. For example, if the user needs to see the price density in Oregon and Linn county then she chooses it from the menu in a webpage and it is rendered on fly with accompanying quantile information in a table. As the user changes state and county these plots and table change on fly.For our computational need we are using R (and use rjava to integrate it to our web application) and I know that if interactivity is not an issue this is a piece of cake in ggplot2, but I am not aware of any interactive version of R graphics framework (like lattice, ggplot2). We are exploring google visualization API but I am not sure we can have the statistical power we need in some of the plots.Please help.
You can absolutely do what you describe by making a call to R after each change in your web application. That's what Jeroen Ooms's application does. Or have a look at Jaime Love's R-Node application for an example of an R webapp that uses RServe.
R does not have any complete "interactive web graphics package" at this point in time. You can look at the webvis package for R/Protovis integration, but this doesn't include any interactivity yet.
Maybe a Javascript solution like protovis or humblefinance, maybe in combination with the brew package, might do the trick?
I don't know if it is powerful enough to suit your needs, but the gWidgetsWWW package can be used to make interactive graphics quite easily. Some examples and link to their source can be found here:
http://www.math.csi.cuny.edu/gWidgetsWWW/run/ex-index
--John

Categories

Resources