Fix les graphes #69

Closed
opened 8 months ago by pierre.ferreira · 2 comments

Tache du sprint 3 en rapport avec le graphe :
Toutes ces tâches devrait ce compléter en même temps.

  • Les graphes doivents forcément être connexe.
  • Le graphe ne dois pas changer quand on recharge la page.
  • Faire en sorte que les joueurs ont la même disposition pour le graphe.
Tache du sprint 3 en rapport avec le graphe : *Toutes ces tâches devrait ce compléter en même temps.* - [x] Les graphes doivents forcément être connexe. - [x] Le graphe ne dois pas changer quand on recharge la page. - [x] Faire en sorte que les joueurs ont la même disposition pour le graphe.
pierre.ferreira added the Programming Fixing code labels 8 months ago
pierre.ferreira added this to the Kanban project 8 months ago
Poster
Owner
creuser au niveau de https://visjs.github.io/vis-network/docs/network/layout.html#
Poster
Owner

code trouvé pour réinitialisé :

// Capturer l'état actuel du graphe
const nodes = network.getNodes();
const edges = network.getEdges();
const graphState = { nodes, edges };

// Sauvegarder l'état dans localStorage
localStorage.setItem('graphState', JSON.stringify(graphState));

// Réinitialiser le graphe
const savedGraphState = JSON.parse(localStorage.getItem('graphState'));
network.setData(savedGraphState);

const savedGraphStateString = localStorage.getItem('graphState');
if (savedGraphStateString !== null) {
const savedGraphState = JSON.parse(savedGraphStateString);
network.setData(savedGraphState);
} else {
// La clé 'graphState' n'existe pas dans le localStorage, prenez une action en conséquence.
}

code trouvé pour réinitialisé : // Capturer l'état actuel du graphe const nodes = network.getNodes(); const edges = network.getEdges(); const graphState = { nodes, edges }; // Sauvegarder l'état dans localStorage localStorage.setItem('graphState', JSON.stringify(graphState)); // Réinitialiser le graphe const savedGraphState = JSON.parse(localStorage.getItem('graphState')); network.setData(savedGraphState); const savedGraphStateString = localStorage.getItem('graphState'); if (savedGraphStateString !== null) { const savedGraphState = JSON.parse(savedGraphStateString); network.setData(savedGraphState); } else { // La clé 'graphState' n'existe pas dans le localStorage, prenez une action en conséquence. }
baptiste.marcel was assigned by pierre.ferreira 8 months ago
pierre.ferreira modified the project from Kanban to Sprint 4 8 months ago
pierre.ferreira added the From Previous Sprint label 8 months ago
pierre.ferreira closed this issue 7 months ago
Sign in to join this conversation.
Loading…
There is no content yet.