<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SVG</title>
        <link>http://nimblecoder.com/blog/category/17.aspx</link>
        <description>Scalable Vector Graphics</description>
        <language>en-US</language>
        <copyright>Ryan Van Slooten</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <item>
            <title>Animated Clocks for SVG and Silverlight</title>
            <link>http://nimblecoder.com/blog/archive/2009/12/30/animated-clocks-for-svg-and-silverlight.aspx</link>
            <description>&lt;p&gt;At one point in time I found a cool clock graphic and I was looking for it again because it gave a fairly detailed explanation on making a nice looking vector based clock (it was the Codeproject article by &lt;a href="http://www.codeproject.com/KB/dotnet/vgclock.aspx"&gt;Marc Clifton&lt;/a&gt;). During my search I found numerous implementations of both SVG and Silverlight clocks and I decided to catalog my findings.&lt;/p&gt;  &lt;p&gt;The animated clocks are not necessarily practical to display on web pages, but an interesting exercise and fun as well.&lt;/p&gt;  &lt;h2&gt;SVG Clocks&lt;/h2&gt;  &lt;h3&gt;&lt;a href="http://www.adobe.com/svg/demos/clock.html" target="_blank"&gt;Adobe SVG Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.adobe.com/svg/demos/clock.html"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="AdobeSvgClock" border="0" alt="AdobeSvgClock" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/AdobeSvgClock.png" width="185" height="217" /&gt;&lt;/a&gt; by Adobe (unknown date)&lt;/p&gt;  &lt;p&gt;A very basic looking clock that uses three &amp;lt;animateTransform type="rotate"&amp;gt; for the hour, minute, and second hands along with a load script to initialize the hands. Note that Adobe has discontinued their SVG Viewer and there are conflicts between SVG and Flash.    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://realtech.burningbird.net/graphics/svg/experiments-svg-clock" target="_blank"&gt;Experiments: SVG Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/BurningBirdSvgClock.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="BurningBirdSvgClock" border="0" alt="BurningBirdSvgClock" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/BurningBirdSvgClock_thumb.png" width="215" height="213" /&gt;&lt;/a&gt; by Shelley Powers on November 30, 2007&lt;/p&gt;  &lt;p&gt;This is an improvement on a very simple SVG clock by Jason Davis (the original link was not working). This implementation supports displaying time in a different time zone rather than the user’s current time using the statement: &lt;span style="font-family: courier new, fixed"&gt;setInterval("setClock(calcTime(-6))", 1000);&lt;/span&gt;. The code is licensed with LGPL.&lt;/p&gt;  &lt;p&gt;I had to download the file directly as it was not shown in FF 3.5. The author has a rather appropriate statement in the article:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Is the clock worth the extra burden on the client's machine? Yes, and no. As a demonstration of what you can do with SVG and simple animation, I think it's a valuable tool. There is a Catch 22 about SVG: we don't use SVG because browser support is incomplete or inefficient; effort to better incorporate SVG is of secondary importance because SVG is little used. The only way to break this cycle is to actually start using the specification, and pushing a bit at the edges while we go about it.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Binary_clock.svg" target="_blank"&gt;Binary Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Binary_clock.svg"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="200px-Binary_clock_svg" border="0" alt="200px-Binary_clock_svg" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/200pxBinary_clock_svg.png" width="200" height="147" /&gt;&lt;/a&gt; by Alexander Jones &amp;amp; Eric Pierce from Wikipedia on October 14, 2006&lt;/p&gt;  &lt;p&gt;This is Wikipedia entry that I thought was animated but it turns out it is not animated. Bummer. It wouldn’t be hard to animate though.  &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://kamhungsoh.com/000d.xhtml"&gt;SVG + Javascript Analogue Clocks&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://kamhungsoh.com/000d.xhtml"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SvgJavascriptAnalogueClock" border="0" alt="SvgJavascriptAnalogueClock" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SvgJavascriptAnalogueClock.png" width="240" height="118" /&gt;&lt;/a&gt; by Kam-Hung Soh&lt;/p&gt;  &lt;p&gt;This example uses Javascript at the DOM document level rather than inside the SVG document to rotate the clock hands. It also uses a regular expression to change the rotation angle.    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://tavmjong.free.fr/INKSCAPE/DRAWINGS/clock2.svg" target="_blank"&gt;Animated SVG Clock Gears&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://tavmjong.free.fr/INKSCAPE/DRAWINGS/clock2.svg"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="AnimatedClockGears" border="0" alt="AnimatedClockGears" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/AnimatedClockGears.png" width="244" height="87" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;by &lt;a href="http://tavmjong.free.fr/" target="_blank"&gt;Tavmjong Bah&lt;/a&gt; (unknown date)&lt;/p&gt;  &lt;p&gt;This is a really cool example created with &lt;a href="http://www.inkscape.org/" target="_blank"&gt;Inkscape&lt;/a&gt; where every gear is independent and does not interfere with other gears. According to the author, the gears outlines were generated with a Python script by Aaron Spike.     &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://oskamp.dyndns.org/SiemensClock/SVG/" target="_blank"&gt;Siemens Wall Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://oskamp.dyndns.org/SiemensClock/SVG/"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SiemensWallClockSvg" border="0" alt="SiemensWallClockSvg" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SiemensWallClockSvg.png" width="240" height="236" /&gt;&lt;/a&gt; by &lt;a href="http://oskamp.dyndns.org/" target="_blank"&gt;Stefan Oskamp&lt;/a&gt; (unknown date)&lt;/p&gt;  &lt;p&gt;A nice looking clock that uses inline SVG along with a Javascript setInterval function to adjust the rotate attributes for the hour, minute, and second hands. The actual background is a 256 x 256 PNG file, rather than a vector based image.    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://labs.ibuildstuff.net/?p=svgclock" target="_blank"&gt;An SVG Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://labs.ibuildstuff.net/?p=svgclock"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SvgClockWithCountdown" border="0" alt="SvgClockWithCountdown" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SvgClockWithCountdown.png" width="200" height="209" /&gt;&lt;/a&gt; by Damien Dawber (ibuildstuff.net)&lt;/p&gt;  &lt;p&gt;This clock is a self generated SVG image using JavaScript and the &lt;a href="http://raphaeljs.com/"&gt;Raphael&lt;/a&gt; JavaScript Vector Library.     &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://anomaly.org/wade/projects/svgClocks/" target="_blank"&gt;SVG Clock Gallery&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SimpleAnalogClock.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SimpleAnalogClock" border="0" alt="SimpleAnalogClock" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SimpleAnalogClock_thumb.png" width="220" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;by &lt;a href="http://anomaly.org/wade/index.html"&gt;G. Wade Johnson&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A clock with a sunburst effect that uses an external script to drive the animation. The author also has a version that runs backwards by simply changing a parameter in the initialization script.    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://staticfree.info/projects/24h_clock/" target="_blank"&gt;24-Hour '12'-at-the-top Analog Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://staticfree.info/projects/24h_clock/"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="24h_clock_v2.2" border="0" alt="24h_clock_v2.2" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/24h_clock_v2.2.png" width="240" height="239" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;by &lt;a href="http://staticfree.info/"&gt;Steve Pomery&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A nice looking clock created using Inkscape. Now at version 2.2.  &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://chriswjohnson.blogspot.com/2008/04/svg-resurgent.html" target="_blank"&gt;SVG Resurgent&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://chriswjohnson.blogspot.com/2008/04/svg-resurgent.html"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SvgResurgentClock" border="0" alt="SvgResurgentClock" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SvgResurgentClock.png" width="200" height="200" /&gt;&lt;/a&gt; by &lt;a href="http://chriswjohnson.blogspot.com/"&gt;Chris W. Johnson&lt;/a&gt; on April 29, 2008&lt;/p&gt;  &lt;p&gt;An inline base64 encoded SVG clock. The SVG has a version of the Google analytics tracking script "because it's nice to know if people care."    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h2&gt;Silverlight Clocks&lt;/h2&gt;  &lt;h3&gt;&lt;a href="http://silverlight.net/samples/1.0/clock/default.html" target="_blank"&gt;Microsoft Silverlight Clock Samples&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://silverlight.net/samples/1.0/clock/default.html"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Silverlight1ClockSample" border="0" alt="Silverlight1ClockSample" align="left" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/Silverlight1ClockSample.png" width="240" height="212" /&gt;&lt;/a&gt; by Microsoft&lt;/p&gt;  &lt;p&gt;A &lt;a href="http://silverlight.net/samples/1.0/clock/default.html"&gt;clock sample&lt;/a&gt; from the Silverlight 1.0 SDK which uses clock.xaml and clock.js to create the clock. The result is actually very similar to some of the SVG implementations since Silverlight 1.0 did not have codebehind capability.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.net/content/samples/sl2/clock/run/index.html"&gt;Version 2.0&lt;/a&gt; of the clock uses codebehind along with a XAP file. There is also a &lt;a href="http://www.silverlight.net/content/samples/sl2/ruby-clock/index.html"&gt;version using IronRuby&lt;/a&gt; although the XAP file is significantly larger (11KB vs 1MB!) because it includes several assemblies in the XAP. Then there is the &lt;a href="https://silverlight.net/content/samples/sl2/python-clock/index.html"&gt;Python version&lt;/a&gt; as well which is almost identical to the Ruby version except for the language substitution.&lt;/p&gt;  &lt;p&gt;There is also a Microsoft walk-through: &lt;a href="http://msdn.microsoft.com/en-us/library/bb404709%28VS.95%29.aspx"&gt;Creating a Silverlight Clock by Using Expression Blend or Code&lt;/a&gt;, which has a detailed step by step guide for Expression Blend.     &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/vgclock.aspx" target="_blank"&gt;A Vector Graphics Rendered Animated Clock&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.codeproject.com/KB/dotnet/vgclock.aspx"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="VectorGraphicsRenderedClock" border="0" alt="VectorGraphicsRenderedClock" align="left" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/VectorGraphicsRenderedClock.png" width="209" height="210" /&gt;&lt;/a&gt; by Marc Clifton on April 18, 2004&lt;/p&gt;  &lt;p&gt;A very nice looking clock complete with a walkthrough on how to create the look and feel of the clock. Technically this isn’t a Silverlight clock as it is intended for the (now defunct) &lt;a href="http://www.myxaml.com/"&gt;MyXaml&lt;/a&gt; and then improved upon by &lt;a href="http://www.vgdotnet.com/"&gt;VG.net&lt;/a&gt;. The graphics should be mostly compatible with Silverlight though I haven’t tested it yet.     &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.silverlightshow.net/items/Developing-Silverlight-Analog-Clock-pattern-oriented-approach.aspx" target="_blank"&gt;Developing Silverlight Analog Clock – pattern oriented approach&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.silverlightshow.net/items/Developing-Silverlight-Analog-Clock-pattern-oriented-approach.aspx"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="SilverlightClockPatternOriented" border="0" alt="SilverlightClockPatternOriented" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SilverlightClockPatternOriented.png" width="207" height="204" /&gt;&lt;/a&gt; &lt;a href="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SilverlightClockPatternOriented2.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SilverlightClockPatternOriented2" border="0" alt="SilverlightClockPatternOriented2" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/SilverlightClockPatternOriented2_thumb.png" width="239" height="240" /&gt;&lt;/a&gt; by Pencho Popadiyn on October 30, 2008&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.silverlightshow.net/items/Developing-Silverlight-Analog-Clock-pattern-oriented-approach.aspx"&gt;Version 1&lt;/a&gt; introduces the MVP design pattern and the design of the clock using the MVP pattern.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx" target="_blank"&gt;Version 2&lt;/a&gt; - This implementation uses VS2008, .NET 3.5, Silverlight 2 using an MVP pattern. The sample has a very nice looking graphic and improves upon the Clock view.     &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://hybridclock.codeplex.com/" target="_blank"&gt;Hybrid Clock in Silverlight 2&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://hybridclock.codeplex.com/"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="HybridClock" border="0" alt="HybridClock" align="left" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/HybridClock.png" width="167" height="155" /&gt;&lt;/a&gt; by &lt;a href="http://www.alexanderbell.us/"&gt;Alex Bell&lt;/a&gt; on November 7, 2008 (based on SVN timestamps)&lt;/p&gt;  &lt;p&gt;A modest clock using Silverlight although the author claims: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Hybrid Clock is, by far, the most sophisticated animated Date/Time visualization control developed for Microsoft Silverlight™ 2.0.      &lt;br clear="left" /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/synergist/archive/2008/05/24/beauty-with-silverlight.aspx" target="_blank"&gt;Beauty with Silverlight: Ball Watch Animation&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/BallWatchSilverlight.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BallWatchSilverlight" border="0" alt="BallWatchSilverlight" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/BallWatchSilverlight_thumb.png" width="200" height="200" /&gt;&lt;/a&gt;by Michael S. Scherotter on April 24, 2008&lt;/p&gt;  &lt;p&gt;This is a gorgeous clock using Silverlight, Expression Blend, and Expression Design. For some reason this is a Silverlight 1.0 applet instead of 2.0 which means it uses some Javascript event triggering for the loading, but it looks great.    &lt;br clear="left" /&gt;&lt;/p&gt;  &lt;h3&gt;Miscellaneous Silverlight Clocks&lt;/h3&gt;  &lt;p&gt;I was taking way too much time, so here are other implementations without screen shots.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.c-sharpcorner.com/UploadFile/nipuntomar/SilverlightClock08122008132436PM/SilverlightClock.aspx" href="http://www.c-sharpcorner.com/UploadFile/nipuntomar/SilverlightClock08122008132436PM/SilverlightClock.aspx"&gt;http://www.c-sharpcorner.com/UploadFile/nipuntomar/SilverlightClock08122008132436PM/SilverlightClock.aspx&lt;/a&gt; – A good Silverlight clock.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://pixelplastic.de/2008/01/12/ZoomableUltraHighResolutionSilverlightClock.aspx" href="http://pixelplastic.de/2008/01/12/ZoomableUltraHighResolutionSilverlightClock.aspx"&gt;http://pixelplastic.de/2008/01/12/ZoomableUltraHighResolutionSilverlightClock.aspx&lt;/a&gt; – A Silverlight clock that allows the user to drag and move the clock. The applet did not work in IE or FF, so I assume it was developed with a pre-release version and has not been updated on the blog article. You can download the source code though. Marcel Hoyer has an &lt;a href="http://pixelplastic.de/2008/10/20/UpdatedSilverlightDemosClockAttractorBezier.aspx"&gt;older version of the clock&lt;/a&gt; as well as other cool Silverlight examples on his blog.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://weblogs.asp.net/andrewrea/archive/2009/08/12/programmatic-drawing-with-silverlight-2-0-3-0-an-analogue-clock.aspx" href="http://weblogs.asp.net/andrewrea/archive/2009/08/12/programmatic-drawing-with-silverlight-2-0-3-0-an-analogue-clock.aspx"&gt;http://weblogs.asp.net/andrewrea/archive/2009/08/12/programmatic-drawing-with-silverlight-2-0-3-0-an-analogue-clock.aspx&lt;/a&gt; – A basic looking clock although the clock is mostly generated by code (tick marks, etc.) which is cool. The blog post has a lengthy code listing and downloadable code.&lt;/p&gt;  &lt;h2&gt;WPF Clocks&lt;/h2&gt;  &lt;h3&gt;&lt;a href="http://www.charlespetzold.com/blog/2006/04/070132.html" target="_blank"&gt;Another Xamlifferous Experience (an All-XAML Clock)&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/AllXamlClock.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="AllXamlClock" border="0" alt="AllXamlClock" align="left" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SilverlightClocks_12166/AllXamlClock_thumb.png" width="228" height="224" /&gt;&lt;/a&gt; by &lt;a href="http://www.charlespetzold.com/"&gt;Charles Petzold&lt;/a&gt; on April 7, 2006&lt;/p&gt;  &lt;p&gt;This is an all XAML clock without any C# or .NET code. It was based on a Microsoft sample and Charles Petzold improved upon that sample by eliminating the C# code, improved the animation technique, and eliminated the repetition in the XAML. The clock graphic is basic and not fancy, but practical.    &lt;br clear="left" /&gt;&lt;/p&gt;&lt;img src="http://nimblecoder.com/blog/aggbug/78.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ryan Van Slooten</dc:creator>
            <guid>http://nimblecoder.com/blog/archive/2009/12/30/animated-clocks-for-svg-and-silverlight.aspx</guid>
            <pubDate>Wed, 30 Dec 2009 07:17:17 GMT</pubDate>
            <wfw:comment>http://nimblecoder.com/blog/comments/78.aspx</wfw:comment>
            <comments>http://nimblecoder.com/blog/archive/2009/12/30/animated-clocks-for-svg-and-silverlight.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://nimblecoder.com/blog/comments/commentRss/78.aspx</wfw:commentRss>
            <trackback:ping>http://nimblecoder.com/blog/services/trackbacks/78.aspx</trackback:ping>
        </item>
        <item>
            <title>SVG Building Map (Part 1)</title>
            <link>http://nimblecoder.com/blog/archive/2007/12/06/svg-building-map-part-1.aspx</link>
            <description>&lt;p&gt;&lt;a href="/blog/Samples/svg/building01/building.html"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="188" alt="SVG Building Map Sample 01" src="http://www.nimblecoder.com/blog/Images/nimblecoder_com/blog/WindowsLiveWriter/SVGBuildingMapPart1_14B47/buildmapsample01.png" width="244" align="left" border="0" /&gt;&lt;/a&gt;Due to blog restrictions, the sample is located on a separate page.&lt;/p&gt; &lt;p&gt;&lt;a href="/blog/Samples/svg/building01/building.html"&gt;building.html&lt;/a&gt;: SVG sample&lt;/p&gt; &lt;p&gt;&lt;a href="/blog/Samples/svg/building01/BuildingSample01.zip"&gt;BuildingSample01.zip&lt;/a&gt;: source (6KB)&lt;/p&gt; &lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: In my &lt;a href="/blog/archive/2007/12/04/svg-building-map-part-0.aspx" target="_blank"&gt;previous blog entry&lt;/a&gt;, I stated that SVG is a technology with diminishing support and that ultimately I plan to convert this building map to &lt;a href="http://silverlight.net/"&gt;SilverLight&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The first example is a very basic building map. I created a simple SVG file to represent a building and then created occupants for the building (as if you could keep these &lt;a href="http://www.looneytunes.com" target="_blank"&gt;crazy rascals&lt;/a&gt; in a building -- look at the names and you should know what I mean).&lt;/p&gt; &lt;p&gt;For simplicity this sample does not dynamically load the occupant information nor does it have multiple floors. Instead the occupants are specified in a static JavaScript file although this is identical to the Adobe sample where the occupants are static. Future enhancements will include these features as well as additional functionality.&lt;/p&gt; &lt;h3&gt;Step 1: Define the Building Map&lt;/h3&gt; &lt;p&gt;I used &lt;a href="http://inkscape.org/"&gt;Inkscape&lt;/a&gt; to create the SVG image, but ultimately ended up changing the SVG/XML by hand to create the simplest case for this example.&lt;/p&gt; &lt;h3&gt;Step 2: Define a "Room"&lt;/h3&gt; &lt;p&gt;This example will only make use of a "room" although future examples will have the concept of a "resource" (printer, conference room, etc.). In order to handle the JavaScript events (well technically &lt;a href="http://en.wikipedia.org/wiki/Ecmascript" target="_blank"&gt;ecmascript&lt;/a&gt; events), the script handlers need to be able to identify a room and so I simply used added the class "room" to the SVG element:&lt;/p&gt;&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/css"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="rem"&gt;/* snip, snip... */&lt;/span&gt;
