PAIR-code / what-if-tool

Source code/webpage/demos for the What-If Tool
https://pair-code.github.io/what-if-tool
Apache License 2.0
921 stars 170 forks source link

URL Parameters #192

Open whatevernevermindbro opened 2 years ago

whatevernevermindbro commented 2 years ago

I'd like to share insights from What-If Tool with my mates. It is stated in the readme, that I could use URL parameters for that

"The information can be provided in the settings dialog screen, which pops up automatically upon opening this tool and is accessible through the settings icon button in the top-right of the tool. The information can also be provided directly through URL parameters. Changing the settings through the controls automatically updates the URL so that it can be shared with others for them to view the same data in the What-If Tool",

but I can't find neither the URL parameters in my current URL with WIT tool, nor its description to use it by hand. What else can I do?

jameswex commented 2 years ago

Thanks for reaching out. Unfortunately, we had to remove the capability for WIT to update the URL dynamically due to some incompatibilities with how Tensorboard plugins work. Sorry that the documentation is out of date. Which page includes that information?

If you look in https://github.com/PAIR-code/what-if-tool/blob/master/wit_dashboard/wit-inference-panel.html#L438, we still can parse some WIT settings from the URL on page load. Basically, anything that can be set in the initial settings dialog can be pre-filled-out by URL params. The Polymer properties in that web component, such as examplesPath, modelName, and inferenceAddress using TensorBoard's scheme for specifying plugin-specific url params. This scheme means any URL params prefixed with p.whatif. will be sent to the WIT plugin.

So [tensorboard address]#whatif&p.whatif.examplesPath=foobar should open to the WIT tab in your TensorBoard instance and set the examples path text field to foobar.

whatevernevermindbro commented 2 years ago

@jameswex , Thank you for the reply!

It worked and now I can share WIT tool with predefined settings. However, p.whatif.modelName did not worked and I used p.whatif.modelName1 instead. The same crutch helped with p.whatif.inferenceAdress. Otherwise, a parameter remains empty.