thejit

JIT - Saving Spacetree as an image

别来无恙 提交于 2019-12-06 10:13:14
问题 I'm using JavaScript InfoVis Toolkit (http://thejit.org/) and am trying to save the Spacetree that I output into an image. The Spacetree is outputted to a canvas. This problem is really frustrating me. I have tried: Opening the canvas in a new window Opening the div where the canvas is located in a new window Using Canvas2Image (http://www.nihilogic.dk/labs/canvas2image/) Here is my current Javascript method (tied to a button): function saveImage(div_id) { var canvas = document.getElementById

How to Create a JSON Tree from a Tabulated Hierarchy in Python

旧城冷巷雨未停 提交于 2019-12-04 16:03:33
问题 I'm sure there's an elegant way of doing this in Python (or at a push, Javascript), but for the life of me I can't see it... I have a CSV file of the form: ID, Name, Description A, A-name, A100, A100-name, A100-desc A110, A110-name, A110-desc A111, A111-name, A111-desc A112, A112-name, A112-desc A113, A113-name, A113-desc A120, A120-name, A120-desc A131, A131-name, A131-desc A200, A200-name, A200-desc B, B-name, B100, B100-name, B100-desc B130, B130-name, B130-desc B131, B131-name, B131-desc

Infovis JIT: add click listener to edge

风流意气都作罢 提交于 2019-12-04 02:00:16
问题 I'm trying to capture a click event on an edge of a sunburst graph. I've already captured click events on nodes. This is what I'm trying: //..sunburst example code Events: { enable: true, enableForEdges: true, type: 'Native', onClick: function(node, eventInfo, e){ if (!node) return; if(node.nodeFrom){ console.log("target is an edge"); }else{ console.log("target is a node"); } } But this only captures node clicks. What's wrong? Thank you in advance. 回答1: The problem is that 'contains' method,

How to Create a JSON Tree from a Tabulated Hierarchy in Python

丶灬走出姿态 提交于 2019-12-03 09:15:49
I'm sure there's an elegant way of doing this in Python (or at a push, Javascript), but for the life of me I can't see it... I have a CSV file of the form: ID, Name, Description A, A-name, A100, A100-name, A100-desc A110, A110-name, A110-desc A111, A111-name, A111-desc A112, A112-name, A112-desc A113, A113-name, A113-desc A120, A120-name, A120-desc A131, A131-name, A131-desc A200, A200-name, A200-desc B, B-name, B100, B100-name, B100-desc B130, B130-name, B130-desc B131, B131-name, B131-desc B140, B140-name, B140-desc and I want to generate a hierarchical JSON structure so I can visualise the