You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently working through the save/restore functionality. The save part is complete. On restore, I've been working on it for a little while but I'm not quite sure how you intend restoreProvenanceGraph() and repopulating the graph to work. Do you have an example with the restore functionality?
Here is the relevant portions of my code:
document.getElementById("file-input").addEventListener("change", async (e) => {
var file = (<HTMLInputElement>e.target).files[0];
var reader = new FileReader();
reader.onload = file => {
var contents: any = file.target;
this.text = contents.result;
console.log(this.text.toString()); // debug - working up to here
var graphLoad:SerializedProvenanceGraph = JSON.parse(this.text);
graph = restoreProvenanceGraph(graphLoad);
};
reader.readAsText(file);
}, false);
This is I get when I try to assign the restored graph. Types have separate declarations of a private property '_current'.
It has a problem with the last assignment operation, graph is cast as ProvenanceGraph.
The text was updated successfully, but these errors were encountered:
There doesn't seem to be anything wrong with your code, I tried it here (https://codesandbox.io/s/qz3k0w34n6) and everything seems fine actually. I can not see the declaration of graph but I assume somewhere is let graph: ProvenanceGraph. Which version of typescript are you using? Are you using provenance-core from the npm package?
I've been out for a little while working on some other core components and lots of writing (I am using a modified core). I just came back to this issue and that segment of code is no longer giving me that error. Not sure why at the moment, but I don't look gift horses in the mouth :)
My fundamental question is: How should the graph from restoreProvenanceGraph intended to be handled to update the vis? The graph re-draw is not triggering.
Code sample:
let graph = new ProvenanceGraph({ name: 'Calculator', version: '1.0.0' });
<< code copied from my example above which modifies graph >>
let fileChange = new Calculator(graph, registry, tracker, traverser);
fileChange.setupBasicGraph().then(() => {
provenanceTreeVisualization = new ProvenanceTreeVisualization(
traverser,
visDiv,
);
//Slidedeck stuff
};
Hello again,
I'm currently working through the save/restore functionality. The save part is complete. On restore, I've been working on it for a little while but I'm not quite sure how you intend restoreProvenanceGraph() and repopulating the graph to work. Do you have an example with the restore functionality?
Here is the relevant portions of my code:
This is I get when I try to assign the restored graph.
Types have separate declarations of a private property '_current'.
It has a problem with the last assignment operation,
graph
is cast asProvenanceGraph
.The text was updated successfully, but these errors were encountered: