From 7aa0744aca24e9a73ac85035a551fdf89b030121 Mon Sep 17 00:00:00 2001 From: Vasek Sraier Date: Wed, 30 Sep 2020 22:52:57 +0200 Subject: [PATCH] =?UTF-8?q?graf:=20hrany=20vedouc=C3=AD=20z=20label=C5=AF?= =?UTF-8?q?=20jsou=20skryt=C3=A9=20-=20nody=20se=20tak=20p=C5=99i=20simula?= =?UTF-8?q?ci=20mohou=20dob=C5=99e=20um=C3=ADstit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Editor.svelte | 9 ++++++++- frontend/src/Graph.svelte | 3 ++- frontend/src/GraphEdge.svelte | 5 ++++- tasks.json | 13 +++++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/frontend/src/Editor.svelte b/frontend/src/Editor.svelte index 29a46ae..4973d10 100644 --- a/frontend/src/Editor.svelte +++ b/frontend/src/Editor.svelte @@ -16,6 +16,7 @@ let currentTask: TaskDescriptor | null = null; let nodeDraggingEnabled: boolean = false; let angle: number; + let showHiddenEdges: boolean = false; const { open } = getContext("simple-modal"); function clickTask(e: CustomEvent) { @@ -203,7 +204,8 @@ on:preSelectTask={startHovering} bind:this={graph} {nodeDraggingEnabled} - on:openTask={openTaskDetailEditorButton} /> + on:openTask={openTaskDetailEditorButton} + {showHiddenEdges} />
@@ -238,6 +240,11 @@ vrcholů
+
+ +
{#if clicked.length > 0 && getTask(clicked[clicked.length - 1]).type == "label"}
Úhel rotace: diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index be08632..df377db 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -13,6 +13,7 @@ export let tasks: TasksFile; export let repulsionForce: number = -1000; export let nodeDraggingEnabled: boolean = false; + export let showHiddenEdges: boolean = false; let hoveredTask: null | string = null; @@ -135,7 +136,7 @@ {#each edges as edge} - + {/each} {#each nodes as task} ; + export let showLabelEdge: boolean = false; $: x1 = edge?.source?.x ?? 0; $: y1 = edge?.source?.y ?? 0; @@ -12,4 +13,6 @@ $: dy = y1 - y2 - +{#if showLabelEdge || (edge?.target?.task?.type ?? null) != "label"} + +{/if} diff --git a/tasks.json b/tasks.json index 67712ab..093e24c 100644 --- a/tasks.json +++ b/tasks.json @@ -5,7 +5,8 @@ "type": "open-data", "comment": "Kevin a magnety - triviální, lineární průchod pole", "requires": [ - "jak-resit-ulohy" + "jak-resit-ulohy", + "label-1d-pole" ] }, { @@ -95,7 +96,8 @@ "type": "open-data", "comment": "Hra Othello - link na 26-Z1-2, procházení 2D pole po různých směrech", "requires": [ - "26-Z1-1" + "26-Z1-1", + "label-2d-pole" ] }, { @@ -117,7 +119,8 @@ "type": "open-data", "comment": "Kevinova želva — triviální, průchod po 2D souřadnicích", "requires": [ - "jak-resit-ulohy" + "jak-resit-ulohy", + "label-zelvy" ] }, { @@ -247,7 +250,9 @@ { "id": "start", "type": "text", - "requires": [], + "requires": [ + "label-uvod" + ], "comment": "úvodní kecy o tom, jak to celé funguje" } ],