Shiny for Julia [work in progress, early request for feedback]

Re webassembly, I’ve read that it’s already gotten pretty good support in most browsers. However, what people seem to forget is that the problem of rendering UIs still remains. Even if we can run Julia in the browser, the issue of rendering UI components and interacting with them still remains. Think about Julia desktop apps: Blink (so web UIs) is widely used because good UI libraries are scarce. I’m not sure how that would work - maybe by using the native platform UI elements, or using something like a game engine (like the Unreal engine for web)?

Yes that’s how that works currently: they just paint gui widgets from a lib to canvas and don’t use the DOM.

agreed on that. I’d rather see plotly used rather than introduce yet another plotting/GUI lib

How about reactivity? This is an essential part of the Shiny architecture and what makes it high level and very fast to implement something.

1 Like

+100. For this usecase PlotlyJS (that is getting very good WebIO integration) or a future Makie WebGL backend really are ideal solutions.

2 Likes

Yeah, I fully agree - any solution should leverage the existing Julia ecosystem. So support for Interactive would be a must. And maybe going the reverse route of adding Predix as Interactive custom widgets.

Thanks for sharing the repo - looking into it :slight_smile:

No biggie, I can follow the steps to get it running, thanks for the info.

@piever The Observables documentation seems to be broken.

Also, looking over the examples in the docs. There’s one with a button where one can be notified about clicks. Wondering if it’s possible to subscribe to other events, like say “mouseover”?

D’oh! I’ll try to fix it, in the mean time it’s also available here.

It is and there are a couple of ways. You can add a javascript callback to any event (see here) and if you want to handle the event in Julia, the easiest is to update a Observable in the WebIO scope, for example here:

    w(
      dom"button"(
        "generate random",
        events=Dict("click"=>@js () -> $obs[] = Math.random()),
      ),
    )

you could then add a listener to obs as a Julia observer.

Otherwise, if you’re binding the javascript variables using Knockout, you could also pass the data-bind attribute. For example use attributes = Dict("data-bind" => "event: { mouseover: mycallback"}) where mycallback is you javascript method. This option I think is only worth it if you’re already working in a Knockout scope and you want the callback to interact with the Knockout observables.

1 Like

That looks really cool. @essenciary I just want to say that as an end user, I’d be very happy if Genie integrated with the webio/interact stack. It would make life easier for me as a user/casual developer to have less stuff to learn because it ameliorates the two language web problem and there is the ecosystem commonality.

And that’s beside the potential benefits for easing maintenance burden and boosting community interop/innovation/widget diversity.

I love that feature from RStudio. What’s missing with shinyapps.io is an easy and inexpensive way to host it on your domain!

I was a heavy Shiny user and I created one of the first popular Shiny extensions in shinysky. This is my 2 cents, we definitely a low-level layer that doesn’t assume any framework or UI components. Shiny was based on jQuery and Bootstrap, but that made extending shiny much harder. On the other hand, we need high level contructs that wraps some library to get started. So if shiny was broken up into a low-level Shiny that you can use any framework with and a ShinyBootstrapjQuery then it would be fine. Julia shouldn’t make the same mistakes.

Thanks for the feedback. It’s something that I spent a lot of time thinking about lately.

Architecture wise it seems to me that the best approach would be web components. It’s a mature technology that now has been embraced by all browser vendors - and it doesn’t lock the user into any framework. A web component is a complex UI element which encapsulates all the functionality and which looks like a regular HTML element: a tag with attributes. This would allow users to a) use any of the existing components; b) build and distribute their own; c) write framework agnostic code which can be coupled with any frontend framework.

Then there’s, of course, the issue of coupling these, auto-magically, with the Julia backend, for 2-way communication, managing state, etc.

Re shinyapps.io - yes, 300/mo for your own domain is a bit expensive. I guess their reasoning is that you only need that once your app is ready to make money.

1 Like

Web components sound good but a bit vague to me. In the case of Polymer, is your idea now still version 2, or rather version 3, or even LitElement and Material Web Components, or something different than Polymer?

https://www.polymer-project.org/

Short term objectives are

  1. support all Predix-UI components
  2. Interact.jl support
  3. support for WebIO
5 Likes

Is there anywhere to go and look at the current state of this? Sounds like a potentially really important project.

1 Like

At the moment the project lives mostly in my head. I’m working on design and architecture plus early experiments. The plan is to get a working prototype by June to present at JuliaCon.

15 Likes

Hi @essenciary ! Is there any update on this? Thanks!

@Diego_Javier_Zea Nothing to show yet, I’m afraid. ATM the focus is on getting Genie to v1 (which should happen in a few weeks) to have a stable foundation. Once that’s done, the focus will be on applications. There are a few projects in the pipeline, including “Shiny for Julia”, GenieCloud (for deploying web apps), and a static website generator.

8 Likes

Concerning a static-site generator: are you aware of JuDoc?

3 Likes

I’m New to Julia, Compiler Design is well planned and Advanced. last one month i have search Package in Hybrid-App for high-performance numerical analysis and computational science. We Need,

  1. Best Interaction of Input from HTML
    Interact Widget & WebIO it’s fantastic, but missing filepicker and not fully customizable
    Knockout used for well Data-binder

  2. Easy to link with Core
    Julia

  3. Best Visualization
    Interact with PlotlyJS is really better performance. but we need more output display other than graphs

  4. Support High-Level MVC
    Genie.jl is a high level Web-framework but missing Interact like works.

    When we Combine these all goodness. Really We will develop --“Full stack Research/Academic/Industrial App Development with Julia”

Thanks for @essenciary @piever and web-stack developers in Julia.

is any updates or suggestion? Most Welcomes :slightly_smiling_face:

Actively working on Stipple, an interactive/reactive UI layer on top of Genie. Here is more info:

Milestone for MVP/beta is JuliaCon - hopefully we’ll have a chance to release it there!

12 Likes