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

Trouble creating new visualizer when page is already loaded #208

Open
dhiganthrao opened this issue Apr 28, 2022 · 1 comment
Open

Trouble creating new visualizer when page is already loaded #208

dhiganthrao opened this issue Apr 28, 2022 · 1 comment

Comments

@dhiganthrao
Copy link

Greetings!

First of all, thank you for creating this amazing package for visualization. It's a godsend and very easy to use.

I've just run into a few problems while trying to integrate it into a web page, so I'm opening this issue to get some questions clarified.

A bit of context about what I want to do:
I want to create a webpage (which is connected to a backend through Flask), which lets a user visualize brain tumor data. This webpage initially contains a few Papaya instances (shown below):
image

So now, I want to have a button (in the NavBar), which says "Add new visualizer". On clicking this button, another blank Papaya instance should get created, preferably next to the two Papaya instances already present. So this would also require resizing of the existing Papaya instances to accommodate the third instance (I preferably want to place three instances in one row, on adding a fourth instance, a new row can be created and the fourth instance is placed below the existing three.) However, I can't seem to add a new visualizer without replacing the existing two; the methods I've tried are:

  • Use papaya.Container.startPapaya() when the button is clicked (using the onClick() attribute. This doesn't do anything.
  • Use papaya.Container.addViewer(), with the arguments being the id of the div I want to place the new viewer in. This just replaces the two existing viewers in the div.
  • Create a new div using JavaScript, set that div's classname as Papaya, and append that new div to the existing div. This just throws an error.
    Am I missing something here? I feel the solution is really simple but I'm just not able to figure it out! A little help would be really appreciated!
    Also, once a Papaya viewer has been initialized with a set of params, is it possible to reload this same viewer with a different set of params? (Context: I want to have a button, which uploads files to the Python backend, runs a segmentation algorithm on the uploaded files, and then display the segmented output on a visualizer.)

Thank you so much for reading through this, and please help out at your own time and convenience!

@dhiganthrao
Copy link
Author

Hello, could I kindly receive some help on this issue? Thank you!

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

1 participant