portal

Schmoho 2025-02-21T18:19:02.979939Z

Hey, first off I wanna say I really love this project and the whole idea of it! https://cljdoc.org/d/djblue/portal/0.24.0/api/portal.ui.viewer.charts This version had chart viewers. What happend to them?

❤️ 2
djblue 2025-02-21T22:03:42.113019Z

The viewer still exists, I think the docs for the UI code was removed since most consumers don't use the UI code directly.

Schmoho 2025-02-21T22:14:00.636079Z

In that doc it has a note "CLJS" only, is that still the case? I haven't looked too deeply into everything now, I just figured the output of frequencies would be a prime candidate for a bar chart viewer, but it seems I was mistaken. How would I go about figuring out what a value needs to satisfy for a particular viewer to be applicable?

djblue 2025-02-21T22:17:30.593349Z

the cljs only is referring to how the reagent component is implemented in cljs, but the viewer supports data from any runtime that can send it data.

djblue 2025-02-21T22:18:17.002919Z

https://github.com/djblue/portal/blob/master/src/portal/ui/viewer/charts.cljs#L7-L21 are the specs that the viewer uses to match data

Schmoho 2025-02-21T22:28:52.413439Z

This is friggin magic man thanks. If I really wanted to customize the vega, I would go and write custom viewers right?

👍 1
Schmoho 2025-02-21T22:31:09.912059Z

yeah stupid question the longer I look at the code

djblue 2025-02-21T22:31:48.904619Z

It's the static documentation like on cljdoc + live viewer docs with the specs extracted from the viewers

Schmoho 2025-02-21T22:34:56.487189Z

Thanks! Speaking of vega, I know this is a very open question likely to have a disappointing answer, but I am still very new to the whole data visualization thing - in the bioinformatics field you have pretty elaborate visualization systems at times that conceptually don't map too well to what vega seems to be designed for mostly. Anyways, the tools out there don't use vega, but there are some good JS components - are you aware of some tooling or "supported" way of glueing vega interactions to API calls to other stuff? Is that a thing people do?

djblue 2025-02-21T22:40:54.351689Z

I think the vega spec has some hooks for interactivity, but I haven't explored it too much. For custom interactivity, in portal, I would go down the path of building a custom reagent viewer. https://github.com/djblue/portal-workflows/blob/main/src/portal/workflows.cljsis an example of a what you can do with a custom viewer that I used for my recent conj talk. https://cljdoc.org/d/djblue/portal/0.58.5/doc/guides/custom-viewer are some docs on getting started with a custom viewer. Is that what you were looking for?

djblue 2025-02-21T22:41:23.720179Z

Your custom viewer can import modules from npm if they are installed btw

Schmoho 2025-02-21T22:49:38.039389Z

Yeah that definitely covers the part of more tailored visualizations for the specific data I am working with. The hooking vega components up with stuff like protein, alignment or graph viewers I guess will go pretty far beyond that, but again, new stuff for me, I'll revisit that when I am more familiar with the the vega ecosystem

Schmoho 2025-02-21T22:51:24.231399Z

Really cool stuff! And to think what made me aware of this whole thing was the bb docs 😄

Schmoho 2025-02-21T19:15:31.821009Z

Also, this setup: https://cljdoc.org/d/djblue/portal/0.58.5/doc/guides/nrepl overall works fine for me using nREPL, but I don't get any source and file info or timestamping?

djblue 2025-02-21T22:06:23.413549Z

This may be an issue with how your nrepl client (editor/cli repl) is conveying source information to the nrepl server. I know cursive communicates source info in a non-standard way. Although, portal was https://github.com/djblue/portal/commit/6d2639f7629d2f8ae8bc80e9dd7ad9b2a1fb3e40to support cursive's non-standard behavior. The timestamp is generated by the server, so that should always work which is a bit more odd 🤔

Schmoho 2025-02-21T22:16:35.853819Z

I'm using CIDER in Emacs, and so far I thought my setup is pretty standard/ootb, but maybe I screwed something up somewhere

djblue 2025-02-21T22:22:06.481209Z

I originally built the nrepl middleware when I was using emacs, but I haven't validated it recently.

djblue 2025-02-21T22:22:33.715299Z

When I get some time I'll double check 👍

djblue 2025-02-21T22:27:02.059319Z

If you want to take a look, you can tap some values from https://github.com/djblue/portal/blob/master/src/portal/nrepl.clj#L91-L92 and see if the data flowing into the nrepl middleware has the expected info.

❤️ 1
djblue 2025-02-21T22:28:28.335199Z

I think eval'ing the PortalTransport will impact future evals so you don't need to restart your repl after connect/jack-in