You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Carousel up to 5 example images for class/dataset rows
AlignedDatasets, AllDatasets, AnatomyExpressedIn (get_expression_overlaps_here)
and TransgeneExpressionHere bound a single representative example image
(LIMIT 1) into the Images cell, so each row showed only one thumbnail even
when the class/dataset has many examples.
These four queries aggregate one-to-many example individuals into a single
row, so they now collect up to 5 example images and emit them as a
' | '-joined [](ref) list -- the same carousel shape the
V2 imageMarkdownToVariableJson splits into a SlideshowImageComponent.
Per-individual queries (instances, templates, NBLAST similarity, connectivity
partners, dataset image listings, terms-for-pub) are one-image-per-row by
design and are left unchanged.
Validated read-only against prod pdb: AlignedDatasets=5, medulla=4, EP=2.
OPTIONAL MATCH (anat)<-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)<-[:depicts]-(channel:Individual)-[irw:in_register_with]->(template:Individual)-[:depicts]->(template_anat:Individual)
2884
2884
OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class)
2885
-
WITH i, template, template_anat, channel, technique, irw
2886
-
LIMIT 1
2887
-
RETURN i, template, template_anat, channel, technique, irw
2885
+
WITH anat, i, template_anat, technique, irw
2886
+
WHERE i IS NOT NULL
2887
+
WITH anat, i, template_anat, technique, irw LIMIT 5
2888
+
WITH anat, collect({{i: i, template_anat: template_anat, technique: technique, irw: irw}}) AS imgs
2889
+
WITH anat, imgs, head(imgs) AS rep
2890
+
RETURN
2891
+
rep.template_anat AS template_anat,
2892
+
rep.technique AS technique,
2893
+
apoc.text.join([x IN imgs |
2894
+
REPLACE(apoc.text.format("[](%s)",
2895
+
[coalesce(x.i.label, 'image') + " aligned to " + CASE WHEN x.template_anat.symbol[0] <> '' THEN x.template_anat.symbol[0] ELSE x.template_anat.label END,
coalesce(x.i.label, 'image') + " aligned to " + CASE WHEN x.template_anat.symbol[0] <> '' THEN x.template_anat.symbol[0] ELSE x.template_anat.label END,
OPTIONAL MATCH ({ds_var})<-[:has_source]-(i:Individual)<-[:depicts]-(channel:Individual)-[irw:in_register_with]->(:Template)-[:depicts]->(templ:Template)
5381
5398
OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class)
5382
-
WITH i, templ, technique, irw, channel LIMIT 1
5383
-
RETURN i, templ, technique, irw
5399
+
WITH {ds_var}, i, templ, technique, irw
5400
+
WHERE i IS NOT NULL
5401
+
WITH {ds_var}, i, templ, technique, irw LIMIT 5
5402
+
WITH {ds_var}, collect({{i: i, templ: templ, technique: technique, irw: irw}}) AS imgs
5403
+
WITH {ds_var}, imgs, head(imgs) AS rep
5404
+
RETURN
5405
+
rep.templ AS templ,
5406
+
rep.technique AS technique,
5407
+
apoc.text.join([x IN imgs |
5408
+
REPLACE(apoc.text.format("[](%s)",
5409
+
[coalesce(x.i.label, 'image') + " aligned to " + CASE WHEN x.templ.symbol[0] <> '' THEN x.templ.symbol[0] ELSE x.templ.label END,
OPTIONAL MATCH (ep)<-[:has_source|SUBCLASSOF|INSTANCEOF*]-(i:Individual)<-[:depicts]-(channel:Individual)-[irw:in_register_with]->(:Template)-[:depicts]->(templ:Template)
5718
5749
OPTIONAL MATCH (channel)-[:is_specified_output_of]->(technique:Class)
5719
-
WITH i, templ, technique, irw LIMIT 1
5720
-
RETURN i, templ, technique, irw
5750
+
WITH ep, i, templ, technique, irw
5751
+
WHERE i IS NOT NULL
5752
+
WITH ep, i, templ, technique, irw LIMIT 5
5753
+
WITH ep, collect({{i: i, templ: templ, technique: technique, irw: irw}}) AS imgs
5754
+
WITH ep, imgs, head(imgs) AS rep
5755
+
RETURN
5756
+
rep.templ AS templ,
5757
+
rep.technique AS technique,
5758
+
apoc.text.join([x IN imgs |
5759
+
REPLACE(apoc.text.format("[](%s)",
5760
+
[coalesce(x.i.label, 'image') + " aligned to " + CASE WHEN x.templ.symbol[0] <> '' THEN x.templ.symbol[0] ELSE x.templ.label END,
0 commit comments