Home » Eclipse Projects » Remote Application Platform (RAP) » 10 new Google Visualization widgets for RAP
10 new Google Visualization widgets for RAP [message #131772] |
Thu, 07 May 2009 21:31 |
David Donohue Messages: 104 Registered: July 2009 |
Senior Member |
|
|
Google Visualization API consists of a number of charts, maps, and graphs
for the visualization of data. See
http://code.google.com/apis/visualization/documentation/gall ery.html
The 10 new widgets for Eclipse RAP include:
(1) MotionChart, which I believe is Google's implementation of the
Trendalyzer, as seen on gapminder.org and at TED -
http://www.ted.com/index.php/talks/hans_rosling_shows_the_be st_stats_you_ve_ever_seen.html
(2) line chart
(3) scatter chart
(4) partial implementation of GeoMap (regions supported, markers not
supported)
(5) pie chart
(6) column chart
(7) bar chart
(8) area chart
(9) gauge
(10) timeline
All widgets permit any supported settings to be passed into the widget.
Each widget expects a characteristic format of data. See the Google
Visualization API documentation for each widget.
All except gauge and motion chart send selection events to RAP.
Example code:
JSONGoogleDataTable dataTable = new JSONGoogleDataTable();
dataTable.addColumn("theyear", "Date", "string", null);
dataTable.addColumn("CO2", "CO2", "number", null);
dataTable.addColumn("Temperature", "Temperature", "number", null);
dataTable.addRow(new Object[] {"1970", 325, 14.1});
dataTable.addRow(new Object[] {"2009", 389, 14.7});
widgetData = dataTable.toString();
ColumnChart chart = new ColumnChart( composite, SWT.NONE );
chart.setWidgetOptions("{width: 300, height: 300}");
chart.setWidgetData(serializedData);
gridData = new GridData(300, 300);
chart.setLayoutData(gridData);
...
public void handleEvent(Event event) {
log.info("Event: " + event);
VisualizationWidget widget = (VisualizationWidget)event.widget;
log.info( "Selected item=" + widget.getSelectedItem() +
"; row=" + widget.getSelectedRow() +
"; column=" + widget.getSelectedColumn() +
"; value=" + widget.getSelectedValue());
}
Most are Flash components. No Google API key is required for the current
implementation.
I am currently hosting the code here in the repository for my project
INQLE, however I can put it elsewhere e.g. create a new project if folks
desire.
http://code.google.com/p/inqle/source/browse/#svn/trunk/org. inqle.ui.google.widgets
Many thanks to Ivan Furnadjiev, for his energetic help in the development
of these widgets! Thanks also to Christian Schmidt of Qooxdoo. Without
their help I could have not gotten this working.
David Donohue
|
|
| |
Re: 10 new Google Visualization widgets for RAP [message #131957 is a reply to message #131772] |
Fri, 08 May 2009 05:58 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Congratulations, David!!!
I'm glad to see that you successfully created these widgets.
Best,
Ivan
David Donohue wrote:
> Google Visualization API consists of a number of charts, maps, and
> graphs for the visualization of data. See
> http://code.google.com/apis/visualization/documentation/gall ery.html
>
> The 10 new widgets for Eclipse RAP include:
> (1) MotionChart, which I believe is Google's implementation of the
> Trendalyzer, as seen on gapminder.org and at TED -
> http://www.ted.com/index.php/talks/hans_rosling_shows_the_be st_stats_you_ve_ever_seen.html
>
> (2) line chart
> (3) scatter chart
> (4) partial implementation of GeoMap (regions supported, markers not
> supported)
> (5) pie chart
> (6) column chart
> (7) bar chart
> (8) area chart
> (9) gauge
> (10) timeline
>
> All widgets permit any supported settings to be passed into the
> widget. Each widget expects a characteristic format of data. See the
> Google Visualization API documentation for each widget.
>
> All except gauge and motion chart send selection events to RAP.
>
> Example code:
> JSONGoogleDataTable dataTable = new JSONGoogleDataTable();
> dataTable.addColumn("theyear", "Date", "string", null);
> dataTable.addColumn("CO2", "CO2", "number", null);
> dataTable.addColumn("Temperature", "Temperature", "number", null);
> dataTable.addRow(new Object[] {"1970", 325, 14.1});
> dataTable.addRow(new Object[] {"2009", 389, 14.7});
> widgetData = dataTable.toString();
> ColumnChart chart = new ColumnChart( composite, SWT.NONE );
> chart.setWidgetOptions("{width: 300, height: 300}");
> chart.setWidgetData(serializedData);
> gridData = new GridData(300, 300);
> chart.setLayoutData(gridData);
>
> ..
>
> public void handleEvent(Event event) {
> log.info("Event: " + event);
> VisualizationWidget widget = (VisualizationWidget)event.widget;
> log.info( "Selected item=" + widget.getSelectedItem() + ";
> row=" + widget.getSelectedRow() +
> "; column=" + widget.getSelectedColumn() +
> "; value=" + widget.getSelectedValue());
> }
>
> Most are Flash components. No Google API key is required for the
> current implementation.
> I am currently hosting the code here in the repository for my project
> INQLE, however I can put it elsewhere e.g. create a new project if
> folks desire.
> http://code.google.com/p/inqle/source/browse/#svn/trunk/org. inqle.ui.google.widgets
>
>
> Many thanks to Ivan Furnadjiev, for his energetic help in the
> development of these widgets! Thanks also to Christian Schmidt of
> Qooxdoo. Without their help I could have not gotten this working.
>
> David Donohue
>
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 26 22:28:05 GMT 2024
Powered by FUDForum. Page generated in 0.09040 seconds
|