.room {
    fill:#c0c0ff;
    stroke:#222277;
    stroke-width:1;
}
&lt;span class="rem"&gt;/* snip, snip... */&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;&amp;lt;!-- more snip, snip... --&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;g&lt;/span&gt;
        &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="room101"&lt;/span&gt;
        &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="room"&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;rect&lt;/span&gt;
            &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="rect101"&lt;/span&gt;
            &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="room"&lt;/span&gt;
            &lt;span class="attr"&gt;width&lt;/span&gt;&lt;span class="kwrd"&gt;="150"&lt;/span&gt;
            &lt;span class="attr"&gt;height&lt;/span&gt;&lt;span class="kwrd"&gt;="100"&lt;/span&gt;
            &lt;span class="attr"&gt;x&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt;
            &lt;span class="attr"&gt;y&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt;
        &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;text&lt;/span&gt;
            &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="text101"&lt;/span&gt;
            &lt;span class="attr"&gt;x&lt;/span&gt;&lt;span class="kwrd"&gt;="50"&lt;/span&gt;
            &lt;span class="attr"&gt;y&lt;/span&gt;&lt;span class="kwrd"&gt;="55"&lt;/span&gt;
            &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="label"&lt;/span&gt;
            &lt;span class="attr"&gt;xml:space&lt;/span&gt;&lt;span class="kwrd"&gt;="preserve"&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tspan&lt;/span&gt;
                &lt;span class="attr"&gt;x&lt;/span&gt;&lt;span class="kwrd"&gt;="50"&lt;/span&gt;
                &lt;span class="attr"&gt;y&lt;/span&gt;&lt;span class="kwrd"&gt;="55"&lt;/span&gt;
                &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="tspan101"&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;101&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tspan&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;g&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Notice that the room is defined as a group: { rect, text { tspan } }. The JavaScript handler will assume this definition will be consistent for all rooms.&lt;/p&gt;
