Skip to content

Commit 34e6b1c

Browse files
author
Jonathan Harper
committed
update for (simple) handling of circular references.
1 parent ce66cb8 commit 34e6b1c

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by .gitignore support plugin (hsz.mobi)

js/injected.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var VisDeconstruct = require('d3-decon-lib');
22
var $ = require('jquery');
3+
var CircularJSON = require('circular-json');
34

45
var contextElem;
56
document.addEventListener("contextmenu", function(event) {
@@ -93,6 +94,8 @@ function pageDeconstruct() {
9394
deconData.push(deconDataItem);
9495
});
9596

97+
deconData = JSON.parse(CircularJSON.stringify(deconData));
98+
9699
var evt = document.createEvent("CustomEvent");
97100
evt.initCustomEvent("deconDataEvent", true, true, deconData);
98101
document.dispatchEvent(evt);

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"bootstrap": "^3.2.0",
3232
"browserify": "^5.11.2",
3333
"browserify-shim": "^3.7.0",
34+
"circular-json": "^0.1.6",
3435
"d3": "^3.4.11",
3536
"d3-decon-lib": "git://github.com/harperj/d3-decon-lib",
3637
"filesaver.js": "^0.1.0",

0 commit comments

Comments
 (0)