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

Mercury PoC #2

Open
pplonski opened this issue Mar 24, 2023 · 17 comments
Open

Mercury PoC #2

pplonski opened this issue Mar 24, 2023 · 17 comments

Comments

@pplonski
Copy link

Hi @neelmshah,

I've seen that you are using Mercury. I'm the author of the framework. I've recently made a lot of changes to it. I would love to hear your feedback. Do you plan to use Mercury in some projects? What is your use case?

I'm also working on Mercury Cloud service - you will be able setup a secure website with a few clicks and just upload notebooks. Would you like to test it?

@neelmshah
Copy link
Owner

Thanks @pplonski for reaching out! We are assessing whether it meets the project requirements and will consider using it if it does.

As for my use case, we require the integration of an interactive notebook into a web application and whiling embeding certain variables need to be passed as query parameters in the Iframe URL & it should be accessiable notebook.

<iframe src="http://127.0.0.1:8000/app/sample-report/embed?userId=XXX" height="700px" width="1200px"></iframe>

Is this possiable in current version?

Regarding Mercury Cloud service, it sounds like an interesting proposition but due to security compliance, we can't host it on cloud.

@pplonski
Copy link
Author

Sounds like a challenging project!

URL params are not available in the current version of Mercury. I got an issue with this feature mljar/mercury#195. If this will be the only blocker for you, then I will quickly implement this!

You should be able to easily deploy Mercury with docker-compose (docs). If you need any help with Mercury or deployment - I'm happy to help!

@neelmshah
Copy link
Owner

Indeed, this is the only issue blocking us. I would greatly appreciate it if you could prioritize addressing the issue outlined in mljar/mercury#195

@pplonski
Copy link
Author

Sure, I can speed up this one. Will try to deliver it in the next week!

@neelmshah
Copy link
Owner

@pplonski I hope you are doing well. I was wondering if you had any updates on the progress of mljar/mercury#195. I appreciate your efforts on this.

Please let me know if there is anything I can do to help

@pplonski
Copy link
Author

Hi @neelmshah,

Thank you! I hope that you are doing well too! I will implement it today :) Additionally, I would like to add Share button, so you can easily create URL link with values.

I'm planning to add url_key argument to each input widget class. For example:

import mercury as mr
# define text input
name = mr.Text(label="what is your name?", url_key="name")

The URL for app will be:

https://your-server/app/notebook?name=Neel

if you would like to embed it with predefined values:

https://your-server/app/notebook/embed?name=Neel

The exception will be file input widget, it will not have option to set its value in URL.

@pplonski
Copy link
Author

@neelmshah sorry I will not finish this feature today ... I have url_key implemented in widgets. I would like to add automatic notebook re-execution with new values from URL, I will need more time for it. Should be ready tomorrow.

@pplonski
Copy link
Author

Hi @neelmshah,

I've just release version 2.1.3 of mercury package. It has url_key for some widgets. I need to update docs.

You can add params after ?. Example:

https://server/app/my-notebook/embed?key1=123&username=Neel

Please let me know if it works for you.

@neelmshah
Copy link
Owner

neelmshah commented Mar 31, 2023 via email

@neelmshah
Copy link
Owner

neelmshah commented Mar 31, 2023 via email

@pplonski
Copy link
Author

pplonski commented Mar 31, 2023

Hi @neelmshah,

apologize for this, I forgot to add directory when creating a package. It is fixed already. Please install latest version 2.1.7.

You might need to clean database locally between runs. Please run:

# clean database locally
mercury run clear

@neelmshah
Copy link
Owner

neelmshah commented Apr 3, 2023 via email

@pplonski
Copy link
Author

pplonski commented Apr 3, 2023

Hi @neelmshah,

Please take a look at arguments for App in the docs https://runmercury.com/docs/input-widgets/app/ You can hide the sidebar with show_sidebar=False argument. But user will be able to open it and edit parameters ...

I can add disable argument for input widgets, so you can set widgets as disabled (read-only) - what do you think? They will be displayed in the sidebar, but user won't be able to change its values. It will work for you?

All the best!
Piotr

@neelmshah
Copy link
Owner

neelmshah commented Apr 3, 2023 via email

@pplonski
Copy link
Author

pplonski commented Apr 3, 2023

Hi @neelmshah,

I will add hidden and disabled for input widgets mljar/mercury#237

@pplonski
Copy link
Author

pplonski commented Apr 3, 2023

I already implemented it. You can add hidden=True or disabled=True to input widgets. It is available from version 2.1.9. I need to update docs - I hope to do this in a week. Please let me know if it works for you.

@neelmshah
Copy link
Owner

neelmshah commented Apr 3, 2023 via email

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