&lt;h3&gt;Step 3: Add the Room handler to JavaScript&lt;/h3&gt;
&lt;p&gt;The JavaScript handler identifies a "room" to avoid processing elements that are "rooms." The line that contains: if (className != "room") will prevent the script from processing non-rooms.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// get room name and ID&lt;/span&gt;
&lt;span class="rem"&gt;///////////////////////&lt;/span&gt;
&lt;span class="kwrd"&gt;function&lt;/span&gt; getRoom(target)
{
    &lt;span class="kwrd"&gt;var&lt;/span&gt; svgElem = getNodeOrParent(target, &lt;span class="str"&gt;"g"&lt;/span&gt;);
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (svgElem)
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; thisRm = svgElem;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; thisType = thisRm.tagName;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; id = thisRm.getAttribute(&lt;span class="str"&gt;'id'&lt;/span&gt;);
        &lt;span class="kwrd"&gt;var&lt;/span&gt; className = thisRm.getAttribute(&lt;span class="str"&gt;'class'&lt;/span&gt;);
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (className != &lt;span class="str"&gt;"room"&lt;/span&gt;)
            &lt;span class="kwrd"&gt;return&lt;/span&gt;;

        &lt;span class="kwrd"&gt;var&lt;/span&gt; num;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; rect = getChildElem(svgElem, &lt;span class="str"&gt;"rect"&lt;/span&gt;);
        &lt;span class="kwrd"&gt;var&lt;/span&gt; text = getChildElem(svgElem, &lt;span class="str"&gt;"tspan"&lt;/span&gt;);
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (text)
            num = text.firstChild.data;

        &lt;span class="kwrd"&gt;return&lt;/span&gt; { &lt;span class="str"&gt;'num'&lt;/span&gt;:num, &lt;span class="str"&gt;'id'&lt;/span&gt;:id, &lt;span class="str"&gt;'rect'&lt;/span&gt;:rect, &lt;span class="str"&gt;'group'&lt;/span&gt;:svgElem };
    }
}
&lt;/pre&gt;
&lt;h3&gt;Step 4: Handle the mouse events&lt;/h3&gt;
&lt;p&gt;The base group specifies the event handlers for the entire SVG.&lt;/p&gt;&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;g&lt;/span&gt;
        &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="room-layer"&lt;/span&gt;
        &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="selector(evt);"&lt;/span&gt;
        &lt;span class="attr"&gt;onmouseover&lt;/span&gt;&lt;span class="kwrd"&gt;="onImg(evt);"&lt;/span&gt;
        &lt;span class="attr"&gt;onmouseout&lt;/span&gt;&lt;span class="kwrd"&gt;="offImg(evt);"&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;The local SVG functions are just references to JavaScript functions in the hosted page:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&amp;lt;script type=&lt;span class="str"&gt;"text/ecmascript"&lt;/span&gt;&amp;gt;&amp;lt;![CDATA[
&lt;span class="kwrd"&gt;function&lt;/span&gt; onImg(evt)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (top &amp;amp;&amp;amp; top.onImg)
        top.onImg(evt);
}

&lt;span class="kwrd"&gt;function&lt;/span&gt; offImg(evt)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (top &amp;amp;&amp;amp; top.offImg)
        top.offImg(evt);
}

