@@ -108,6 +115,17 @@ export default () => ({
`;
}
+ init() {
+ return `
+
+ `;
+ }
+
fail() {
return `
@@ -134,7 +152,7 @@ export default () => ({
const { Engine } = await import('./graph');
let engine = Engine.fromIndex(this.index);
- return engine.createInstance();
+ return engine.createInstance(url);
});
this.navigation.transition(() => {
diff --git a/src/scripts/graph.js b/src/scripts/graph.js
index a3c0ab1..1fd649e 100644
--- a/src/scripts/graph.js
+++ b/src/scripts/graph.js
@@ -48,7 +48,7 @@ export class Engine {
return new Engine(graph);
}
- createInstance() {
+ createInstance(url) {
let settings = { allowInvalidContainer: true };
let container = document.createElement('div');
@@ -59,6 +59,10 @@ export class Engine {
this.setupInteraction();
this.setupGraphStyle();
+ let camera = this.instance.getCamera();
+ router.emit('retrieve', { path: url });
+ camera.animate({ ratio: 1 }, { easing: "linear", duration: 200 });
+
return container;
}