Skip to content

Commit a9bbd4a

Browse files
author
huston
committed
Merge branch 'release-0.2.1'
Conflicts: site/app/docs/js/coffee/docs.coffee site/app/views/nav.html
2 parents 6af0b1e + ba6f7ce commit a9bbd4a

25 files changed

Lines changed: 190 additions & 191 deletions

BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bower install
6666
6767
# Install Jekyll and its depedencies
6868
gem install jekyll
69-
gem install codearray
69+
gem install coderay
7070
gem install kramdown
7171
7272
# Run the documentation locally

Gruntfile.coffee

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ module.exports = (grunt) ->
99
require("load-grunt-tasks") grunt
1010
require("time-grunt") grunt
1111
pkg = grunt.file.readJSON('./package.json')
12-
12+
1313
if grunt.file.isFile('./s3.yml')
1414
s3Config = grunt.file.readYAML('./s3.yml')
1515
key_id = s3Config.AWS_ACCESS_KEY_ID
1616
secret = s3Config.AWS_SECRET_ACCESS_KEY
1717
else
1818
key_id = ''
1919
secret = ''
20-
21-
grunt.initConfig
20+
21+
grunt.initConfig
2222
# Project settings
2323
yeoman:
24-
24+
2525
# Configurable paths
2626
app: "app"
2727
dist: "dist"
@@ -93,13 +93,13 @@ module.exports = (grunt) ->
9393
livereload: "<%= connect.options.livereload %>"
9494

9595
files: ["<%= yeoman.app %>/{,*/}*.html", ".tmp/styles/{,*/}*.css", ".tmp/scripts/{,*/}*.js", "<%= yeoman.app %>/images/{,*/}*.{gif,jpeg,jpg,png,svg,webp}"]
96-
96+
9797
# The actual grunt server settings
9898
connect:
9999
options:
100100
port: 9000
101101
livereload: 35729
102-
102+
103103
# Change this to '0.0.0.0' to access the server from outside
104104
hostname: "localhost"
105105

@@ -119,7 +119,7 @@ module.exports = (grunt) ->
119119
base: "<%= yeoman.dist %>"
120120
livereload: false
121121

122-
122+
123123
# Empties folders to start fresh
124124
clean:
125125
dist:
@@ -130,7 +130,7 @@ module.exports = (grunt) ->
130130

131131
server: ".tmp"
132132

133-
133+
134134
# Make sure code styles are up to par and there are no obvious mistakes
135135
jshint:
136136
options:
@@ -139,15 +139,15 @@ module.exports = (grunt) ->
139139

140140
all: ["Gruntfile.coffee", "<%= yeoman.app %>/scripts/{,*/}*.js", "!<%= yeoman.app %>/scripts/vendor/*", "test/spec/{,*/}*.js"]
141141

142-
142+
143143
# Mocha testing framework configuration options
144144
mocha:
145145
all:
146146
options:
147147
run: true
148148
urls: ["http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html"]
149149

150-
150+
151151
# Compiles CoffeeScript to JavaScript
152152
coffee:
153153
dist:
@@ -179,7 +179,7 @@ module.exports = (grunt) ->
179179
ext: ".js"
180180
]
181181

182-
182+
183183
# Compiles Sass to CSS and generates necessary files if requested
184184
compass:
185185
options:
@@ -204,7 +204,7 @@ module.exports = (grunt) ->
204204
options:
205205
debugInfo: true
206206

207-
207+
208208
# Add vendor prefixed styles
209209
autoprefixer:
210210
options:
@@ -218,21 +218,21 @@ module.exports = (grunt) ->
218218
dest: ".tmp/styles/"
219219
]
220220

221-
221+
222222
# Automatically inject Bower components into the HTML file
223223
"bower-install":
224224
app:
225225
html: "<%= yeoman.app %>/index.html"
226226
ignorePath: "<%= yeoman.app %>/"
227227