&lt;span class="kwrd"&gt;function&lt;/span&gt; selector(evt)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (top &amp;amp;&amp;amp; top.selector)
        top.selector(evt);
}
]]&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;Step 5: Handle the onmouseover event&lt;/h3&gt;
&lt;p&gt;The mouseover event displays the occupant information. If the user has clicked on a room and selected that room, the mouseover event will not update the display information.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// room mouseovers&lt;/span&gt;
&lt;span class="kwrd"&gt;function&lt;/span&gt; onImg(mouseEvt)
{
    &lt;span class="rem"&gt;// No highlighting when an item is selected&lt;/span&gt;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (selection &amp;amp;&amp;amp; selection.room)
        &lt;span class="kwrd"&gt;return&lt;/span&gt;;

    &lt;span class="rem"&gt;// get the room name and ID&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; target = mouseTarget(mouseEvt);
    &lt;span class="kwrd"&gt;var&lt;/span&gt; room = getRoom(target);
    
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (room &amp;amp;&amp;amp;
        highlighted &amp;amp;&amp;amp; 
        highlighted.room &amp;amp;&amp;amp;
        highlighted.room.id == room.id)
    {
        &lt;span class="rem"&gt;// Same item as before highlighted&lt;/span&gt;
        &lt;span class="kwrd"&gt;return&lt;/span&gt;;
    }
    
    &lt;span class="rem"&gt;// save the style object for the rolloff&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; oldStyle = updateStyle(room, rollStyles.rollOver);
    &lt;span class="rem"&gt;// show the occupant info&lt;/span&gt;
    displayRoom(room);
    highlighted = { room: room, oldStyle: oldStyle } ;
}
&lt;/pre&gt;
&lt;h3&gt;Step 6: Handle the onmouseout event&lt;/h3&gt;
&lt;p&gt;When the user moves the mouse off of a room, the display will clear the occupant information. If a user is selected, the display will keep the selected occupant.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; offImg(mouseEvt)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (highlighted)
    {
        resetStyle(highlighted);
        highlighted = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    }
}
&lt;/pre&gt;
&lt;h3&gt;Step 7: Handle the room selection (onclick event)&lt;/h3&gt;
&lt;p&gt;When the user clicks on a room, the page will select that room and stop the automatic display of other information during mouseover and mouseout events.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; selector(mouseEvt) {
    &lt;span class="rem"&gt;// Turn off any highlighting&lt;/span&gt;
    offImg(mouseEvt);

    &lt;span class="rem"&gt;// get the room name and ID&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; target = mouseTarget(mouseEvt);
    &lt;span class="kwrd"&gt;var&lt;/span&gt; room = getRoom(target);

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (room &amp;amp;&amp;amp;
        selection &amp;amp;&amp;amp; 
        selection.room &amp;amp;&amp;amp;
        room.id == selection.room.id)
    {
        &lt;span class="rem"&gt;// Deselect the item&lt;/span&gt;
        resetStyle(selection);
        selection = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
        &lt;span class="kwrd"&gt;return&lt;/span&gt;;
    }

    resetStyle(selection);
    &lt;span class="rem"&gt;// save the style object for the rolloff&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; oldStyle = updateStyle(room, rollStyles.selected);

    &lt;span class="rem"&gt;// show the occupant info&lt;/span&gt;
    displayRoom(room);
    selection = { room: room, oldStyle: oldStyle } ;
}
&lt;/pre&gt;
&lt;h3&gt;Step 8: Handle the style changes to the SVG elements&lt;/h3&gt;
&lt;p&gt;A lot of the challenge to get this sample to work in FireFox was with the setProperty function. When I added the last "null" parameter, it started working.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; rollStyles = {
    rollOver: {
        fill            : &lt;span class="str"&gt;'cyan'&lt;/span&gt;
       ,&lt;span class="str"&gt;"stroke-width"&lt;/span&gt;  : &lt;span class="str"&gt;'3'&lt;/span&gt; }
   ,selected: {
        fill            : &lt;span class="str"&gt;'blue'&lt;/span&gt;
       ,&lt;span class="str"&gt;"stroke-width"&lt;/span&gt;  : &lt;span class="str"&gt;'3'&lt;/span&gt; }
};
&lt;span class="rem"&gt;/* snip, snip... */&lt;/span&gt;
&lt;span class="kwrd"&gt;function&lt;/span&gt; updateStyle(elem, styleType) {
    &lt;span class="kwrd"&gt;var&lt;/span&gt; svgElem = elem ? elem.rect: &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (svgElem &amp;amp;&amp;amp; styleType)
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; svgStyle = svgElem.style;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; oldStyle = { };
        &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;var&lt;/span&gt; name &lt;span class="kwrd"&gt;in&lt;/span&gt; styleType) {
            oldStyle[name] = svgStyle.getPropertyValue(name);
            &lt;span class="kwrd"&gt;try&lt;/span&gt; {
            svgStyle.setProperty(name, styleType[name], &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            } &lt;span class="kwrd"&gt;catch&lt;/span&gt; (e) {
                window.alert(&lt;span class="str"&gt;'Error '&lt;/span&gt; + e.number + &lt;span class="str"&gt;": "&lt;/span&gt; + e.message);
            }
        }
        elem[&lt;span class="str"&gt;"oldStyle"&lt;/span&gt;] = oldStyle;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; oldStyle;
    }
}

