Tag Archives: HTML5

Charts Development Web Development

HTML5 Canvas – Donut chart builder

Over the past couple of days I’ve been steadily making progress through Foundation HTML5 Canvas by Rob Hawkes. So far it’s a really great book, and I feel like I’m picking things up pretty rapidly (that’s a recommendation for you, by the way – seriously, if you’re thinking of learning how to use canvas, get it).

To test myself on what I had learned so far I decided to build a donut chart maker. It could just as easily have been a pie chart maker, but I wanted that extra bit of a challenge.

donut

Before you say “don’t you hate pie charts, though?”, I’ll answer with a “generally yes, thanks”. I just figured it to be a decent challenge to set myself. A bar chart would have been relatively easy, I think (although I might have a go at some point in the future.

Now, I know I’ve probably not built it in the most efficient way, but I’m really pleased with progress so far. Basically, enter a comma separated list of values in the box and click ‘Go’ and a donut chart is built in the canvas space. Slice angles are automatically calculated based on what proportion each value is to the sum of all the values together.

Anyway, I just wanted to share it with you. My code is available on Github for those interested in looking at/critiquing/playing around with it. By all means fork it if you find something that you want to add.

I’m hoping to do much more with this in the near future, including maybe incorporating labels and percentage values into the chart, so do keep an eye out. I’m also thinking about how I could use the canvas element to create some other useful charts from scratch – it’s all exciting stuff!!

Technology

Add-ons to the web?

After writing my previous post about HTML5 and Apple’s comment about it being ‘the web’ and not just an add-on to it I’ve been thinking a little bit more about the standoff between Apple and Adobe on Flash and HTML5.

What would you say is ‘the web’?  To most people ‘the web’ would probably be defined as the online world we see via our chosen browser, be it Chrome, FireFox or Opera (notice I didn’t mention IE – I don’t like it.  At all).  ‘The web’ and the content displayed on our screens is a set of tagged text and interpreted programming scripts which are compiled, processed and output so that our browser can display their intended content.  Browsers are, in essence a window through which we can view the online world others want us to see.  This text, however, still has to be interpreted by a piece of software written by somebody else to be displayed in a specified way.  Without that processing things would be near impossible to read (unless you could read the code as it streamed down the screen like in The Matrix).  In cases where this software isn’t up to date the output sometimes doesn’t look the way it should, hence older browsers no longer support some of today’s more content-rich websites.  My girlfriends daughters netbook for example (which runs on Windows CE) doesn’t support certain websites because the version of IE installed is too old to understand the tags and scripts some of the sites send out.  This means that, because of a lack of software support she can’t visit certain sites or view them the way they were intended.

Is ‘the web’ just HTML though?  What about programs like Spotify?  Spotify requires an Internet connection, but it certainly isn’t HTML being processed which brings the user streaming music on demand.  Once again it’s just another piece of software which interprets data for some purpose and end-user experience.  iTunes is the same.  It’s a software product which connects to the web and interprets the data it receives.  And what about online gaming?  These applications aren’t ‘the web’ as described by Apple.  Could they maybe considered ‘add-ons’ to it?

With that in mind, why is Flash considered an ‘add-on’ to the web?  Surely it’s just a downloadable enhancement to another existing piece of software to help facilitate user experience of the vast digital world we should all be able to access.  It might be a little clunky and not entirely conducive to good end-user experiences when, for example, using touchscreen technology, but it is a part of ‘the web’ we’re accustomed to.  If it’s that bad and no longer a part of the future of online computing it will eventually just die out itself, won’t it?  The same happened with a lot of ActiveX controls that some of the early websites required to run properly.  People eventually just stopped designing websites that required their installation because it was time-consuming, sometimes risky and generally off-putting.  At the moment however, a lot of websites are using Flash for advertising and interactive content.  From the look of it HTML5 will go some distance towards making some of that stuff integral to the web-browser experience without additional downloads or browser plugins, but I don’t think it will be something that happens anytime soon.

I’m actually starting to think that Apple have instigated a risky war here.  I might (and possibly will) be wrong, but I don’t think stopping certain content that exists on the web from being displayed is the right way to go about it.  It feels like some kind of digital censorship.

Technology Web Links

Apple showcases HTML 5 (and has a bit of a dig at Flash, again!)

Apple are currently showcasing HTML5 on their website by showcasing some samples of what it can do.  They’ve even managed to have a bit of a dig at Flash in their blurb, claiming that the new web standards of HTML5 are open and not just ‘add-ons to the web’.

Crafty.

I don’t like the idea that I have to download Safari to check the showcase out though…

(thanks for the link Mike)

Technology

Adobe promoting “Freedom of choice”

Wanting to know a little bit more about HTML5 and generally catchup with techy stuff (I’ve been out of touch recently) I did a Google search for it and was amused to see the sponsored link which appeared in my results.

The link itself leads to a page where you can read a letter from John Warnock and Chuck Geschke about open markets and (you guessed it) a few little digs at Apple:-

We believe that Apple, by taking the opposite approach, has taken a step that could undermine this next chapter of the web — the chapter in which mobile devices outnumber computers, any individual can be a publisher, and content is accessed anywhere and at any time.

In the end, we believe the question is really this: Who controls the World Wide Web? And we believe the answer is: nobody — and everybody, but certainly not a single company.

It would seem the war between Adobe and Apple is far from over, although I was amused to read that Apple are still apparently happy to advertise the Adobe Creative Suite for Macs, even though that same suite of products contains Flash.  Similarly amusing is a story I read on Engadget about how the Android 2.2 operating system will actively send new users to Flash-driven websites once it has updated.

I eagerly await the next instalment…