Display background image in Neo4j browser - neo4j

Some nodes in my graph database have a property which contain a URL to an image. I wanted to use Neo4j browser's style sheet functionality to display that image as the background image of a node.
My .grass file looks like this:
node {
diameter: 40px;
color: #DFE1E3;
border-color: #D4D6D7;
border-width: 2px;
text-color-internal: #000000;
caption: '{name}';
font-size: 10px;
background-color: #00aaee;
}
node.Actor {
color: #AD62CE;
border-color: #9453B1;
text-color-internal: #FFFFFF;
background-image: url('{image}');
}
After I uploaded the file, the line background-image: url('{image}'); gets converted to background-image: url({image}); (missing apostrophes). No image is shown in the browser.
What am I doing wrong?

You're not doing anything wrong.
The feature is not supported in the Neo4j browser. Other visualization solutions do exist. Unfortunately the ones that use this feature out of the box are not open source and may require a commercial license.
Of these solutions are:
http://linkurio.us/
https://www.tomsawyer.com/products/visualization/index.php
http://www.keylines.com/

As #Kenny Bastani said most of the libraries that implement this feature have a commercial license.
For a full list of the supported ones have a look to the official Neo4J visualize page.

Related

My Website Does Not Seem to Want to Print Anything

I have developed a website and am in the process of converting most of the tables over to DataTables. In testing out one of the DataTable features the Print button, I discovered that nothing would print except the Title of the web page. At first I thought it was an issue with DataTables, but after playing around I've discovered that none of my pages seem to want to print. I'm testing with Chrome because it has the Print Preview, but I can right-click on any page in my site and select Print... and I get the same behavior -- only the Title of the web page displays. Has anybody experienced anything like this before? Here's a link to my site:
JCPS DMC
Even on the home page, try right clicking and select Print and you'll see what I mean. Please tell me this is some super-easy that I just don't know about -- some setting that I've overlooked. I will be happy to provide any support information you need, but I don't even know what that would be... :(
Well this is embarrassing...apparently at some point I included a css script in my Master page (the site is developed using asp.net). In the css I had this little gem which was blocking anything from being printed:
#media print {
body
{
visibility: hidden;
border-top: hidden;
width: 50%;
}
.noPrint
{
display: none !important;
}
ol
{
display: none;
}
.printSection, .printSection *
{
visibility: visible;
margin: 1px;
padding: 1px;
}
.printSection
{
position: relative;
left: 0;
top: 0;
}
}
Not even sure why I put that in there, but I removed it and everything is working peachy now...

neo4j GraSS upload removes property quotes

I've downloaded the graphstyle.grass and added the following property to the pre-existing label:
node.CELL {
color: '{color}';
border-color: #60B58B;
text-color-internal: #FFFFFF;
caption: '{idx}';
}
(The color property used to be #6DCE9E)
But now, after uploading that new GraSS file to the neo4j browser, all CELL-nodes are black. When I examine the GraSS file on the browser, it is now:
node.CELL {
color: {color};
border-color: #60B58B;
text-color-internal: #FFFFFF;
caption: '{idx}';
}
1) Why did neo4j remove my quotes around the {color}-reference?
2) How can I write the GraSS file so that neo4j recognizes that the color is derived from the color-property of the CELL nodes?
Thank you.
The neo4j browser does not support setting colors from node/relationship properties.
Aside from the neo4j browser, there are a number of other visualization tools for neo4j. Perfhaps one of them will work better for you.

Graticule and Rails: REXML::ParseException: missing attribute quote

