-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add height param to gr.JSON #9023
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/6f28d395ea709c5efb5e9a99a901774a6ccc1dcd/gradio-4.41.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@6f28d395ea709c5efb5e9a99a901774a6ccc1dcd#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/6f28d395ea709c5efb5e9a99a901774a6ccc1dcd/gradio-client-1.5.0.tgz |
This works well @hannahblair! But I'm wondering if (1) The behavior of ![]() (2) |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
makes perfect sense @abidlabs! thanks for explaining. i've made the changes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @hannahblair! The height
parameter looks good.
One thing I noticed while testing is that the JSON component, when empty, has its icon pinned to the top:
![image](https://private-user-images.githubusercontent.com/1778297/357187335-4cacbd16-8299-46e0-9a23-0ed0928df68a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDczNDAsIm5iZiI6MTczOTM0NzA0MCwicGF0aCI6Ii8xNzc4Mjk3LzM1NzE4NzMzNS00Y2FjYmQxNi04Mjk5LTQ2ZTAtOWEyMy0wZWQwOTI4ZGY2OGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMDc1NzIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTIwZTk4ZTJhZWFlZDNlMmIwZGJhZGQ2ZDVhNDgxOWY0OTIzNGY1MjE2NjBmMjVmMjE3ZDEwYTViNmFhNGVjNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.0a7kCnDXA_UiFl7S4bUiRiyy63-rw3XJ12nePdQ0sBQ)
Unlike the other components, which center the icon vertically:
![image](https://private-user-images.githubusercontent.com/1778297/357187491-0dfd7463-1565-4f38-b60d-1690c112a72e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNDczNDAsIm5iZiI6MTczOTM0NzA0MCwicGF0aCI6Ii8xNzc4Mjk3LzM1NzE4NzQ5MS0wZGZkNzQ2My0xNTY1LTRmMzgtYjYwZC0xNjkwYzExMmE3MmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMDc1NzIwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGQwNTkzZWEyY2E1NjA5OGIxYmQ4MDJhNDdjM2FkZTJiNDY5YjEzMWNkOGUwZTQ0OThmMTM5YmI0OTYyMjU2NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XRkOs6n4mlHrPq2im8XCTgnUTWrCZfvWj2IWZrU0R9c)
Although its not related to this PR, we could perhaps fix it here? Also fine to handle separately
Description
I initially implemented
height
as a param but we have alines
param in gr.Code, so it makes some sense to keep them fairly consistent.I also added the lines param description in gr.Code that was missing, and added a tiny css tweak to handle big line numbers.
Closes: #8982
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh