gradio/js
aliabid94 e1874aff81
Add gr.on listener method (#5639)
* changes

* changes

* changes

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-09-25 15:25:16 -07:00
..
_cdn-test chore(deps): update dependency iframe-resizer to v4.3.7 (#5562) 2023-09-14 12:21:47 -07:00
_spaces-test Refactor component directories (#5074) 2023-08-03 23:01:18 +01:00
_website Fix small issues in docs and guides (#5669) 2023-09-25 13:42:32 -07:00
accordion Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
annotatedimage Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
app Add gr.on listener method (#5639) 2023-09-25 15:25:16 -07:00
atoms chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
audio chore: update versions (#5578) 2023-09-18 20:54:50 -07:00
box chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
button Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
chatbot chore(deps): update dependency @types/prismjs to v1.26.1 (#5671) 2023-09-25 15:04:20 -07:00
checkbox Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
checkboxgroup Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
code Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
colorpicker chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
column Refactor component directories (#5074) 2023-08-03 23:01:18 +01:00
dataframe Fix width and height issues that would cut off content in gr.DataFrame (#5616) 2023-09-25 10:33:19 -07:00
dropdown Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
file chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
form chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
gallery Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
group Refactor component directories (#5074) 2023-08-03 23:01:18 +01:00
highlightedtext Ensure HighlightedText with merge_elements loads without a value (#5602) 2023-09-19 17:36:05 +01:00
html chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
icons chore: update versions (#5361) 2023-09-01 17:27:32 -07:00
image Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
json Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
label Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
lite chore: update versions (#5177) 2023-08-23 15:41:08 -07:00
markdown chore(deps): update dependency @types/prismjs to v1.26.1 (#5671) 2023-09-25 15:04:20 -07:00
model3D chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
number Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
plot Improve plot rendering (#5642) 2023-09-22 15:32:49 +00:00
radio Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
row remove index files and update test paths (#5262) 2023-08-18 16:33:07 +01:00
slider Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
state Refactor component directories (#5074) 2023-08-03 23:01:18 +01:00
statustracker chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
storybook ensure login form has correct styles (#5324) 2023-08-24 16:42:28 +01:00
tabitem Attach elem_classes selectors to layout elements, and an id to the Tab button (for targeting via CSS/JS) (#5590) 2023-09-19 10:34:41 -07:00
tabs Attach elem_classes selectors to layout elements, and an id to the Tab button (for targeting via CSS/JS) (#5590) 2023-09-19 10:34:41 -07:00
textbox Pause autoscrolling if a user scrolls up in a gr.Textbox and resume autoscrolling if they go all the way down (#5652) 2023-09-25 15:03:10 -07:00
theme chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
timeseries chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
tooltip Refactor component directories (#5074) 2023-08-03 23:01:18 +01:00
tootils chore: update versions (#5177) 2023-08-23 15:41:08 -07:00
upload Accessibility Improvements (#5554) 2023-09-22 14:12:26 +02:00
uploadbutton chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
utils chore: update versions (#5419) 2023-09-07 13:26:14 -07:00
video chore: update versions (#5578) 2023-09-18 20:54:50 -07:00
wasm Upgrade Pyodide to 0.24.0 and install the native orjson package (#5598) 2023-09-19 10:51:37 -07:00
.npmrc
jsx.d.ts
README.md

gradio-ui

This folder contains all of the Gradio UI and component source code.

setup

This folder is managed as 'monorepo' a multi-package repository which make dependency management very simple. In order to do this we use pnpm as our package manager.

Make sure pnpm is installed by following the installation instructions for your system.

You will also need node which you probably already have

running the application

Install all dependencies:

pnpm i

This will install the dependencies for all packages and link any local packages

local development

To develop locally, open two terminal tabs from the root of the repository.

Run the python test server, from the root directory:

cd demo/kitchen_sink
python run.py

This will start a development server on port 7860 that the web app is expecting.

Run the web app:

pnpm dev

building for production

Run the build:

pnpm build

This will create the necessary files in js/app/public and also in gradio/templates/frontend.

quality checks

The repos currently has two quality checks that can be run locally and are run in CI.

formatting

Formatting is handled by prettier to ensure consistent formatting and prevent style-focused conversations. Formatting failures will fails CI and should be reoslve before merging.

To check formatting:

pnpm format:check

If you have formatting failures then you can run the following command to fix them:

pnpm format:write

type checking

We use TypeScript to provide static types to javascript code. These checks are also run in CI.

to typecheck the code:

pnpm ts:check

ci checks

Currently the following checks are run in CI:

static checks

  • Format check (pnpm format:check)
  • Build css (pnpm css)
  • Build client (pnpm build)
  • Type check (pnpm ts:check)
  • Unit tests (pnpm test:run)

functional test

pip install -r demo/outbreak_forecast/requirements.txt
pnpm exec playwright install chromium
pnpm exec playwright install-deps chromium
pnpm test:browser:full