&lt;span class="kwrd"&gt;function&lt;/span&gt; resetStyle(elem) 
{
    &lt;span class="kwrd"&gt;var&lt;/span&gt; svgElem = (elem &amp;amp;&amp;amp; elem.room) ? elem.room.rect : &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; oldStyle = elem ? elem.oldStyle : &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (svgElem &amp;amp;&amp;amp; oldStyle)
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; svgStyle = svgElem.style;
        &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;var&lt;/span&gt; name &lt;span class="kwrd"&gt;in&lt;/span&gt; oldStyle) 
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; ( !oldStyle[name] )
                svgStyle.removeProperty(name);
            &lt;span class="kwrd"&gt;else&lt;/span&gt;
                svgStyle.setProperty(name, oldStyle[name], &lt;span class="kwrd"&gt;null&lt;/span&gt;);
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;Step 9: Display the occupant information&lt;/p&gt;
&lt;p&gt;When the onmouseover event fires on a room, the page displays the occupant information:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// display room info&lt;/span&gt;
&lt;span class="kwrd"&gt;function&lt;/span&gt; displayRoom(room)
{
    &lt;span class="kwrd"&gt;var&lt;/span&gt; found = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (room &amp;amp;&amp;amp; room.num)
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; id = &lt;span class="str"&gt;"Rm_"&lt;/span&gt; + room.num;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (g_rmData &amp;amp;&amp;amp; g_rmData[id]) 
        {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; person1 = g_rmData[id];
            document.getElementById(&lt;span class="str"&gt;"tdRoom"&lt;/span&gt;).innerHTML = person1.room;
            document.getElementById(&lt;span class="str"&gt;"tdName"&lt;/span&gt;).innerHTML = person1.name;
            document.getElementById(&lt;span class="str"&gt;"tdPhone"&lt;/span&gt;).innerHTML = person1.phone;
            document.getElementById(&lt;span class="str"&gt;"tdEmail"&lt;/span&gt;).innerHTML = &lt;span class="str"&gt;"&amp;lt;a href='mailto:"&lt;/span&gt; + person1.email + &lt;span class="str"&gt;"'&amp;gt;"&lt;/span&gt; + person1.email + &lt;span class="str"&gt;"&amp;lt;/a&amp;gt;"&lt;/span&gt;;
            found = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        }
    }
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!found) 
    {
            document.getElementById(&lt;span class="str"&gt;"tdRoom"&lt;/span&gt;).innerHTML = &lt;span class="str"&gt;"&amp;amp;nbsp;"&lt;/span&gt;;
            document.getElementById(&lt;span class="str"&gt;"tdName"&lt;/span&gt;).innerHTML = &lt;span class="str"&gt;"&amp;amp;nbsp;"&lt;/span&gt;;
            document.getElementById(&lt;span class="str"&gt;"tdPhone"&lt;/span&gt;).innerHTML = &lt;span class="str"&gt;"&amp;amp;nbsp;"&lt;/span&gt;;
            document.getElementById(&lt;span class="str"&gt;"tdEmail"&lt;/span&gt;).innerHTML = &lt;span class="str"&gt;"&amp;amp;nbsp;"&lt;/span&gt;;
    }
}
&lt;/pre&gt;
&lt;h3&gt;Step 10: Define the occupant information&lt;/h3&gt;
&lt;p&gt;For this sample, the data is defined in a static javascript file.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; g_rmRawData = [
 { room : &lt;span class="str"&gt;'100'&lt;/span&gt;, name : &lt;span class="str"&gt;'Bugs Bunny'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0100'&lt;/span&gt;, email : &lt;span class="str"&gt;'bugs.bunny@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'101'&lt;/span&gt;, name : &lt;span class="str"&gt;'Marvin the Martian'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0101'&lt;/span&gt;, email : &lt;span class="str"&gt;'marvin.the.martian@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'102'&lt;/span&gt;, name : &lt;span class="str"&gt;'Tweety'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0102'&lt;/span&gt;, email : &lt;span class="str"&gt;'tweety@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'103'&lt;/span&gt;, name : &lt;span class="str"&gt;'Taz'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0103'&lt;/span&gt;, email : &lt;span class="str"&gt;'taz@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'104'&lt;/span&gt;, name : &lt;span class="str"&gt;'Daffy Duck'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0104'&lt;/span&gt;, email : &lt;span class="str"&gt;'daffy.duck@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'105'&lt;/span&gt;, name : &lt;span class="str"&gt;'Foghorn Leghorn'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0105'&lt;/span&gt;, email : &lt;span class="str"&gt;'foghorn.leghorn@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'106'&lt;/span&gt;, name : &lt;span class="str"&gt;'Miss Prissy'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0106'&lt;/span&gt;, email : &lt;span class="str"&gt;'miss.prissy@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'107'&lt;/span&gt;, name : &lt;span class="str"&gt;'Chickenhawk'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0107'&lt;/span&gt;, email : &lt;span class="str"&gt;'chickenhawk@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'108'&lt;/span&gt;, name : &lt;span class="str"&gt;'Dawg'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0108'&lt;/span&gt;, email : &lt;span class="str"&gt;'dawg@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'109'&lt;/span&gt;, name : &lt;span class="str"&gt;'Wile E Coyote'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0109'&lt;/span&gt;, email : &lt;span class="str"&gt;'wile.e.coyote@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'110'&lt;/span&gt;, name : &lt;span class="str"&gt;'Road Runner'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0110'&lt;/span&gt;, email : &lt;span class="str"&gt;'road.runner@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'111'&lt;/span&gt;, name : &lt;span class="str"&gt;'Speedy Gonzalez'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0111'&lt;/span&gt;, email : &lt;span class="str"&gt;'speedy.gonzalez@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'112'&lt;/span&gt;, name : &lt;span class="str"&gt;'Pepe Le Pew'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0112'&lt;/span&gt;, email : &lt;span class="str"&gt;'pepe.le.pew@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'113'&lt;/span&gt;, name : &lt;span class="str"&gt;'Penelope'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0113'&lt;/span&gt;, email : &lt;span class="str"&gt;'penelope@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'114'&lt;/span&gt;, name : &lt;span class="str"&gt;'Porky Pig'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0114'&lt;/span&gt;, email : &lt;span class="str"&gt;'porky.pig@looneytunes.null'&lt;/span&gt; }
,{ room : &lt;span class="str"&gt;'115'&lt;/span&gt;, name : &lt;span class="str"&gt;'Elmer Fudd'&lt;/span&gt;, phone : &lt;span class="str"&gt;'1-800-555-0115'&lt;/span&gt;, email : &lt;span class="str"&gt;'elmer.fudd@looneytunes.null'&lt;/span&gt; }
];

&lt;span class="kwrd"&gt;var&lt;/span&gt; g_rmData = [];

&lt;span class="kwrd"&gt;function&lt;/span&gt; loadRoomData()
{
    &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; g_rmRawData.length; ++i)
        g_rmData[&lt;span class="str"&gt;'Rm_'&lt;/span&gt; + g_rmRawData[i].room] = g_rmRawData[i];
}

