Search Results

Search found 7 results on 1 pages for 'protovis'.

Page 1/1 | 1 

  • Accessing value attribute in Protovis lines

    - by Luce
    I'm using Protovis Arc layout and I'd like to color links between nodes accoriding to the 'value' property defined in dataset. How can I access it? Dataset is defined like that: Nodes: ... {nodeName:"Books"} ... Links: ... {source:1, target:4, value:20} ... arc.link.add(pv.Line).strokeStyle(function(d) d.value 10 ? "#cc0000" : "#eeeeee"); - does not work

    Read the article

  • Error "window" is not defined when loading Protovis from javax.script?

    - by Shane
    I am loading Protovis using javax.script: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName(scriptEngine); engine.eval(new java.io.FileReader("protovis-d3.1.js")); But I get the following exception: Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascr ipt.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown sourc e>#5033) in <Unknown source> at line number 5033 at com.sun.script.javascript.RhinoScriptEngine.eval(Unknown Source) at javax.script.AbstractScriptEngine.eval(Unknown Source) at RJScript.EvalScript(RJScript.java:20) at RJScript.main(RJScript.java:26) This same script runs from a browser. Do I need to do something so that the "window" is defined?

    Read the article

  • Loading a javascript library in javax.script?

    - by Shane
    I want to run Protovis javascript from Java and get the evaluated SVG code. I am using javax.script.* to run the Javascript: public static void EvalScript() throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); Object result = engine.eval("var vis = new pv.Panel().width(300).height(300) .add (pv.Line).data ([1,0.5, 0.1, 0.01, 0.001, 0.3, 0.2,0.1,1]) .left (function () { return this.index * 30; }) .bottom (function (d) { return d * 250; }); vis.root.render(); vis.scene[0].canvas.innerHTML;"); System.out.println(result); } This would complain because I never loaded Protovis itself, as would ordinarily be done with <script type="text/javascript" src="../protovis-r3.1.0.js"></script> Is there a good way, short of sourcing in the full Javascript into the eval() command, of loading a library when running Javascript through javax.script? (Incidentally, I know of examples that use Rhino to do this from the Google discussion group.)

    Read the article

  • Using javax.script to run javascript with browser settings (e.g. envjs)?

    - by Shane
    I am trying to run Protovis javascript from a Java program: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval(new java.io.FileReader("protovis-d3.1.js")); In order to run this, the JavaScript engine needs to have all the context of a web browser. The best option for this seems to be envjs. Unfortunately it seems that the version of Rhino included in the JVM isn't up to date and doesn't include everything that's necessary for envjs. Has anyone had any success working with a browser context from javax.script.

    Read the article

  • Using javax.script or Rhino to run javascript in Java with browser context (e.g. envjs)?

    - by Shane
    I am trying to run Protovis javascript from a Java program using javax.script: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval(new java.io.FileReader("protovis-d3.1.js")); In order to run this, the JavaScript engine needs to have all the context of a web browser. The best option for this seems to be envjs. Unfortunately it seems that the version of Rhino included in the JVM isn't up to date and doesn't include everything that's necessary for envjs. Has anyone had any success working with a browser context from javax.script, or am I missing something? This is related to this question: "Can I create a ‘window’ object for javascript running in the Java6 Rhino Script Engine".

    Read the article

  • Desktop Application Development with Javascript, Python / Ruby

    - by Chris
    Hello, Besides using Appcelerator's Titanium Desktop, are there other approaches to integrating Javascript and Ruby/Python into cross-platform desktop applications? Just trying to get a sense of the landscape here. From searching the web, it seems Titanium may be leading the charge in terms of this type of integration. I wasn't able to find references that suggest you can do something similar in Adobe AIR. I am interested in building desktop applications that exploit Protovis and possibly other Javascript interactive vis packages for the UI. At the end of the day, I can go the web app route if need be, but being able to develop desktop apps is helpful. Would appreciate your perspective on this... Chris

    Read the article

  • Libraries and pseudocode for physical Dashboard/Status board

    - by dani
    OK, so I bought a 46" screen for the office yesterday, and with the imminent risk of being accused for setting up an "elaborate World Cup procrastination scheme", I'd better show my colleagues what it's meant for ;) Looking at my simple sketch, and at these great projects from which I was inspired, I would like to get some input on the following: Pseudocode for the skeleton: As some methods should be called every 24 hours ("Today's date in the heading"), others at 60 second intervals ("Twitter results"), what would be a good approach using JavaScript (jQuery) and PHP? EDIT: Alsciende: I can agree that #1 and #8 are too vague. Therefore I remove #8 and try to clarify #1: With "Pseudocode for the skeleton", I basically mean could this be done entirely using JavaScript timers and how would you set up the various timers? Library for Google Analytics: Which libraries support the Google Analytics API and can produce neat charts. Preferably HTML5, JavaScript-based like Protovis. Library for Twitter: Which libraries would you recommend for fetching twitter search results and latest tweets from profiles. Libraries for Typography/CSS/HTML5: Trying to learn some HTML5 etc. in the process, please advice on any other typography/css libraries that could be of relevance. Scraping/Parsing? I'll give you a concrete example: Trying to fetch today's menu from this restaurant's website, how would you go about? (it's in Swedish - but you get the point - sorry ;) ) Real-time stats? I'm using the WassUp-plugin for WordPress to track real-time visitors on our website. Other logging software (AWStats etc.) is probably also installed on the webserver. Any ideas on how to extract information from these and present in real-time on the dashboard? Browser choice? Which Browser and OS would you pick? Stable, Full-screen, HTML5.

    Read the article

1