Permalink
Browse files

dummy data

  • Loading branch information...
maxdemarzi committed Feb 20, 2011
1 parent b9569ec commit 5da3bed831860ef0eca2f383070bef778aa479de
View
11 Gemfile
@@ -0,0 +1,11 @@
+source :gemcutter
+gem 'sinatra', '1.1.2'
+gem 'neography', '0.0.10'
+gem 'haml', '3.0.25'
+gem 'json'
+
+group :test do
+ gem 'rspec'
+ gem 'rack-test'
+ gem 'net-http-spy'
+end
View
@@ -0,0 +1,40 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ crack (0.1.8)
+ diff-lcs (1.1.2)
+ haml (3.0.25)
+ httparty (0.7.4)
+ crack (= 0.1.8)
+ json (1.5.1)
+ neography (0.0.10)
+ httparty (~> 0.7.3)
+ json
+ net-http-spy (0.2.1)
+ rack (1.2.1)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.5.0)
+ sinatra (1.1.2)
+ rack (~> 1.1)
+ tilt (~> 1.2)
+ tilt (1.2.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ haml (= 3.0.25)
+ json
+ neography (= 0.0.10)
+ net-http-spy
+ rack-test
+ rspec
+ sinatra (= 1.1.2)
View
@@ -0,0 +1,7 @@
+Description
+-----------
+An attempt to use [Neography](https://github.com/maxdemarzi/neography) and [processing.js](http://processingjs.org/) to navigate a Neo4j graph via its [REST API](http://components.neo4j.org/neo4j-server/milestone/rest.html).
+
+Links
+-----
+* [Neo4j Community] (http://neo4j.org)
View
@@ -0,0 +1,7 @@
+require 'rubygems'
+require 'bundler'
+
+Bundler.require
+
+require 'neovigator'
+run Neovigator
View
@@ -0,0 +1,62 @@
+require 'rubygems'
+require 'neography'
+require 'sinatra/base'
+require 'uri'
+
+class Neovigator < Sinatra::Base
+ set :haml, :format => :html5
+ set :app_file, __FILE__
+
+ include Neography
+
+ configure do
+ env = ENV['NEO4J_ENV'] || "development"
+ $stderr.puts env
+ if env == "development"
+ require 'net-http-spy'
+ Net::HTTP.http_logger_options = {:verbose => true}
+ end
+
+ Config.server = ENV['NEO4J_HOST'] || "neography.org"
+# Config.directory = '/' + (ENV['NEO4J_INSTANCE'] || "")
+# Config.authentication = "basic"
+# Config.username = ENV['NEO4J_LOGIN'] || ""
+# Config.password = ENV['NEO4J_PASSWORD']|| ""
+ end
+
+
+ before do
+ @neo = Neography::Rest.new
+ end
+
+ helpers do
+ def link_to(url, text=url, opts={})
+ attributes = ""
+ opts.each { |key,value| attributes << key.to_s << "=\"" << value << "\" "}
+ "<a href=\"#{url}\" #{attributes}>#{text}</a>"
+ end
+ end
+
+
+ get '/resources/show' do
+ content_type :json
+
+ @node = {:details_html => "<h2>Fluency with information technology</h2>\n<p class='summary'>\nthere's no description for this topic yet.\n[\n<a href='http://freebase.com/view/soft/isbn/9780321268464/best' target='_new'>Freebase Topic</a>\n]\n</p>\n",
+ :data => {:attributes => [{:values => [], :name => "Number of pages", :id => "/book/book_edition/number_of_pages"},
+ {:values => [{:name => "Fluency with Information Technology", :id => "/en/fluency_with_information_technology"}], :name => "Edition Of", :id => "/book/book_edition/book"},
+ {:values => [{:name => "Lawrence Snyder", :id => "/en/lawrence_snyder"}], :name => "Author/editor", :id => "/book/book_edition/author_editor"},
+ {:values => [{:name => "9780321268464", :id => "/soft/isbn/9780321268464"}], :name => "ISBN", :id => "/book/book_edition/isbn"}],
+ :name => "Fluency with information technology",
+ :id => "/soft/isbn/9780321268464/best"}
+ }
+
+ @node.to_json
+
+ end
+
+ get '/' do
+ @neoid = params["neoid"]
+ haml :index
+ end
+
+end
View
@@ -0,0 +1,263 @@
+@font-face {
+ font-family: "GraublauWeb";
+ src: url(/fonts/GraublauWeb.otf) format("truetype");
+}
+@font-face {
+ font-family: "GraublauWeb";
+ font-weight: bold;
+ src: url(/fonts/GraublauWebBold.otf) format("truetype");
+}
+
+header, footer, section, nav { display:block; }
+
+footer {
+ margin-top: 5px;
+ padding: 10px;
+ position: absolute;
+ bottom: 5px;
+ left: 5px;
+ right: 10px;
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ line-height: 1.4;
+ /* clearing */
+ overflow: auto;
+}
+
+footer .left {
+ float: left;
+}
+
+footer .right {
+ float: right;
+}
+
+.left {
+ float: left;
+}
+
+.right {
+ float: right;
+}
+
+a {
+ color: #000;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #000;
+ /*border-bottom: 2px solid #000;*/
+}
+
+header {
+ margin: 0;
+ padding: 5px;
+ position: absolute;
+ top: 5px;
+ left: 0px;
+ right: 0px;
+}
+
+header section#title {
+ float: left;
+ margin-top: 5px;
+}
+
+header section#title p {
+ margin: 0;
+ padding: 0;
+ margin-left: 10px;
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size:12px;
+ line-height:1.4;
+}
+
+header section#search {
+ float: right;
+ padding: 12px;
+ margin-right: 0px;
+}
+
+html {
+ overflow-x: hidden;
+}
+
+html,body {
+ margin:0px;
+ padding:0px;
+ color: #555;
+
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size-adjust:none;
+ font-stretch:normal;
+ font-style:normal;
+ font-variant:normal;
+ font-weight:normal;
+ line-height:normal;
+ background: #eaefe0;
+}
+
+
+
+xs {
+ color: #a68d49;
+}
+
+body {
+ padding:5px;
+}
+
+header h1 {
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ width: 200px;
+ color: black;
+ font-weight: bold;
+ margin: 0px;
+ font-size:30px;
+ padding: 0px;
+ margin-left: 10px;
+}
+
+h2 {
+ font-size: 19px;
+ color: #000;
+ border-bottom: 1px solid #000;
+}
+
+h3 {
+ font-size: 15px;
+ color: #000;
+ border-bottom: 1px solid #000;
+}
+
+section#content {
+ display: none;
+ position: absolute;
+ top: 200px;
+ bottom: 200px;
+ left: 0px;
+ right: 0px;
+ margin-top: 5px;
+ margin: auto;
+ width: 400px;
+}
+
+aside {
+ font-size: 12px;
+ position: absolute;
+ right: 17px;
+ top: 80px;
+ bottom: 50px;
+ width: 290px;
+ padding: 10px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border: 1px solid #c1c1c1;
+ line-height: 1.5em;
+ background: #fff;
+ opacity: 0.9;
+ overflow: auto;
+}
+
+p.summary img {
+ float: left;
+ margin-right: 5px;
+ margin-bottom: 5px;
+}
+
+ul.links {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+
+ul.links li {
+ margin: 0;
+ margin-bottom: 3px;
+}
+
+ul.links li:hover {
+ margin-bottom: 2px;
+ border-bottom: 1px solid #000;
+}
+
+ul.links li a {
+ width: auto;
+}
+
+section#infovis {
+ display: none;
+ height:550px;
+ overflow: hidden;
+ background-color:#F4F4F4;
+}
+
+.hidden {
+ display:none;
+}
+
+#browser_not_supported {
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ margin: auto;
+ line-height: 2em;
+ font-size: 15px;
+ display: none;
+}
+
+/* Clearing */
+.clearfix:after, #frame:after, .navigation:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+.clearfix, #frame, .navigation {display: inline-block;}
+* html .clearfix, * html #frame, * html .navigation {height: 1%;}
+.clearfix, #frame, .navigation {display: block;}
+.clear {clear: both;}
+
+
+/*
+-----------------------------------------
+ Search Box
+-----------------------------------------
+*/
+
+#neo-suggest {
+ border: 1px solid #c1c1c1;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ opacity: 0.9;
+ border-radius: 5px;
+ padding: 5px;
+ width: 300px;
+ font-family: GraublauWeb, "Helvetica Neue", Helvetica, Arial, sans-serif;
+ text-align: right;
+ font-size: 13px;
+ color: #555;
+}
+
+#search .ghost-input {
+ color: #99a;
+}
+
+#search .focused {
+ color: #878699;
+ font-style: normal;
+}
+
+.neo-reset a {
+ text-decoration: none;
+ border: 0;
+}
+
+.neo-reset a:hover {
+ text-decoration: none;
+ border: 0;
+}
+
+
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 5da3bed

Please sign in to comment.