PDA

View Full Version : Using javascript with vizard


Ritesh Agrawal
03-22-2013, 11:24 AM
Hello friends,
I have some data visualization models in JavaScript like Scatter Plot, Parallel Coordinates , bar graph etc . Somehow I want to combine them with A.R and V.R , so after searching on net I found that vizard will be best solution to implement A.R and V.R . But I have no clue whether it is possible or not ? Is there any way through which I can directly include my JavaScript code in python / vizard ? Or any way through which I can make those models in vizard ?
My aim is to combine Data Visualization with A.R and V.R. I am basically looking for user interactive model.

Thanks

farshizzo
03-22-2013, 04:12 PM
It's not clear how exactly you want to integrate these javascript visualizations with Vizard. However, Vizard comes with a vizhtml module that allows you to display an embedded html page within the graphics window. This basically allows you to execute javascript code and overlay the results.

Also, you might want to have a look at the 3rd party matplotlib (http://kb.worldviz.com/articles/483) Python library. This provides a high level interface for generating data plots.

Ritesh Agrawal
03-25-2013, 02:26 AM
I want to embed my javascript based visualization model into a screen in virtual world. However vizhtml is not working with javascript. Nothing is displayed if I use vizhtml module to load website. For example if I try to open website www.d3js.org and when I go to examples page (containing Javascript based models) then nothing is displayed on the screen.
Is it possible to execeute that Javascript in window? Actually I want to implement similar model which is given in d3js.org (http://mbostock.github.com/d3/talk/20111116/iris-parallel.html). Please provide the suitable solution.

Thanks

farshizzo
03-29-2013, 11:58 AM
The embedded browser is based on the Windows native web browser control. It appears that the browser defaults to IE7 mode, and the web page you are trying to view is not compatible with IE7.

However, you can specify which version of IE to use for the embedded browser through a registry setting. The following sample code will force the embedded browser to use IE9 and then opens the sample page you previously mentioned.import viz
viz.go()

import _winreg
reg = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULA TION',0,_winreg.KEY_ALL_ACCESS)
_winreg.SetValueEx(reg,'VizHTMLViewer.exe',0,_winr eg.REG_DWORD,9999)

viz.window.displayHTML('http://mbostock.github.com/d3/talk/20111116/iris-parallel.html')The chart appears to render properly within the browser now.

Ritesh Agrawal
04-03-2013, 01:00 AM
Thanks a lot. It is working fine now. Actually I want to embed my model on the wall but it is always coming in front of the user.So is there any way so that browser can embed on any of the wall or object like screen? Please provide the suitable solution.


Thanks

Jeff
03-03-2016, 06:51 PM
Just an update here, if you want to force Vizard to use IE11 as the embedded browser to display html and javascript, use the following code:

import _winreg
reg = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULA TION',0,_winreg.KEY_ALL_ACCESS)
_winreg.SetValueEx(reg,'VizHTMLViewer.exe',0,_winr eg.REG_DWORD,11001)

meta
09-01-2016, 02:37 AM
Hi, any change to use chrome & v8 engine for html?