diff --git a/Algorithms/KDTree/KDTree.hs b/Algorithms/KDTree/KDTree.hs index 3494715..5b2a866 100644 --- a/Algorithms/KDTree/KDTree.hs +++ b/Algorithms/KDTree/KDTree.hs @@ -138,6 +138,7 @@ rangeSearch kd' sq' = (goPt kd' sq', goTree kd' sq' True) (goTree rn sq False)] where treeText + -- HACK: in order to give specific nodes a specific color | vis && inRange sq pt = "** " ++ (show . unp2 $ pt) | vis = "* " ++ (show . unp2 $ pt) | otherwise = show . unp2 $ pt diff --git a/Algorithms/QuadTree/QuadTree.hs b/Algorithms/QuadTree/QuadTree.hs index 68481e7..1aaf157 100644 --- a/Algorithms/QuadTree/QuadTree.hs +++ b/Algorithms/QuadTree/QuadTree.hs @@ -214,6 +214,7 @@ quadTreeToRoseTree z' = go (rootNode z') , go (fromJust . goSE $ z)] where markAndPrintOrigin + -- HACK: in order to give specific nodes a specific color | z' == z = "* " ++ printOrigin | otherwise = printOrigin printOrigin diff --git a/Graphics/Diagram/Plotter.hs b/Graphics/Diagram/Plotter.hs index 5f49006..67c58f8 100644 --- a/Graphics/Diagram/Plotter.hs +++ b/Graphics/Diagram/Plotter.hs @@ -222,6 +222,7 @@ kdTreeDiag = Diag f where f _ (Object []) = mempty f p (Object vt) = + -- HACK: in order to give specific nodes a specific color renderTree (\n -> case n of '*':'*':_ -> (text n # fontSizeL 5.0) <> rect 50.0 20.0 # fc green @@ -300,6 +301,7 @@ treePretty = Diag f Left x -> getCurQT qs (fromMaybe z (goQuad x z)) prettyRoseTree :: Tree String -> Diagram Cairo R2 prettyRoseTree tree = + -- HACK: in order to give specific nodes a specific color renderTree (\n -> case head n of '*' -> (text n # fontSizeL 5.0) <> rect 50.0 20.0 # fc red