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

Attach new data to the previously created report #75

Closed
Sravanthi-Gogadi opened this issue Feb 4, 2021 · 1 comment
Closed

Attach new data to the previously created report #75

Sravanthi-Gogadi opened this issue Feb 4, 2021 · 1 comment

Comments

@Sravanthi-Gogadi
Copy link

Hello,

I have a function that creates a report dynamically when the if the condition is satisfied, now in the else I have written a code which has to attach to the previous report. Is there a way to do that?

@mands
Copy link
Member

mands commented Feb 8, 2021

One solution would be to regenerate/overwrite the report with the both the old and the new content. However we're looking at adding an append mode so you can append additional graphs/plots to an existing published report, e.g. report.publish(name="my report", update_mode="append") - this would update the existing report "my report" with the additional plots/graphs/text/etc. - would that solve your use-case?

If you want to modify within the same script instance, you can modify your report object as much as needed until you publish it, i.e.

def func_a() -> List[Blocks]:
   return [dp.Plot(a), dp.Plot(b)]

def func_b() -> List[Blocks]:
   return [dp.Plot(c), dp.Table(df)

blocks = func_a() + func_b()
r = Report(blocks=blocks).publish(...)

or you can use the dp.Group functionality to collect together blocks rather than storing in a list. We also plan on adding some additional helper functions here to make it easier to modify an existing report object, e.g. add blocks, pages, etc., before publishing.

@mands mands closed this as completed Feb 8, 2021
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

2 participants