Fork me on GitHub
#portal
<
2022-02-09
>
folcon01:02:19

Is there any way to make the portal plugin window in intellij larger? I've been trying to make it an editor window, but not managed to do it...

djblue02:02:25

The window split itself or the font inside it?

R.A. Porter02:02:40

If it's just the window itself, like all IJ's tool windows it can be floating or a fully separate window if you need it larger. Not sure about font size adjustment, though. Probably in editor settings for tool windows, but that'd likely affect all of them.

folcon03:02:27

Oh to pull it out, I'd prefer it not floating? If it's doing that I'm not sure what advantage the plugin has vs running it directly? Or does it not use chrome at all at that point?

folcon03:02:10

Hence wondering if I could have it just be where an open file would be in the editor?

folcon03:02:27

Similar to how datagrip lets you open tables as files...

R.A. Porter04:02:54

Hmm. I don't think I've ever seen IJ allow a tool window in the editor space, but you can certainly stretch it, or move it left, right, or to the bottom as a pinned window. I've tried floating, but it's annoying. As for a fully separate window, I agree that it's not much better/different from running it through Chrome that way. Might work better for you on the bottom, though.

folcon10:02:23

I'm currently running it as the chrome version even though I'm in intellij, what are the plugin benefits? Does it render in intellij so uses less system memory?

folcon10:02:17

I mean you get straightforward window cycling if it's chrome 😃... (not sure the to tab between tool windows shortcut) The tutorial video is interesting though 😃... https://www.youtube.com/watch?v=gByyg-m0XOg

folcon13:02:59

Oh, one final question, how do I write custom views?

djblue16:02:26

The main benefits of using the plugin is having the Portal UI closer to your code / repl. If that isn't something you are looking for, then using the UI in any browser also works just as well 👌

folcon16:02:51

Ah cool, I was wondering if there was any interop benefits etc 😃...

djblue16:02:38

@U0JUM502E https://www.youtube.com/watch?v=Tj-iyDo3bq0 is a more up-to-date demo. Need to update the readme.

djblue16:02:53

For a custom viewer, there are a few ways to customize what portal will render and choosing one depends on what you want. If you only want to control rendering, you can send hiccup to portal and it should render just fine. Selecting the hiccup viewer by default can also be automated via metadata. For example: ^{:portal.viewer/default :portal.viewer/hiccup} [:h1 "hello, world"] . If you are looking for custom rendering + custom interactions then you need to provide a cljs reagent components. The code for the component can be provided as a string to https://github.com/djblue/portal/blob/master/src/portal/api.cljc#L91-L96. In the cljs code, you must register the reagent component via https://github.com/djblue/portal/blob/master/src/portal/ui/api.cljs#L6-L19. FYI the custom viewer is interpreted via https://github.com/babashka/sci.

folcon16:02:39

Ohh, thanks 😃... I'm trying to figure out how to render 2d / 3d images from data.

djblue16:02:01

Does the rendering need to happen in the Portal UI runtime or can it happen in your runtime?

folcon16:02:49

I'm doing gamedev and it would be nice to take things like gamemaps and be able to swap the viewer to easily look at what my world would render out? Things like, oh let me take a list of noise maps and the current terrain map as a collection, now I can see 5 images next to each other and see what tweaking one of the noise maps does to my final terrain generation...

folcon16:02:40

I'm ok generating images for example in my runtime, but then what's a good way of doing side by side comparisons like I'm suggesting?

folcon16:02:37

I'm also eyeing up the vega stuff and thinking it would also be useful to compare images to graphs, so I can see a plot representing stuff and then an image of what that would result in 😃

folcon16:02:56

Does that make sense @U1G869VNV?

djblue16:02:04

If you already have image data, you can push the binary for it into portal and it should render it 👌

djblue16:02:31

You can also tap> a vector of binary data if you want to group them

folcon16:02:34

Does that even work in collections?

👍 1
folcon16:02:39

Oh cool, thanks!

folcon16:02:52

Btw, is there a hiccup format as well for vega stuff?

djblue16:02:18

Not sure I understand, you can embed vega in hiccup

djblue16:02:53

The hiccup format is extended a little because you can refere to portal viewer within

folcon16:02:00

Is there a vega/hiccup example in the repo?

djblue16:02:25

I would checkout the demo data at https://djblue.github.io/portal/

folcon16:02:54

Thanks! I'll check it out 😃

folcon16:02:52

Ah, I completely missed :examples.data/data-visualization the last time I looked at this 😃

👍 1