GithubHelp home page GithubHelp logo

Comments (4)

alexcjohnson avatar alexcjohnson commented on July 23, 2024 1

OK great - just wanted to check. Looks like we are indeed all set 🎉

To be honest, I didn't really understand how layout is related to the index_page query, which generates only the basic html of the page.

Yes, that's right, the layout isn't in the index page, but it only gets refreshed during the initial load sequence, via the _dash-layout request.

from dash.jl.

rpkyle avatar rpkyle commented on July 23, 2024

This was resolved by #18, closing.

from dash.jl.

alexcjohnson avatar alexcjohnson commented on July 23, 2024

Does this actually work the same way as in Python? What I mean is, when layout is a function in Python, every time a user requests the app index page, the layout function executes again - so in principle you can use that to refresh a database query or something.

It looks to me as though in the current Julia implementation this function is only evaluated when you start the server. Am I interpreting this correctly?

from dash.jl.

waralex avatar waralex commented on July 23, 2024

@alexcjohnson

layout_data(layout::Component) = layout
layout_data(layout::Function) = layout()
function process_layout(request::HTTP.Request, state::HandlerState)

    return HTTP.Response(
        200,
        ["Content-Type" => "application/json"],
        body = JSON2.write(layout_data(state.app.layout))
    )
end

function layout_data have 2 overloads (methods in Julia terms) - one used if layout is a Component and another if layout is a function.

This is about precessing the layout. To be honest, I didn't really understand how layout is related to the index_page query, which generates only the basic html of the page.

from dash.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.