Issue with displaying sample d3 graph bar chart on IE 8 - ruby-on-rails

I've been referring to a sample Bar Chart Screencast and I'm currently trying to see how does d3.js work on IE 8. I've copied the sample code present in the screencast tutorial and I've placed the same in this file in my app. Based on the wiki of d3 I've tried including Aight(aight.js and aight.d3.js) in my Rails app, in my layout . But when I've tried hitting a sample url /companies/company_division_stats on IE 8, nothing shows up. It works well on Chrome and Firefox.
I understand that aight.js might have limited support in terms of functions wrt IE 8 browser. Is it because of this reason that my d3 graph doesn't show up on IE 8 and shows up on other browsers or is it something to do with my code ?
My code is present on github. Can any one please tell me in case I'm missing something.

For IE8, you would need to limit yourself to manipulating regular HTML DOM nodes with D3. But the example you linked uses SVG, which is not supported by IE8:
http://caniuse.com/svg
From the D3 wiki you linked:
You'll need a modern browser to use SVG and CSS3 Transitions. D3 is not a compatibility layer, so if your browser doesn't support standards, you're out of luck. Sorry!
From the Aight github page (emphasis mine):
Aight is a collection of shims and polyfills that get IE8 up to speed with a bare minimum of HTML5 compatibility, providing all of the interfaces necessary to do HTML-only DOM manipulation with d3.js (and other libraries that rely on those interfaces)
If you're looking for examples that do not use SVG, the first eight of Scott Murray's Tutorials use only HTML. However, I think you'll find that most other examples on the web use D3 with SVG. If IE8 support is important to you, another library such as Raphael may be more appropriate.

Related

Convert Div element as image, ii should support in IE 7 & 8

I am using jqplot charting library to draw the chart in my ASP.NET MVC application.Inside the div element, rendering the chart.I am trying to convert the div element as image, export to pdf document.
For IE 9 and later, jqplotToImageElem() method [support canvas browsers only] is working fine and able to export.
For IE 7 & 8 it is not working as expected, since it is using excanvas.js to render the chart.
Is there any workaround to implement this for IE 7 & 8 browsers?
For IE<9 users you have multiple possibilities:
Use node.js on the server to generate your jqplot image and then let them download that image off the server.
Require that they install Google Chrome Frame which will works within IE<9 to give it modern capabilities like canvas. See: https://developers.google.com/chrome/chrome-frame/
Since jqPlot evidently works but doesn't print in IE<9, just have those users print using a screen capture program.
Microsoft recently realized that their non-modern IE's were a liability to the web and has begun auto-updating older IE users to modern versions of IE (See: http://www.paulirish.com/2012/the-skinny-on-ies-update-policy/). So as #amhed suggests, you could require that your users "get with the program" and update to at least IE9. Alternatively, update to Chrome, Firefox, any-modern-browser.
There would be very few clients you couldn't service with #1-4 (but we're looking at you "certain banking institutions" who run on XP and for security reasons & disallow browser upgrades). But for those few clients, you might have to use a GDI-based charting program rather that jqplot.

HTML link to specific pages in PDF

I have looked around the web and have found that appending #page=?? to the end of a PDF link will automatically take the visitor to that specific page in the PDF file.
I was wondering if this is still best practice as it doesn't seem to be working for me (Chrome on Windows 7). Also, all the articles I have found so far date back to 2006-2008, have things changed recently?
This is still valid code but it may require that some version of Acrobat (Reader, Pro, etc) be installed as a plugin on the browser in order for it to work as expected. Since multiple commonly-used browsers now have a built-in reader (Chrome, Safari for iOS are the big two that come to mind) support for direct page linking is somewhat spotty now. You can still do it...the worst case scenario is that the PDF just opens to the first page for those users but I would advise to just leave off the direct page link. If the page is that important, extract it to a separate PDF and link to that.

What is the value of HTML5 Boilerplate for a Rails application?

