A browser interface based on Next.js for leaf-playground.
This is a Next.js project bootstrapped with create-next-app
.
- yarn >= 1.22.10
- node >= 18
- Running leaf-playground
First, run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
The Playground is initially configured to use the address http://127.0.0.1:8000
. If you wish to change this, you can do so by setting a new address through the PLAYGROUND_SERVER_BASE_URL
environment variable.
To develop customized visualization components for specific scenes, follow these unified steps:
- Create Component:
- Develop your custom scene visualization component in the
src/app/processing/components/specialized
directory. - Ensure the component's props extend from
DefaultProcessingVisualizationComponentProps
.
- Register Component:
- Register your component within the
getProcessingVisualizationComponent
function located insrc/app/processing/[taskId]/page.tsx
. - This is achieved by adding a case statement for your scene's name.
To display custom scene result components in the Report section of the result page, follow these unified steps:
- Define Component:
- Define your component as either a
ResultReportFunctionComponent
or aResultReportClassComponent
, depending on your implementation approach. - It's recommended to store these custom components in the
src/app/result/components/specialized
directory.
- Register Component:
- Register your component within the
getSpecializedReportComponents
function found insrc/app/result/[taskId]/page.tsx
. - Ensure the registration occurs after the validation process by
checkMetrics
.
This project includes the following environment variables:
-
PLAYGROUND_SERVER_BASE_URL
: Defines the Playground Server's URL, with a default setting of http://127.0.0.1:8000 -
WEB_UI_EXTERNAL_URL
: This represents the external URL where the WebUI is accessible post-deployment, initially set as undefined. This URL is particularly used in creating links for human agents.
To make a production-ready bundle, run the following command:
yarn bundle
This will create a bundle
directory with the bundled files.
To learn more about this project, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Ant Design - An enterprise-class UI design language and React UI library.
- antd-style - A business-level
css-in-js
solution built on the Ant Design V5 Token System. - Formily - Dynamic Form Solution
- Emotion - The Next Generation of CSS-in-JS
- zustand - 🐻 Bear necessities for state management in React