loadRoomData();
&lt;/pre&gt;
&lt;p&gt;For those who are interested, I copied the names of the characters from the Looney Tunes site and ran this Python script:&lt;/p&gt;&lt;pre class="csharpcode"&gt;def makeemail(s):
    &lt;span class="kwrd"&gt;return&lt;/span&gt; s.lower().replace(&lt;span class="str"&gt;' '&lt;/span&gt;,&lt;span class="str"&gt;'.'&lt;/span&gt;) + &lt;span class="str"&gt;'@looneytunes.null'&lt;/span&gt;
    
def makedict(name, num):
    &lt;span class="kwrd"&gt;return&lt;/span&gt; { &lt;span class="str"&gt;'name'&lt;/span&gt;:name, &lt;span class="str"&gt;'room'&lt;/span&gt;:str(num), &lt;span class="str"&gt;'email'&lt;/span&gt;:makeemail(name) }
    
def makedata(names, num, f):
    &lt;span class="kwrd"&gt;for&lt;/span&gt; name &lt;span class="kwrd"&gt;in&lt;/span&gt; names:
        print f % makedict(name, num)
        num = num + 1

n = [&lt;span class="str"&gt;"Bugs Bunny"&lt;/span&gt;,
    &lt;span class="str"&gt;"Marvin the Martian"&lt;/span&gt;,
    &lt;span class="str"&gt;"Tweety"&lt;/span&gt;,
    &lt;span class="str"&gt;"Taz"&lt;/span&gt;,
    &lt;span class="str"&gt;"Daffy Duck"&lt;/span&gt;,
    &lt;span class="str"&gt;"Foghorn Leghorn"&lt;/span&gt;,
    &lt;span class="str"&gt;"Miss Prissy"&lt;/span&gt;,
    &lt;span class="str"&gt;"Chickenhawk"&lt;/span&gt;,
    &lt;span class="str"&gt;"Dawg"&lt;/span&gt;,
    &lt;span class="str"&gt;"Wile E Coyote"&lt;/span&gt;,
    &lt;span class="str"&gt;"Road Runner"&lt;/span&gt;,
    &lt;span class="str"&gt;"Speedy Gonzalez"&lt;/span&gt;,
    &lt;span class="str"&gt;"Pepe Le Pew"&lt;/span&gt;,
    &lt;span class="str"&gt;"Penelope"&lt;/span&gt;,
    &lt;span class="str"&gt;"Porky Pig"&lt;/span&gt;,
    &lt;span class="str"&gt;"Elmer Fudd"&lt;/span&gt;,
]

