GoogleTranslate Service


Using Google interactive charts and WordPress to visualise data

August 25th, 2012 by Graham Attwell

This is a rare techy post (and those of you who know me will also know that my techy competence is not so great so apologies for any mistakes).

Along with a university partner, Pontydysgu bid for a small contract to develop a system to allow the visualisation of labour market data. The contractors had envisaged a system which would update automatically from UK ONS quarterly labour market data: a desire clearly impossible within the scope of the funding.

So the challenge was to design something which would make it easy for them to manually update the data with visualisations being automatically updated from the amended data. Neither the contractors or indeed the people we were working with in the university had any great experience of using visualisation or web software.

The simplest applications seemed to me to be the best for this. Google spreadsheets are easy to construct and the interactive version of the chart tools will automatically update when embedded into a WordPress bog.

Our colleagues at the university developed a comprehensive spreadsheet and added some 23 or so charts.  So far so good. Now was the time to develop the website. I made a couple of test pages and everything looked good. I showed the university researchers how to edit in WordPress and how to add embedded interactive charts. And that is where the problems started. They emailed us saying that not only were their charts not showing but the ones i had added had disappeared!

The problem soon became apparent. WordPress, as a security feature, strips what it sees as dangerous JavaScript code. We had thought we could get round this by using a plug in called Raw.  However in a WordPress multi-site, this plug in will only allow SuperAdmins to post unfiltered html. This security seems to me over the top. I can see why wordpress.com will prevent unfiltered html. And I can see why in hosted versions unfiltered html might be turned off as a default. But surely, on a hosted version, it should be possible for Superadmins to have some kind of control over what kind of content different levels of users are allowed to post. The site we are developing is closed to non members so we are unlikely to have a security risk and the only Javascript we are posting comes from Google who might be thought to be trusted.

WordPress is using shortcodes for embeds. But there are no shortcodes for Google Charts embed. There is shortcode for using the Google Charts API but that would invalidate our aim of making the system easy to update. And of course, we could instead post an image file of the chart, but once more that would not be dynamically updated.

In the end my colleague Dirk hacked the WordPress code to allow editors to post unfiltered html but this is not an elegant answer!

We also added the Google code to Custom Fields allowing a better way to add the embeds.

Even then we hot another strange and time wasting obstacle. Despite the code being exactly the same, code copied and posted by our university colleagues was not being displayed. The only difference in the code is that when we posted it it had a lot of spaces, whist theirs appeared to be justified. It seems the problem is a Copy/ Paste bug in Microsoft Explorer 9, which is the default bowser in the university, which invalidates some of the javascript code. The work around for this was for them to install Firefox.

So (fingers crossed) it all works. But it was a struggle. I would be very grateful for any feedback – either on a better way of doing what we are trying to achieve – or on the various problems with WordPress and Google embed codes. Remember, we are looking for something cheap and easy!

 

Comments are closed.

  • Search Pontydysgu.org

    News Bites

    Teenagers online in the USA

    According to Pew Internet 95% of teenagers in the USA now report they have a smartphone or access to one. These mobile connections are in turn fueling more-persistent online activities: 45% of teens now say they are online on a near-constant basis.

    Roughly half (51%) of 13 to 17 year olds say they use Facebook, notably lower than the shares who use YouTube, Instagram or Snapchat.

    The survey also finds there is no clear consensus among teens about the effect that social media has on the lives of young people today. Minorities of teens describe that effect as mostly positive (31%) or mostly negative (24%), but the largest share (45%) says that effect has been neither positive nor negative.


    Robots to help learning

    The TES reports on a project that uses robots to help children in hospital take part in lessons and return to school has received funding from the UK Department for Education.

    TES says “The robot-based project will be led by medical AP provider Hospital and Outreach Education, backed by £544,143 of government money.

    Under the scheme, 90 “tele-visual” robots will be placed in schools and AP providers around the country to allow virtual lessons.

    The robot, called AV1, acts as an avatar for children with long-term illnesses so they can take part in class and communicate with friends.

    Controlling the robot remotely via an iPad, the child can see and hear their teacher and classmates, rotating the robot’s head to get a 360-degree view of the class.

    It is hoped the scheme will help children in hospital to feel less isolated and return to school more smoothly.”


    Gutenburg

    According to developer Gary Pendergast, WordPress 5, Gutenberg, is nearing release.

    Pendergast says: “As the WordPress community, we have an extraordinary opportunity to shape the future of web development. By drawing on the past experiences of WordPress, the boundless variety and creativity found in the WordPress ecosystem, and modern practices that we can adopt from many different places in the wider software world, we can create a future defined by its simplicity, its user friendliness, and its diversity.”


    Adult Education in Wales

    Learning and Work Institute is organising this year’s adult learning conference in partnership with the Adult Learning Partnership Wales. It will take place on Wednesday, 16 May 2018 at the Cardiff City Stadium.

    They say “Changing demographics and a changing economy requires us to re-think our approach to the delivery of learning and skills for adults. What works and what needs to change in terms of policy and practice?

    The conference will seek to debate how can we respond to need, grow participation, improve and measure outcomes for citizens, and revitalise community education.”


    Other Pontydysgu Spaces

    • Pontydysgu on the Web

      pbwiki
      Our Wikispace for teaching and learning
      Sounds of the Bazaar Radio LIVE
      Join our Sounds of the Bazaar Facebook goup. Just click on the logo above.

      We will be at Online Educa Berlin 2015. See the info above. The stream URL to play in your application is Stream URL or go to our new stream webpage here SoB Stream Page.

  • Twitter

  • Sounds of the Bazaar AudioBoo

  • Recent Posts

  • Archives

  • Meta

  • Upcoming Events

      There are no events.
  • Categories