Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add more /dashapp/ views? #80

Open
satrio-yudhoatmojo opened this issue Feb 6, 2021 · 3 comments
Open

How to add more /dashapp/ views? #80

satrio-yudhoatmojo opened this issue Feb 6, 2021 · 3 comments

Comments

@satrio-yudhoatmojo
Copy link

Hi, your tutorial is very good! I have a question. Let's say I want to build a view for showing data and it's a different view than the dashboard (/dashapp/) - let's say it goes to /dashapp/summary. How do I do this?

@capihacendado
Copy link

same doubt here

@capihacendado
Copy link

capihacendado commented Feb 10, 2021

Well actually I just did a work around to achieve it, and hopefully if there is a more clean way to do it, just let me know.

What I did is:

  • To create another .py file with another dashboard
  • In your init must import this .py and and use the function just like the example shows you

`

    from .plotydash.dashboard import init_dashboard
    from .plotydash.dashboard2 import init_dashboard as in_2
    app = init_dashboard(app)
    app = in_2(app)

`

  • Also to need to create a link in the jinja2 that point the desired url

if you don't want to create new .py you can create and import another function inside the dashboard.py that create another dashboard.

Hope it helps and if there is a better solution please let it know

@hansendm
Copy link

Do you have to use the jinja2 ? I've never messed with them before. Could you build a cascade of jinja2's, one underneath another? Say for instance you have a bunch of incubators and you want to show the current temperature and humidity but once you click on one of these you would open up your dashboard for that incubator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants