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

[python] open stdout localhost links in terminal in Viewer #2612

Closed
wants to merge 4 commits into from

Conversation

isabelizimm
Copy link
Contributor

@isabelizimm isabelizimm commented Apr 2, 2024

Intent

Describe briefly what problem this pull request resolves, or what new feature it introduces. Include screenshots of any new or altered UI. Link to any GitHub issues that are related.

addresses #1302

Approach

Describe the approach taken and the tradeoffs involved if non-obvious; add an overview of the solution if it's complicated.

right now it is super twitchy, and links will pop up in viewer multiple times (whenever cursor nears link). The actual opening of the link might have to move out of provideTerminalLinks, or at least do some handling to not open so aggressively.

QA Notes

Add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the linked issues.

small apps you can try:

  1. pip install vetiver

create a file:

from vetiver import VetiverModel, VetiverAPI, mock

x, y = mock.get_mock_data()
m = mock.get_mock_model().fit(x, y)
v = VetiverModel(m, "my_model")

VetiverAPI(v).run()

and then click the Play button to "Run Python file in terminal"

  1. pip install shiny

create a file:

from shiny import ui, render, App

app_ui = ui.page_fluid(
    ui.input_slider("slider", "Slider", 0, 100, 50),  
    ui.output_text_verbatim("value"),
)

def server(input, output, session):
    @render.text
    def value():
        return f"{input.slider()}"

app = App(app_ui, server)

and then type shiny run filename.py

@isabelizimm isabelizimm changed the title open viewer on terminal links [python] open stdout localhost links in terminal in Viewer Apr 2, 2024
@isabelizimm isabelizimm requested a review from seeM April 5, 2024 13:27
@isabelizimm isabelizimm marked this pull request as ready for review April 5, 2024 14:52
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

Successfully merging this pull request may close these issues.

1 participant