I use graticule 1.0.0.pre2. When I try to locate some addresses that Google doesn't recognize, graticule raises an exception:
LibXML::XML::Error in Cms/storesController#update
Fatal error: Extra content at the end of the document at :1.
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/google.rb:82:in `prepare_response'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/base.rb:83:in `get'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/graticule-1.0.0.pre2/lib/graticule/geocoder/google.rb:36:in `locate'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable/geocode.rb:31:in `create_from_location'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable/geocode.rb:27:in `find_or_create_by_location'
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/acts_as_geocodable-1.0.4/lib/acts_as_geocodable.rb:262:in `attach_geocode'
...
...
I'm using the Google service. This is the response that generates the exception:
"<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/><title>Sorry...</title><style> body { font-family: verdana, arial, sans-serif; background-color: #fff; color: #000; }</style></head><body><div><table><tr><td><b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font></b></td><td style=\"text-align: left; vertical-align: bottom; padding-bottom: 15px; width: 50%\"><div style=\"border-bottom: 1px solid #dfdfdf;\">Sorry...</div></td></tr></table></div><div style=\"margin-left: 4em;\"><h1>We're sorry...</h1><p>... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.</p></div><div style=\"margin-left: 4em;\">See Google Help for more information.<br/><br/></div><div style=\"text-align: center; border-top: 1px solid #dfdfdf;\">© 2009 Google - Google Home</div></body></html>"
With other addresses it works! How can I prevent that exception?
I received this same error. Using the Pry Debugger I placed a binding.pry under the Parse declaration in happy mapper. For you that would be
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/happymapper-0.3.2/lib/happymapper.rb:84:in `parse'
Restarted pry and ran
location = geocoder.locate("61 East 9th Street, Holland, MI")
The debugger stopped right after
def parse(xml, options = {})
I did a dump of the xml variable to receive an HTML dump from Google that included the message
<h1>We're sorry...</h1>
<p>... but your computer or network may be sending automated queries.
To protect our users, we can't process your request right now.</p>
See <a href="https://support.google.com/websearch/answer/86640">
Google Help
</a> for more information.
Haven't resolved yet but that's the issue.

Using image-url within sass to avoid hard coding image assets path

I've just started to work with the rails asset pipeline, I'm a front-end guy.
I'm trying to use image-url helper within sass files so that I don't have to hard-code the path.
The following SASS
.some-class
background: image-url("image.png")
generates the following CSS
.some-class{
background: url("asset/image.png");
}
How do I use the image-url helper to generate the following css, without hard-coding the image path ?
.some-class{
background: url("asset/image.png") no-repeat 0 0 #fff;
}
You can use,
.some-class
background-image: image-url("image.png")
background-repeat: no-repeat;
background-color: #fff;
and so on.
or
background: #fff image-url("image.png") no-repeat 0 0;
should work.
You propably should use:
background-image: asset-url("image.png", image) no-repeat 0 0 #fff;
The asset-url is a sass/rails feature, which lets the asset pipeline do some (production) work for you. You can read about that feature here.
Using the helper is preferable over a plain url("image.png"), as it gives you finger printed URLs in production. See this StackOverflow answer.

sIFR3 and line-height/leading

I've successfully implemented sIFR3 using the nightlies from the end of Oct. All is well and much easier to work with than sIFR2 except where it comes to line-height.
I was able to deal with my headings fine. But I have a pullquote that needs more line-height/leading and though I've read through support and see that it needs to be applied to the .sIFR-root, it's not working. Is there something funky I don't know about?
Here's my code:
sIFR.replace(fedraBook, {
selector: '.callout p',
css: '.sIFR-root { background-color: #FFFFFF; color: #968b85; leading: 3.5;}'
});
I had the leading at 1.5 but changed to 3.5 just to see if I could get it to vary at all. It does not.
I tried also affecting it with this CSS selector with no joy:
.sIFR-active .callout p {
font-size: 1.6em;
padding-top: 7px;
line-height: 2.5em;
}
Does anyone have any ideas here? What am I missing?
i know my answer is not of much help but I too have had this issue. there is very little documentation on the subject. as far as I know, sIFR does not support true line-height. It uses the height of the flash object and the font-size to set the line-height. http://tests.novemberborn.net/sifr3/experiments/tuning/line-height.html

Resources