s = &lt;span class="str"&gt;"{ room : '%(room)s', name : '%(name)s', phone : '1-800-555-0%(room)s', email : '%(email)s' }"&lt;/span&gt;

makedata(n, 100, s)
&lt;/pre&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;This sample demonstrates the simplest case with static data and a very simple building map with a small number of occupants. Part of the challenge I had when I first analyzed the Adobe Visual Building Search sample was the complexity and questionable coding. Hopefully this sample is much simpler.&lt;/p&gt;
&lt;p&gt;Part of the challenge in developing for the web is the differences in the browsers -- occasionally it is because one browser will let you get away with something you shouldn't be able to do. That was the case with this example -- I spent a little extra time making it work with FireFox. The eventing model and JavaScript was a little less forgiving in FireFox than IE.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3A//www.nimblecoder.com/blog/archive/2007/12/06/svg-building-map-part-1.aspx"&gt;&lt;img alt="kick it" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3A//www.nimblecoder.com/blog/archive/2007/12/06/svg-building-map-part-1.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:83e6fb6c-f3e2-4fa1-b1fd-e4ba04553b75" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/svg" rel="tag"&gt;svg&lt;/a&gt;, &lt;a href="http://technorati.com/tags/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/div&gt;&lt;img src="http://nimblecoder.com/blog/aggbug/54.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ryan Van Slooten</dc:creator>
            <guid>http://nimblecoder.com/blog/archive/2007/12/06/svg-building-map-part-1.aspx</guid>
            <pubDate>Fri, 07 Dec 2007 05:33:04 GMT</pubDate>
            <wfw:comment>http://nimblecoder.com/blog/comments/54.aspx</wfw:comment>
            <comments>http://nimblecoder.com/blog/archive/2007/12/06/svg-building-map-part-1.aspx#feedback</comments>
            <wfw:commentRss>http://nimblecoder.com/blog/comments/commentRss/54.aspx</wfw:commentRss>
            <trackback:ping>http://nimblecoder.com/blog/services/trackbacks/54.aspx</trackback:ping>
        </item>
        <item>
            <title>SVG Building Map (Part 0)</title>
            <link>http://nimblecoder.com/blog/archive/2007/12/04/svg-building-map-part-0.aspx</link>
            <description>&lt;p&gt;I have been interested in SVG since its inception but it has lost all momentum and support and even Adobe has &lt;a href="http://www.adobe.com/svg/eol.html" target="_blank"&gt;announced the discontinuation&lt;/a&gt; of the Adobe SVG Viewer. SVG is still used with Google maps with FireFox and possibly mobile phone, but as far as I can tell there is not significant industry backing and it appears there will never be.&lt;/p&gt; &lt;p&gt;Microsoft is offering &lt;a href="http://silverlight.net/" target="_blank"&gt;SilverLight&lt;/a&gt; and it seems to be very promising. I have several ideas for future tools using SilverLight but I thought it would be useful to first try them in SVG so I can take the experience from that implementation first.&lt;/p&gt; &lt;p&gt;One of the first examples of the possibilities of SVG that I saw was an &lt;a href="http://archive.devx.com/xml/articles/nm030402/nm030402-1.asp" target="_blank"&gt;article&lt;/a&gt; written by Nigel McFarlane which showed several accounts (represented rectangles) that could be graphically linked to payment methods (credit card, EFT card, etc.). There were also numerous &lt;a href="http://www.adobe.com/svg/examples.html" target="_blank"&gt;examples from Adobe&lt;/a&gt; although it seems they have reduced the number of samples which coincides with their curtailed support.&lt;/p&gt; &lt;p&gt;The most interesting sample that I saw was the Visual Building Search. The sample showed the east and west towers of the Adobe headquarters and allowed the user to select the tower and floor. It then showed a diagram of the floor plan with offices and conference rooms. When you hovered over or selected an office, it displayed the name and contact information for the occupant. The sample was a very nice proof of concept although it was not designed to be externally adapted. For example, the sample uses framesets extensively, stores personnel and room information in static html files, and the JavaScript used many global variables and needed refactoring (note to programmer: semi-colons should not be treated as optional in JavaScript).&lt;/p&gt; &lt;p&gt;I decided to move the display results into HTML rather than displaying it in the SVG as it will allow for more possibilities as the sample progresses.&lt;/p&gt; &lt;p&gt;Initial problems along the way:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Inkscape saved the SVG namespace with the svg: prefix, however when I copied the script and style nodes I forgot to add the namespace. So the style and script elements were not recognized in Mozilla, but IE+Adobe SVG Viewer did not seem to mind.  &lt;/li&gt;&lt;li&gt;When I saved the SVG document in Inkscape as "Plain SVG," it removed all of my class attributes, but that may have been due to operator error and the manual class definition I added being incorrect. (I rewrote the styles after this and it works now.)  &lt;/li&gt;&lt;li&gt;There is a difference for the style.setProperty() in IE and Mozilla. I had to add a third parameter with a value of null to use style.setProperty(name, value, null);&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Goals:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Display a building map showing room numbers, conference rooms, and other information. Show the occupant information when a room is highlighted or selected. Start with a simple case and expand to a more complex case. It must support FireFox and IE. &lt;/li&gt;&lt;li&gt;Support dynamic generation of building information such as conference room and occupant information.  &lt;/li&gt;&lt;li&gt;Add extensions to display LDAP or Active Directory information about occupants and conference rooms.  &lt;/li&gt;&lt;li&gt;Eventually add support for displaying information about other resources, especially printers. (The printer location information is not very descriptive at my company.)&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;In my next post I will show the simple case from Goal #1.&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6ea981bf-4ec9-41e7-969f-355a6a286eaf" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/svg" rel="tag"&gt;svg&lt;/a&gt;&lt;/div&gt;&lt;img src="http://nimblecoder.com/blog/aggbug/53.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ryan Van Slooten</dc:creator>
            <guid>http://nimblecoder.com/blog/archive/2007/12/04/svg-building-map-part-0.aspx</guid>
            <pubDate>Wed, 05 Dec 2007 05:15:45 GMT</pubDate>
            <wfw:comment>http://nimblecoder.com/blog/comments/53.aspx</wfw:comment>
            <comments>http://nimblecoder.com/blog/archive/2007/12/04/svg-building-map-part-0.aspx#feedback</comments>
            <wfw:commentRss>http://nimblecoder.com/blog/comments/commentRss/53.aspx</wfw:commentRss>
            <trackback:ping>http://nimblecoder.com/blog/services/trackbacks/53.aspx</trackback:ping>
        </item>
    </channel>
</rss>