cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

NeoDash Display images

guido
Graph Buddy

Hi,

I can't figure out to display images in a Neodash report.
This is a simple query which looks up the logo ("mark") of people in my database:

MATCH (p:Producer)-[r:HAS_NAME_VARIANT]->(n:Name)
WHERE n.Name = $neodash_name_name
OPTIONAL MATCH (p)-[r2:HAS_PICTURES]->(i:Pictures {type: "mark"})
RETURN i.url

The "i.url" property contains the url for the image ( e.g. http://tapitta.be/wp-content/uploads/2022/12/I3mark_1.jpg). 
In iFrame I get the error message "Invalid iFrame URL. Make sure your url starts with http:// or https://."
Any help reatly appreciated!

 

2 ACCEPTED SOLUTIONS

Hi @guido ,

So far the only option is using an action from a table that use i.url as the value to be set on your desired parameter.

Hopefully from Friday this week you should be able to do it on the parameter selector once I merge https://github.com/neo4j-labs/neodash/pull/274 

Oh, y’all wanted a twist, ey?

View solution in original post

Hi @guido !

We releases 2.2.2 last week. You should be able to get expected interaction with the new parameter selector.

Oh, y’all wanted a twist, ey?

View solution in original post

11 REPLIES 11

bennu_neo
Neo4j
Neo4j

Hi @guido!

Are you using this query inside an iframe report? The iframe chart expects an url that may contain neodash parameters (its doesn't execute any query). You can inject this url as a parameter with an action or a parameter select chart (on our next release we will add the possibility to assign different values than the one displayed).

Bennu

Oh, y’all wanted a twist, ey?

guido
Graph Buddy

Hi @bennu_neo ,

thanks for your reply.   
Not sure what you mean, sorry.
Let me clarify a bit.  
The url is the content of the property "url" of the node (i:Pictures).  
I have a few hundred images, some are {type: "mark"}, others are {type:"portrait"}, etc. Some persons have 1 portrait, others have several, etc.  
So I am looking for a way to display these whenever the parameter $neodash_name_name of the person in question is selected, much in the same way as their birthdate, profession and other data.

Could you post a code example that would do just that?  
Thanks. 
Guido

 

Hi @guido !

I've been out for a while. I hope I can still help. You should create an action that will eventually set a parameter e.g. $neodash_profile_picture to the value that's on the image url property. At the same time, you need an iframe chart with solely $neodash_profile_picture as input. Remember that the iframe chartS doesn't execute any cypher  "iFrame reports let you embed external webpages into your dashboard. Enter an URL in the query box above to embed it as an iFrame."

regards

Oh, y’all wanted a twist, ey?

Hi @bennu_neo ,

No problem. My turn to be offline for a while. I will respond at the end of the month. Guido.

Hi @bennu_neo ,
I finally got round to studying your reply and I do understand the mechanics now.
The only thing is that I can't figure out how to create the parameter.
The code:

MATCH (p:Producer)-[r:HAS_NAME_VARIANT]->(n:Name)
WHERE n.Name = $neodash_name_name
OPTIONAL MATCH (p)-[r2:HAS_PICTURES]->(i:Pictures {type: "mark"})
RETURN i.url

 returns the url http://tapitta.be/wp-content/uploads/I2mark_1.jpg So far, so good.
The corresponding parameter would then be called $neodash_pictures_url. Now, how do I convert the property i.url into that parameter?
Thanks.

I am also looking for how to set parameters using another existing parameter, without requiring the user to manually interact... I'm not sure there is a way to accomplish this yet in neodash - but await an answer, as it would be very convenient to make tactical and contextual markdown/iFrame reports.. 

Hi @pdrangeid !
I remember this request. You told me that you were 'hacking' the parameter selector query by updating the dashboard json with your own query that uses other params. I remember updating the parameter selector in order to make this work. Isn't it working? Ill check.

Out of this hack, one of our top priority developments is adding a query builder that will allow you to set your own personalized queries on the selector.

Oh, y’all wanted a twist, ey?

Hi @guido ,

So far the only option is using an action from a table that use i.url as the value to be set on your desired parameter.

Hopefully from Friday this week you should be able to do it on the parameter selector once I merge https://github.com/neo4j-labs/neodash/pull/274 

Oh, y’all wanted a twist, ey?

Hi @guido !

We releases 2.2.2 last week. You should be able to get expected interaction with the new parameter selector.

Oh, y’all wanted a twist, ey?

Hi @bennu_neo ,
I don't know if it's going to work because I don't see where the Parameter Selector comes in.
Let me clarify.
I have a large database of persons. the data of whom are returned on a series of tabs.
On the first tab, I look for the right person, which generates the parameter $neodash_name_name  which is used to automatically return data on this particular person on the next tabs: Life Events (birth, etc.), Career Events (start, stop, etc.), Address, etc.
Then there is a table on which logos, portraits and examples of their work should be displayed.
This is where this query comes in:

MATCH (p:Producer)-[r:HAS_NAME_VARIANT]->(n:Name)
WHERE n.Name = $neodash_name_name
OPTIONAL MATCH (p)-[r2:HAS_PICTURES]->(i:Pictures {type: "mark"})

Lines 1 and 2 get the person in question and line 3 checks if there is a logo ("mark") present. If so, the url ( http://tapitta.be/wp-content/uploads/I2mark_1.jpg) is stored in the property i.url.
This property should be displayed in the iframe. So no human/manual intervention by means of a Parameter Selector.
Unless, of course, I misunderstood...
 

guido
Graph Buddy

Anybody?🙏

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online