228-
228+
229229
# Renames files for browser caching purposes
230230
rev:
231231
dist:
232232
files:
233233
src: ["<%= yeoman.dist %>/scripts/{,*/}*.js", "<%= yeoman.dist %>/styles/{,*/}*.css", "<%= yeoman.dist %>/images/{,*/}*.{gif,jpeg,jpg,png,webp}", "<%= yeoman.dist %>/styles/fonts/{,*/}*.*"]
234234

235-
235+
236236
# Reads HTML for usemin blocks to enable smart builds that automatically
237237
# concat, minify and revision files. Creates configurations in memory so
238238
# additional tasks can operate on them
@@ -242,7 +242,7 @@ module.exports = (grunt) ->
242242

243243
html: "<%= yeoman.app %>/index.html"
244244

245-
245+
246246
# Performs rewrites based on rev and the useminPrepare configuration
247247
usemin:
248248
options:
@@ -251,7 +251,7 @@ module.exports = (grunt) ->
251251
html: ["<%= yeoman.dist %>/{,*/}*.html"]
252252
css: ["<%= yeoman.dist %>/styles/{,*/}*.css"]
253253

254-
254+
255255
# The following *-min tasks produce minified files in the dist folder
256256
imagemin:
257257
dist:
@@ -299,7 +299,7 @@ module.exports = (grunt) ->
299299
'<%= yeoman.dist %>/alchemy.min.css': '.tmp/concat/styles/alchemy.min.css'
300300
'<%= yeoman.dist %>/styles/vendor.css': '.tmp/concat/styles/vendor.css'
301301
]
302-
302+
303303
uglify:
304304
dist:
305305
files: [
@@ -312,7 +312,7 @@ module.exports = (grunt) ->
312312
src: '.tmp/concat/scripts/vendor.js'
313313
}
314314
]
315-
buildAlchemy:
315+
buildAlchemy:
316316
files: [
317317
{
318318
dest: '<%= yeoman.dist %>/alchemy.min.js'
@@ -339,14 +339,17 @@ module.exports = (grunt) ->
339339
dest: '<%= yeoman.dist %>/styles/alchemy.css'
340340
src: '.tmp/styles/alchemy.css'
341341
}
342+
{
343+
dest: '<%= yeoman.dist %>/styles/alchemy-white.css'
344+
src: '.tmp/styles/alchemy-white.css'
345+
}
342346
]
343-
s3:
347+
s3:
344348
files: [
345349
dest: '.tmp/s3/alchemy.min.js'
346350
src: ['<%= yeoman.dist %>/scripts/vendor.js'
347351
'<%= yeoman.dist %>/alchemy.min.js']
348-
, # I think this comma format is elegant - if anyone hates it
349-
# feel free to comment
352+
,
350353
dest: '.tmp/s3/alchemy.js'
351354
src: ['<%= yeoman.dist %>/scripts/vendor.js'
352355
'<%= yeoman.dist %>/alchemy.js']
@@ -385,6 +388,10 @@ module.exports = (grunt) ->
385388
dest: '<%= yeoman.dist %>/alchemy.css'
386389
src: '.tmp/styles/alchemy.css'
387390
}
391+
{
392+
dest: '<%= yeoman.dist %>/alchemy-white.css'
393+
src: '.tmp/styles/alchemy-white.css'
394+
}
388395
]
389396

390397
# Copies remaining files to places other tasks can use
@@ -480,15 +487,15 @@ module.exports = (grunt) ->
480487
else
481488
grunt.task.run ["connect:test", "mocha"]
482489

