Spinning Star
This spinning star demo shows the basics of building a widget using Svigdet.
The spinning star appears in the demo folder of the Github repo for svidget. the purpose is to provide a basic, "hello world" widget example to demonstrate the capabilities of svidget. This widget also demonstrates how you can use other visualization libraries in your widget, in this case D3.
To get started, play around with the controls to change the params. You can click the star itself or indicate action params and click the spin button to invoke the spin action. Also, watch the event notifcations from with widget for spinStart and spinComplete. Preview the code below to see how this all works.
Here is the HTML snippet based on the params above.
[View Code]Here is the code for the widget:
[View Code]Download this widget by itself or as a zip file with the widget and related js files. The zip file contains version 0.3.4 of svidget.js but you can also download the latest version.
Also, check out the Starry Night demo to see multiple spinning stars in action.