From 6ddeb10bdc15e24cb90948b51fc825c4b03558f2 Mon Sep 17 00:00:00 2001 From: Nekori Date: Fri, 30 Apr 2021 12:52:14 +0200 Subject: [PATCH] =?UTF-8?q?Graph:=20Ajout=20des=20cat=C3=A9gories=20Semest?= =?UTF-8?q?res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/export_yaml_to_html.py | 14 ++++---- html/graphTemplate.html | 12 +++++++ html/graphTemplate.js | 66 ++++++++++++++++++++++++------------- 3 files changed, 62 insertions(+), 30 deletions(-) diff --git a/html/export_yaml_to_html.py b/html/export_yaml_to_html.py index 104081e..b87cca7 100644 --- a/html/export_yaml_to_html.py +++ b/html/export_yaml_to_html.py @@ -207,7 +207,6 @@ def defineSearchTerm(dictio, url, documents): documents[document["code"]] = document return - # Créer un fichier contenant la liste des saes datas = {"data" : saes, "title": "SAEs"} # "data" contient un tableau des saes template_List.stream(datas).dump(REPERTOIRE_HTML + "/SAE.html") @@ -248,14 +247,13 @@ for indexSem, sem in enumerate(ressources): defineSearchTerm(data, url, documents) template.stream(datas).dump(REPERTOIRE_HTML + "/" + url) - relations["nodes"].append({"id": data["code"], "type": "Ressource"}) + relations["nodes"].append({"id": data["code"], "sem": sem, "type": "Ressource"}) for sae in data["sae"]: - if not any(sae in node["id"] for node in relations["nodes"]): relations["nodes"].append({"id": sae, "type": "SAE"}) - relations["links"].append({"source": data["code"], "target": sae, "type": "RessourceToSAE"}) + relations["links"].append({"source": data["code"], "target": sae, "sem": sem, "type": "RessourceToSAE"}) for rt in data["acs"]: for ac in data["acs"][rt]: - if not any(ac in node["id"] for node in relations["nodes"]): relations["nodes"].append({"id": ac, "type": "AC"}) - relations["links"].append({"source": data["code"], "target": ac, "type": "RessourceToAC"}) + if not any(ac in node["id"] for node in relations["nodes"]): relations["nodes"].append({"id": ac, "sem": 0, "type": "AC"}) + relations["links"].append({"source": data["code"], "target": ac, "sem": sem, "type": "RessourceToAC"}) #Créer un fichier contenant la liste des ressources du semestre data = {"data" : ressources[sem],"sem" : sem} # "data" contient un tableau des ressources du semestre @@ -289,8 +287,8 @@ for indexSem, sem in enumerate(ressources): relations["nodes"].append({"id": data["code"], "type": "SAE"}) for rt in data["acs"]: for ac in data["acs"][rt]: - if not any(ac in node["id"] for node in relations["nodes"]): relations["nodes"].append({"id": ac, "type": "AC"}) - relations["links"].append({"source": data["code"], "target": ac, "type": "SAEToAC"}) + if not any(ac in node["id"] for node in relations["nodes"]): relations["nodes"].append({"id": ac, "sem": 0, "type": "AC"}) + relations["links"].append({"source": data["code"], "target": ac, "sem": sem, "type": "SAEToAC"}) for sae in exemples[sem]: i = 1 # Nommage des fichiers exemple sae peut être modifier diff --git a/html/graphTemplate.html b/html/graphTemplate.html index bd3852f..b1b6ccc 100644 --- a/html/graphTemplate.html +++ b/html/graphTemplate.html @@ -4,6 +4,18 @@ {% endblock %} {% block content %} +
+
+ + +
+