~bendersteed/wikisophy-fe

dfc5a3a065158218783dd4f7e0fbcaf950fde2d8 — Dimakakos Dimos 3 years ago 69d6d0e
Add: some fine-tuning of tree representation
2 files changed, 10 insertions(+), 8 deletions(-)

M public/css/site.css
M src/wikisophy/core.cljs
M public/css/site.css => public/css/site.css +4 -0
@@ 37,3 37,7 @@ img {
    display: block;
    margin: auto;
}

#vis {
    margin-top: 2em;
}

M src/wikisophy/core.cljs => src/wikisophy/core.cljs +6 -8
@@ 60,32 60,30 @@
             :key "id",
             :parentKey "parent"}
            {:type "tree",
             :method {:signal "layout"},
             :size
             [{:signal "height"}
              {:signal "width - 100"}],
             :separation {:signal "separation"},
             :as ["y" "x" "depth" "children"]}]}
             :as ["x" "y" "depth" "children"]}]}
          {:name "links",
           :source "path",
           :transform
           [{:type "treelinks"}
            {:type "linkpath",
             :orient "horizontal",
             :shape {:signal "links"}}]}]
   :marks [{:type "path",
     :from {:data "links"},
     :encode
     {:update
      {:path {:field "path"},
       :stroke {:value "#ccc"}}}}
       :stroke {:value "#a9a9a9"}}}}
    {:type "symbol",
     :from {:data "path"},
     :encode
     {:enter
      {:size {:value 100},
       :stroke {:value "#fff"}
       :fill {:value "#000"}},
       :stroke {:value "#663399"}
       :strokewidth {:value 6}},
      :update
      {:x {:field "x"}
       :y {:field "y"}}}}


@@ 94,12 92,12 @@
     :encode
     {:enter
      {:text {:field "value"},
       :fontSize {:value 9},
       :fontSize {:value 12},
       :baseline {:value "middle"}},
      :update
      {:x {:field "x"},
       :y {:field "y"},
       :dx {:signal "datum.children ? -7 : 7"},
       :dx {:signal "datum.children ? -12 : 12"},
       :align
       {:signal
        "datum.children ? 'right' : 'left'"},