Skip to content

Commit

Permalink
use google cdn for graph, not local js files
Browse files Browse the repository at this point in the history
  • Loading branch information
studiospring committed Nov 16, 2013
1 parent bcfdaca commit 6e6bf06
Show file tree
Hide file tree
Showing 4 changed files with 2,869 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require jsapi
//= require visualization
//= require graph3d-min
/*//= require jsapi*/
/*//= require visualization*/
//= require graph3d
//= require jquery.validate.min
//= require_tree .
1 change: 1 addition & 0 deletions app/views/pv_queries/_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ index<% end %>
<p class="alert alert-warning">Oops. There should be a pretty graph here.</p>
<% end %>
<button id="reload_page" type="button" class="btn btn-primary" autofocus="true">Try again</button>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
6 changes: 4 additions & 2 deletions app/views/pv_queries/create.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ready = ->
#draw graph# <<<
data = null
graph = null
google.load("visualization", "1")

#Called when the Visualization API is loaded.
drawVisualization = () ->
# Create and populate a data table.
Expand Down Expand Up @@ -32,15 +34,15 @@ ready = ->
verticalRatio: 0.8
cameraPosition: {"horizontal": 5.6, "vertical": 0.2, "distance": 1.8}

alert 'before instantiating graph'
# Instantiate our graph object.
graph = new links.Graph3d(document.getElementById('output_pa'))

alert 'before draw'
# Draw our graph with the created data and options
graph.draw(data, options)
alert 'end function'

drawVisualization() #>>>
alert 'end graph'

$('#reload_page').click ->
location.reload(true)
Expand Down
Loading

0 comments on commit 6e6bf06

Please sign in to comment.