There are several application templates (and a Rails gem) that add HTML5 Boilerplate to a Rails application. So I investigated and put together an analysis of HTML5 Boilerplate for Rails. It seems HTML5 Boilerplate doesn't add much that isn't already there in a new Rails app. What's useful:
sample humans.txt file
example index.html file for a default application layout
viewport metatag
Google Analytics snippet
There's some CSS help like CSS normalization, placeholder CSS Media Queries, and CSS helper classes but it seems you'd get all of them and more with a CSS toolkit such as Skeleton, Twitter Bootstrap or Zurb Foundation.
Finally, HTML5 Boilerplate has lots of components for websites that need to support IE6, 7, and 8 such as IE conditional comments, Modernizr, and Chrome Frame. But if I'm not supporting IE6 and I'm using Twitter Bootstrap or Zurb Foundation I don't think I need these.
HTML5 Boilerplate is a good project that has lots of community input. There's a lot of good advice on its website. But for a Rails project?
Am I missing something? What is the value of HTML5 Boilerplate for a Rails application?
HTML5 Boilerplate has a few different features, typically borrowed from other projects.
A server config file for setting timeouts, turning sendfile on, gzipping, server expiration, etc. I believe their repo has a few different versions of these files for a few different servers (apache, nginx, node, lighttpd). You can find those config files here: https://github.com/h5bp/server-configs. From my understanding Rails doesn't have any type of equivalent for this.
It also comes with a custom build of Modernizr that checks for HTML5 and CSS3 features within the browser and then adds classes to your <html> tag so that you can utilize them within your stylesheets or javascripts. This allows you to target browsers with a fallback style or interaction if it didn't support the feature you were trying to use. One example for CSS may be something like border-image which doesn't have widespread support. You could apply border-image: for the browsers that can use it and for the others you would use the class that HTML5Boilerplate provides (html.no-borderimage) to provide a backup style. You could also check for these classes from your JavaScript to be sure you weren't targeting browsers with code they didn't need (or couldn't respond to). Rails doesn't have anything internally that would do this out of the box.
Respond.js is also packaged with Modernizr which gives you media queries support in browsers that don't already have it. You mentioned you weren't targeting IE6 but IE7 & IE8 don't support Media Queries (nor do a good amount of mobile browsers) and Respond.js would give you that support. Rails also doesn't have anything built in to handle this.
Modernizr relies on yepnope.js to load externals so that would be available to you as well. This library allows you to test for features and load certain scripts/styles based on the result of that test. This is helpful if you are bringing in files that only some browsers need. Rails doesn't do this.
PNG fixes. You probably don't need this if you aren't supporting IE6 but it does come packaged with some png fixes for legacy browsers (cough IE6). Rails doesn't really handle this type of thing on the front end on it's own.
Ultimately you could grab the pieces that you need and bring them into your application without bringing in the entire HTML5 Boilerplate (and fwiw, that's what I typically do as well). That said, your question is "what value does HTML5 Boilerplate bring to a Rails application?" and the answer is "a lot", depending on if these tools are useful based on what you are doing. HTML5 Boilerplate doesn't necessarily overlap Rails in any way.
You can get a full list of features, coding style recommendations at the HTML5 Boilerplate Docs
You'll also probably be interested in HTML5 Boilerplate for Rails Developers

Display Flash Web Widget in a Delphi form

I would like to display the yahoo weather widget (or any similar flash or java based widget) in a Delphi application. I freely admit I don't quite understand what would be required to make this work.
Any suggestions on how this could be accomplished would be appreciated.
I'm using Delphi 7. All of the Widgets are just HTML Code, which when I cut & paste them to my Blogger page for instance, show up and work fine. I'm not sure how to take that same html code and use it in a Delphi form to get similar results.
Detailed instructions would be appreciated as well as an explanation. Clearly I don't quite understand how this works... I only know what outcome I'd like ;-)
Thanks Rob, it wasn't a memory issue, butt he admins did take care of it as you suggested.
Mark
Basically, you want to host the SWF ActiveXObject.
http://delphi.about.com/od/graphics/l/aa040103a.htm
As mentioned above you could host Flash's active X control for a flash control.
The other option is to use an embedded webpage (possibly loaded off the local disk) using the built in Delphi TWebBrowser control to show any web content including Java or Flash controls (as long as they are installed on the client).
Hope that helps.
I have a video on embedding flash into Delphi Applications Available Here. If the widget is a flash file (.swf) it should be fairly easy. The other option (as already mentioned) is to use the Delphi TWebBrowser component.

Is there a dojo or a Jquery just for Firefox add on development?

Started working on Firefox add ons, which is done with JavaScript and XUL, and I find myself sorely wanting to use Dojo or someother kind of JavaScript like library, but I can't find one that exists. So I was thinking of starting a library by porting Dojo over to a Firefox add on specific fork. Get rid off the cross browser stuff, use array comprehension and other nice stuff available in Firefox's JavaScript engine. I worry about whether or not there's enough of a userbase who'd take advantage of this, but more than that I guess I'm wondering if there's already something like this? Google finds nothing.
Mozilla Corp developed a JavaScript library for this purpose: FUEL.
it is developed by John Resig the creator of jQuery.
To know how to use jQuery inside FF extension look at this similar question
jQuery, at least, functions perfectly well when embedded in a Firefox addon. I can't quote you names, but I've heard that several popular addons are already using jQuery.
Here's an article discussing using jQuery within XUL and some of the hoops you may need to jump through.
It is fairly common to embed jQuery in firefox extensions.

Resources