Hierarchical layout with vis.js - javascript

I'm using vis.js library to graphically display a network. I read the documentation and I need to use the hierarchical layout. It works fine until I use the sortMethod='directed' option. In this case I end up with a blank page. There's no Javascript error. Every other options combination works fine, but I need the directed option. I followed the documentation and it doesn't seem that I need to add further information to the network: it should all work with the 'from' and 'to' edges properties. What could it be?
Thank you all.

It seems to be a bug. I have been using this feature for months and suddenly it stopped working. I get the same behaviour as the one you describe. All options seem to work except the sortMethod='directed'. I cannot tell for sure which version introduced this bug but I found it out at 4.12.0.
We probably need to raise an issue to let their dev team know about it.
Hope that helps. It is not exactly a solution to your issue but rather a verification of this bug since I have the same issue.
EDIT:
I tried both 4.11.0 and 4.10.0
4.11.0 : I get the same buggy behaviour.
4.10.0 : Works as expected. No issues.

Related

Highcharts not rendering in IE 11

I am using Highcharts JS v2.2.5. It works fine in all browser except IE 11. I am able see the data but, Chart is not rendering.
Do you have already excluded for wrong position or zero-height container? it's a common bug..
We need to know more details, can you post some code?
Have you any error evidence in browser console?
If you are using prototype.js version 1.5.1.1 then there is a possibility of getting error in console[on hover function] only in IE[All versions]. If this is the issue then it can be solved by using higher version of prototype.js

How to take a screenshot of a web page by using Javascript

I need to capture the currently active web page as a screenshot. I've already tried html2canvas & GrabzIt but the problem is that I need a precise screenshot of the page I am on currently. The reason why I don't want to use html2canvas is because it does not always return a good version of a screenshot (not rendering properly) and I don't want to use GrabzIt because it's not free.
Do any of you have an idea how to accomplish this either by using javascript/java/flash?
Any option will do as long as it works...
P.S. I'm currently capturing screenshots with my addon for Firefox by using the function that firefox offers : context.drawWindow and now i want to make it available online.
Thanks a lot!
Currently possible alternatives:
rasterizeHTML.js:
this tool looks to be capable to capture a while page containing sophisticated html-structure and an image as well in this demo:
http://cburgmer.github.io/rasterizeHTML.js/
Lively 3D:
On the tool's website you can find a demo as well and it is still supported and developed.
http://livelygoes3d.blogspot.co.at/2011/11/rendering-html-on-canvas.html
HTML2Canvas:
Or after all HTML2Canvas because it does not look like that it is put on hold, quite the opposite there is a new release-version of it. And since I used it it might be handle rendering images onto a canvas better.
https://html2canvas.hertzen.com
Old-Answer:
I used this package in one of my projects and it worked pretty well. The only complain I have to make on this package is that images are not rendered that well in the final screenshot. But may be it's improved since then.
In the end, I ended up using server side generation of screenshots with phantomjs. Found it the most reliable in my scenario and it takes pretty decent screenshots.

Set cursor to end of textarea- setSelectionRange() broken on Firefox?

My initial question is a direct dupe of this question, trying to put the cursor at the end of a textarea.
one
two
three|<-- ideal position
It worked fine on all browsers except Firefox (I'm currently using version 18.0). Even the jsfiddle that Tim provided in the link above (for convenience: http://jsfiddle.net/DqtVK/40/) is not working.
It seems it's not highlighting or placing the cursor at all anymore.
I understand jquery is an alternative option (as found here) but did something happen on firefox's side that makes this method no longer reliable? Anyone have any insight? Is there a way to avoid the jquery route?
Thanks!
Looks like there was an uncaught exception that was preventing my piece of code from finishing. It seems firefox really doesn't like focusing on a hidden piece of HTML. Lesson learned, make sure your target is visible!
Though why the jsfiddle is not working properly is still a mystery to me...
but my base issue has been solved.
If anyone can explain the jsfiddle mystery, please keep respondin' I'll be on the lookout.

JQgrid not sizing properly in IE8

For some reason I cannot seem to get IE8 to display my jqgrid right as you can see below. This isn't the only grid that doesn't display properly. I have another one in my project that renders just like the one below :(. Needless to say, I tried all sort of column widths, tried turning the scrollbars off etc etc. but nothing seems to improve the situation.
Am I missing something obvious ?
I am using the very latest JQgrid version 3.8.
Firefox:
Explorer:
Mostly the problem exist in CSS which you use (for example standard CSS generated by ASP.MVC MVC). Different web browsers interpret CSS inheritance differently. Look at this answer and this. Probably the usage of increased cellLayout parameter or the function fixGridWidth inside of loadComplete could solve your problem.

magento bundle.js error

I just discovered on my site using magento 1.3.2.2 that on a bundled product, when adding different options the price does not change in internet explorer. It works fine in all other browsers however.
In internet explorer I get the error message.
Message: Object doesn't support this property or method
Line: 34
Char: 9
Code: 0
URI: /skin/frontend/my_new_interface/design2/js/bundle.js
So I checked out line 34 and found
parts = selection.id.split('-');
I verified that selection.id is a string. I'm not a javascript expert and I'm not familiar with prototype.
On a lark I decided to split up the line as:
var parts = selection.id;
parts = part.split('-');
Well that fixed the problem. Furthermore I went back and just reduced to:
var parts = selection.id.split('-');
Which still worked as well. I don't think this is a file I should be messing with though. I'm assuming this javascript class should work fine in ie without me having to change anything.
I'm hoping someone has an idea of why this might have fixed the problem or what I can do to find out what the real problem is. Do you see any problem with me leaving this fix the way it is?
It's very possible that you hit an ID in the other case that didn't exist, and therefore it was attempting to split an undefined variable. If the fix works for you, stick with it, but you may want to consider upgrading your Magento installation. The series is onto 1.4 now, and there are huge numbers of fixes in every release.
Hope that helps!
Thanks,
Joe

Categories