Skip to content

Commit ba6f7ce

Browse files
committed
Merge pull request #369 from MDCox/v0.2.1
Final 0.2.1 documentation tweaks
2 parents 31e0a81 + f318df2 commit ba6f7ce

3 files changed

Lines changed: 12 additions & 36 deletions

File tree

site/app/docs/_configDocs/Edges.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ title: Edges
77

88
<p></p>
99

10+
By default, edges do not require an ID, only a source and target. If, however, there are multiple edges that share the same source and target, a unique ID will be required.
11+
1012
##### edgeCaption
1113

1214
[`string`] default:`'caption'`

site/app/docs/_documentation/GraphJSON.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GraphJSON is a JSON object that contains two objects, **nodes** and **edges**:
2121
The **nodes** and **edges** objects are arrays of the individual nodes and edges that will be represented in the Graph visualization.
2222

2323
## Nodes and Edges
24-
The only requirement for node objects is that they receive an **id** key that is unique (in the scope of the GraphJSON). The only requirement for edge objects is that they receive a **source** and **target** key that correspond to the source and target nodes.
24+
The only requirement for node objects is that they receive an **id** key that is unique (in the scope of the GraphJSON). The only requirement for edge objects is that they receive a **source** and **target** key that correspond to the source and target nodes. If there are multiple edges with identical source and targets, those edges MUST have a unique id.
2525

2626
## Features
2727
Alchemy.js has a number of features that rely on the underlying data. Most of the below features are supported by the example GraphJSON that follows.

site/app/docs/js/coffee/docs.coffee

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,49 +32,23 @@ $ ->
3232
activeItem = window.location.hash || "#Start"
3333
targetItem = "a[href='#{activeItem}']"
3434
activate(targetItem, false)
35-
35+
3636
$(".section-bar a")
3737
.on 'click', () ->
3838
activate(@, true)
3939

40-
scrollActivate = (tocEl) ->
41-
padding = 50 - 15
42-
offset = $("#sidebar").offset().top - padding
43-
if $(tocEl).hasClass("active")
44-
$("#pointer").removeClass("hidden")
45-
$(tocEl)
46-
.parents(".level-3, .level-2, .level-1, .section-bar")
47-
.removeClass("hidden")
48-
.addClass("active")
49-
$(tocEl)
50-
.siblings("a.level-1, a.level-2, a.level-3")
51-
.removeClass("active")
52-
53-
else if !$(tocEl).hasClass("active")
54-
$("#pointer").addClass("hidden")
55-
$(tocEl)
56-
.parents(".level-3, .level-2, .level-1, .section-bar")
57-
.removeClass("active")
58-
$(tocEl)
59-
.siblings("a.level-1, a.level-2, a.level-3")
60-
.removeClass("active")
61-
62-
pos = $(tocEl).offset().top - offset
63-
$("#sidebar-wrapper").scrollTop(pos)
64-
6540
activate = (tocEl, click) ->
66-
# event.preventDefault()
67-
# net additional padding from sidebar wrapper and <a> elements
6841
if $(tocEl).length
6942
padding = 50 - 15
7043
offset = $("#sidebar").offset().top - padding
7144

72-
$("#sidebar").find('.active').removeClass("active")
73-
# $(tocEl).parents(".section-bar").find(".level-2").removeClass("hidden")
74-
7545
if $(tocEl).hasClass("level-1")
46+
if $(tocEl).hasClass("active")
47+
# Stop href link.
48+
event.preventDefault()
49+
50+
$(tocEl).toggleClass("active")
7651
if click
77-
$(tocEl).toggleClass("active")
7852
$(tocEl).parent().children(".level-2")
7953
.toggleClass("hidden", () ->
8054
if $(tocEl).hasClass(".active")
@@ -83,8 +57,8 @@ $ ->
8357
true
8458
)
8559
$(tocEl).parent().find("div.level-3").addClass("hidden")
86-
else $(tocEl).addClass("active")
87-
60+
else
61+
$(tocEl).addClass("active")
8862

8963
else if $(tocEl).hasClass("level-2")
9064
if $(tocEl).next().hasClass("level-3")
@@ -129,4 +103,4 @@ $ ->
129103
.removeClass("active")
130104

131105
pos = $(tocEl).offset().top - offset
132-
$("#sidebar-wrapper").scrollTop(pos)
106+
$("#sidebar-wrapper").scrollTop(pos)

0 commit comments

Comments
 (0)