483-
grunt.registerTask 'build', ["clean:dist", "useminPrepare",
490+
grunt.registerTask 'build', ["clean:dist", "useminPrepare",
484491
"copy:coffee", "concurrent:buildAlchemy",
485492
"copy:fonts", "copy:images",
486-
"autoprefixer", "concat:buildAlchemy",
487-
"concat:generated", "cssmin:buildAlchemy",
493+
"autoprefixer", "concat:buildAlchemy",
494+
"concat:generated", "cssmin:buildAlchemy",
488495
"uglify:buildAlchemy"]
489-
496+
490497
releaseFlag = grunt.option('release')
491-
498+
492499
grunt.registerTask "default",
493500
if releaseFlag
494501
["test",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Alchemy.js was built so that developers could easily get up and running with Gra
1010
Additionally, because Alchemy.js is built with d3, the core application can easily be extended with any of the other features included in d3.
1111

1212
##Quick Start and Documentation
13-
Learn how to get up and running with Alchemy.js in the [docs](http://graphalchemist.github.io/Alchemy/documentation/) and check our examples in our [examples gallery](http://graphalchemist.github.io/Alchemy/#/examples).
13+
Learn how to get up and running with Alchemy.js in the [docs](http://graphalchemist.github.io/Alchemy/docs/) and check our examples in our [examples gallery](http://graphalchemist.github.io/Alchemy/#/examples).
1414
##Contributing
15-
Read about how to contribute in the [docs](http://graphalchemist.github.io/Alchemy/documentation/Contributing/).
15+
Read about how to contribute in the [docs](http://graphalchemist.github.io/Alchemy/docs/#Contributing).
1616

1717
##Licensing
1818
The source is licensed under the AGPLv3 license for open source and open data projects. For commercial licensing, get in touch with the [GraphAlchemist](mailto:team@graphalchemist.com) team.

app/scripts/alchemy/clustering/clustering.coffee

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class alchemy.clustering
6363
alchemy.clusterControls =
6464
init: ()->
6565
changeClusterHTML = """
66-
<h4>Cluster By:</h4>
67-
<input class='form-control' id='cluster-key' placeholder="Cluster Key"></input>
66+
<input class='form-control form-inline' id='cluster-key' placeholder="Cluster Key"></input>
6867
"""
6968
d3.select("#clustering-container")
7069
.append("div")
7170
.attr("id", "cluster-key-container")
71+
.attr('class', 'property form-inline form-group')
7272
.html(changeClusterHTML)
7373
.style("display", "none")
7474

@@ -78,7 +78,13 @@ alchemy.clusterControls =
7878
display = element.style("display")
7979

8080
element.style("display", (e)->
81-
if display == "block" then "none" else "block"))
81+
if display == "block" then "none" else "block")
82+
83+
if d3.select("#cluster-key-container").style("display") == "none"
84+
d3.select("#cluster-arrow").attr("class", "fa fa-2x fa-caret-right")
85+
else d3.select("#cluster-arrow").attr("class", "fa fa-2x fa-caret-down")
86+
87+
)
8288

8389
d3.select("#cluster-key")
8490
.on "keydown", ->

app/scripts/alchemy/core/controls.coffee

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
alchemy.controlDash =
18-
init: () ->
19-
if alchemy.conf.showControlDash is true
18+
init: ->
19+
if @dashIsShown()
2020
divSelector = alchemy.conf.divSelector
2121
# add dashboard wrapper
2222
d3.select("#{divSelector}")
@@ -44,7 +44,7 @@ alchemy.controlDash =
4444
alchemy.controlDash.stats()
4545
alchemy.controlDash.clustering()
4646

47-
search: () ->
47+
search: ->
4848
if alchemy.conf.search
4949
d3.select("#control-dash")
5050
.append("div")
@@ -57,7 +57,7 @@ alchemy.controlDash =
5757
""")
5858
alchemy.search.init()
5959

60-
zoomCtrl: () ->
60+
zoomCtrl: ->
6161
if alchemy.conf.zoomControls
6262
d3.select("#control-dash-wrapper")
6363
.append("div")
@@ -67,19 +67,19 @@ alchemy.controlDash =
6767
<button id='zoom-in' class='btn btn-defualt btn-primary'><i class='fa fa-plus'></i></button>
6868
<button id='zoom-out' class='btn btn-default btn-primary'><i class='fa fa-minus'></i></button>")
6969

70-
d3.select('#zoom-in').on("click", () -> alchemy.interactions.clickZoom 'in' )
71-
d3.select('#zoom-out').on("click", () -> alchemy.interactions.clickZoom 'out' )
72-
d3.select('#zoom-reset').on("click", () -> alchemy.interactions.clickZoom 'reset')
70+
d3.select('#zoom-in').on("click", -> alchemy.interactions.clickZoom 'in' )
71+
d3.select('#zoom-out').on("click", -> alchemy.interactions.clickZoom 'out' )
72+
d3.select('#zoom-reset').on("click", -> alchemy.interactions.clickZoom 'reset')
7373

74-
filters: () ->
75-
if alchemy.conf.showFilters
74+
filters: ->
75+
if alchemy.conf.nodeFilters or alchemy.conf.edgeFilters
7676
d3.select("#control-dash")
7777
.append("div")
7878
.attr("id", "filters")
7979
alchemy.filters.init()
8080

81-
stats: () ->
82-
if alchemy.conf.showStats
81+
stats: ->
82+
if alchemy.conf.nodeStats or alchemy.conf.edgeStats
8383
stats_html = """
8484
<div id = "stats-header" data-toggle="collapse" data-target="#stats #all-stats">
8585
<h3>
@@ -106,15 +106,13 @@ alchemy.controlDash =
106106

107107
alchemy.stats.init()
108108

109-
clustering: () ->
109+
clustering: ->
110110
if alchemy.conf.clusterControl
111111
clusterControl_html = """
112-
<div id = "clustering-container">
113-
<div id = "cluster_control_header" data-toggle="collapse" data-target="#clustering #cluster-options">
114-
<h3>
115-
Clustering
116-
</h3>
117-
<span class = "fa fa-2x fa-caret-right"></span>
112+
<div id="clustering-container">
113+
<div id="cluster_control_header" data-toggle="collapse" data-target="#clustering #cluster-options">
114+
<h3>Clustering</h3>
115+
<span id="cluster-arrow" class="fa fa-2x fa-caret-right"></span>
118116
</div>
119117
</div>
120118
"""
@@ -125,3 +123,11 @@ alchemy.controlDash =
125123
.select('#cluster_control_header')
126124

127125
alchemy.clusterControls.init()
126+
127+
dashIsShown: ->
128+
conf = alchemy.conf
129+
130+
conf.showEditor || conf.captionToggle || conf.toggleRootNodes ||
131+
conf.removeElement || conf.clusterControl || conf.nodeStats ||
132+
conf.edgeStats || conf.edgeFilters || conf.nodeFilters ||
133+
conf.edgesToggle || conf.nodesToggle || conf.search

app/scripts/alchemy/core/filters.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ alchemy.filters =
5555
show: () ->
5656
filter_html = """
5757
<div id = "filter-header" data-toggle="collapse" data-target="#filters form">
58-
<h3>
59-
Filters
60-
</h3>
58+
<h3>Filters</h3>
6159
<span class = "fa fa-2x fa-caret-right"></span>
6260
</div>
6361
<form class="form-inline collapse">

app/scripts/alchemy/core/startGraph.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ alchemy.startGraph = (data) ->
8181
defs = d3.select("#{alchemy.conf.divSelector} svg").append("svg:defs")
8282

8383
if conf.directedEdges
84-
arrowSize = conf.edgeArrowSize
84+
arrowSize = conf.edgeArrowSize + (conf.edgeWidth() * 2)
8585
marker = defs.append("svg:marker")
8686
.attr("id", "arrow")
8787
.attr("viewBox", "0 -#{arrowSize * 0.4} #{arrowSize} #{arrowSize}")
@@ -98,6 +98,4 @@ alchemy.startGraph = (data) ->
9898

9999
if conf.showEditor
100100
editor = new alchemy.editor.Editor
101-
editor.startEditor()
102-
# editor.nodeEditorInit()
103-
# editor.edgeEditorInit()
101+
editor.startEditor()

0 commit comments

Comments
 (0)