Wijmo 2013 v1 Releases Mobile Widgets and an HTML5 Spreadsheet Control

A Collection of UI Widgets for Both Mobile and Web Development now with BreezeJS Support

PITTSBURGH, PA – April 18, 2013 - ComponentOne, a division of GrapeCity and a leader in developer-productivity tools, has announced the 2013 v1 release of Wijmo Enterprise: a kit of user interface (UI) widgets for HTML5 development. This release debuts a new addition to the kit, a high performance spreadsheet component for enterprise web application development.

“We have expanded our collection of over 40 widgets to include first-class mobile support,” said Chris Bannon, product manager at ComponentOne.  “All of our widgets will automatically adapt to jQuery Mobile or jQuery UI environments given we have created the first and only Adaptive Widget Framework on the market with this release” said Bannon.

Initially released as a Beta version in February of 2013 and since moved into RTW (release to web),  Wijmo Enterprise   now models the company’s other products with a subscription-based plan. Bannon shared that, “Wijmo will feature three releases per year and any customer with a current subscription will be eligible for free upgrades.”

BreezeJS is quickly becoming the industry standard plug-in for providing data services to JavaScript applications and the 2013 v1 release of Wijmo integrates with these standards. This integration with BreezeJS keeps Wijmo lightweight and gives developers the flexibility to choose the frameworks they want to work in.

Building off the company’s 20 years’ experience with spreadsheet controls, ComponentOne has introduced SpreadJS, the new spreadsheet control which is now part of Wijmo Enterprise. This JavaScript-based widget uses HTML5 Canvas to render Excel-like spreadsheets. “SpreadJS brings additional data visualization and calculation features into your web applications,” said Bannon. “Now you can create calculators, dynamic interactive dashboards, rich colorful reports, and much more using SpreadJS.”

Availability                                                                                                                                                                              The Company offers download and purchase options online at https://wijmo.com/purchase/  or by email at sales@wijmo.com.

Resources

Chris Bannon Blog post: http://wijmo.com/wijmo-2013v1-has-landed/

About Wijmo                                                                                                                                                                               Wijmo provides a set of jQuery widgets for creating interactive websites and apps. Built on jQuery UI and jQuery Mobile guidelines and frameworks, each widget is fully themed and theme-able using Themeroller. Wijmo has everything you need including grids, charts, interactive widgets, and more. Visit http://wijmo.com. Follow @wijmo at http://twitter.com/wijmo and “Like” Wijmo on Facebook at http://www.facebook.com/Wijmo.

Maintaining Aspect Ratio In Wijgallery

When large images are displayed in the wijgallery widget, the images get stretched (auto sized) to fit the display area. However, users may want to see the images in the same Aspect Ratio as the original ones. In this article we’ll discuss a simple approach on how to do just that.

Setting Up Wijgallery

Setting up the wijgallery widget is trivial. We just need to declare a ‘div‘ element which would act as the wijgallery widget and add a few ‘img‘ elements for displaying the images.

<div id="gallery">
   <ul>
      <li><a href="Images/Desert.jpg">
         <img title="Word Caption 1" src="Images/Desert.jpg" alt="1" />
      </a></li>
      <li><a href="Images/Tulips.jpg">
         <img title="Word Caption 2" src="Images/Tulips.jpg" alt="2" />
      </a></li>
   </ul>
</div>

The next step is to initialize the wijgallery widget and we’re good to go.

$(document).ready(function () {
   $("#gallery").wijgallery({
      thumbnailOrientation: "vertical",
      thumbnailDirection: "before"
   });
});

Now, when we run this sample, we’ll observe that the image is stretched horizontally to fit the width of the display area of wijgallery.

So, how so we deal with this issue? It’s simple. We need to find the aspect ratio of the original image and adjust the width of the displayed image according to this aspect ratio.

Calculating the Aspect Ratio

For calculating the aspect ratio, we must know the GCD(Greatest Common Divisor) of the height and width values of the original image. For this we’ll use a small recursive function called ‘GCD’.

function GCD(a, b) {
   return (b == 0) ? a : GCD(b, a % b);
}
var width = $("#gallery").data("wijgallery").ul[0].children[0].scrollWidth;
var height = $("#gallery").data("wijgallery").ul[0].children[0].scrollHeight;
var gcd = GCD(width, height);

Once we know the gcd, we can find the aspect ratio of the image in the following way :

var aspectRatio = width / gcd + ":" + height / gcd;

Resizing the Image

Now, all we need to do is to set the width of the image according to this aspect ratio.

galleryHeight = $(".wijmo-wijgallery-content").height();

var actualWidth = (galleryHeight * (width / gcd)) / (height / gcd);
$(".wijmo-wijgallery-content img:eq(0)").width(actualWidth);

Important

An important thing to note here is that the above code would resize only the first image because all images are not loaded into the DOM at document.ready(). To make sure that all the subsequent images are also resized according to the aspect ratio, we must run this code in the ‘beforeTransition‘ event of wijgallery as well with a slight modification.

$("#gallery").wijgallery({
   thumbnailOrientation: "vertical",
   thumbnailDirection: "before",
   beforeTransition: BeforeTransition
});

function BeforeTransition(e, args) {
   var index = args.to;
   var width = $("#gallery").data("wijgallery").ul[0].children[index].scrollWidth;
   var height = $("#gallery").data("wijgallery").ul[0].children[index].scrollHeight;
   var gcd = GCD(width, height);
   var aspectRatio = width / gcd + ":" + height / gcd;
   var actualWidth = (galleryHeight * (width / gcd)) / (height / gcd);
   $(".wijmo-wijgallery-current img").width(actualWidth);
}

After resizing the image, it’ll be displayed according to the aspect ratio as below :

Please take a look at the attached sample for complete implementation.

Download Sample

Wijmo v3 Beta 3 has Landed

I am happy to announce the 3rd preview release of Wijmo 3.0.0. This release includes a ton of polish to our Adaptive Widget Framework. More importantly, this release features Wijmo Data.

Wijmo Data is a very light DataView API that is easily extended with Adapters. We originally wrote a very robust Data API, but decided to scale back our own library and instead integrate popular libraries. This release features our own Breeze Data Adapter that makes using Breeze with wijmo quite seamless. BreezeJS is becoming an industry standard, and our philosophy is to embrace and integrate with standards. By doing so, we can keep wijmo lightweight and you can choose the frameworks you want to work with.

We are also providing an Ajax Data Adapter with JSONP support and an Array Data Adapter for working with local JavaScript arrays of data. DataView also supports Knockout and can output an Observable Array from any data set.

Take a look at our new Wijmo Data samples online or read the docs.

Go Get It!

Download Wijmo v3 Beta, explore the new mobile widgets or learn more about v3. If you have any feedback or questions about please post them in the v3 Beta forum. We have also published some documentation for the widgets to help you get started. The docs will be updated during the Beta process so please be patient if something is missing momentarily.