-
Notifications
You must be signed in to change notification settings - Fork 629
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 how to develop frontend documentation. #234
Conversation
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.
Don't be mad at me, I'm still your favorite boba friend
docs/how_to_dev_frontend_en.md
Outdated
@@ -0,0 +1,105 @@ | |||
# VisualDL Web App Develop | |||
|
|||
VisualDL has two major components. One is the Python/C++ SDK that logs the matrix during training, |
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.
Are you sure the SDK logs the matrices? If I am not wrong, they record vectors or scalars only
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.
@varunarora matrices is my fancy word for data. I can change if it's inappropriate.
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.
Haha unfortunately, matrices is a very loaded word. When one says "matrices", they are usually implying multidimensional data. Unfortunately, VDL doesn't do anything with multidimensional data today.
docs/how_to_dev_frontend_en.md
Outdated
# VisualDL Web App Develop | ||
|
||
VisualDL has two major components. One is the Python/C++ SDK that logs the matrix during training, | ||
the other is the web-app that display visualized training data. |
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.
Technically, 3 components. Because the webapp is made up of two parts, the server side that serves like an API server to push content and a true "frontend" in JS
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.
You mean the backend server that supplies the data, right?
I kinda combine them in my mind.
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.
Nope, the server side (Flask) does. Frontend = server side + client side. And in our case, the SDK would be considered the "backend", but this is not the best use of the word backend, so we should just continue to use SDK for it.
docs/how_to_dev_frontend_en.md
Outdated
VisualDL has two major components. One is the Python/C++ SDK that logs the matrix during training, | ||
the other is the web-app that display visualized training data. | ||
|
||
The web-app reads the extract data and draw scalars graph or histograms graphs. |
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.
I don't follow reads the extract data and draw...
. I think once you have split the server side from the client side, you will be able to split the function as reads the logs from disk
and visualizes... to a web pages
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.
Also, I think web-app
is just webapp
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.
Yup, I combine the frontend and the backend server into one.
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.
^my typo. its web app. I had thrown in an XML tag |space|, but the markdown parser stripped it out
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.
Yeah i think the logical separation is: the server
+ frontend
together being the frontend, and the rest being the sdk.
docs/how_to_dev_frontend_en.md
Outdated
the other is the web-app that display visualized training data. | ||
|
||
The web-app reads the extract data and draw scalars graph or histograms graphs. | ||
The web-app is where VisualDL transforms the code data into graphs so users can visualize the training progress and make a better network design evaluation. |
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.
code data
?
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.
network design evaluation
? is that a thing?
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.
I will remove code
Don't we use VisualDL to evaluate the Neural Network?
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.
So here the word "graph" is the tricky one. For many people, the first thing that might come to their mind is the computation graph and not the 2-D graph, as you intend to use it. That is why, to remove ambiguity, they use "scalar" plotting / graphing. You also would need to use that.
And I think "network architecture" is a more unambiguous term than "network design" - even though in all fairness you are right and I get what you are trying to say.
docs/how_to_dev_frontend_en.md
Outdated
## Web App Overview | ||
The VisualDL web-app home page is constructed by three major Javascript files | ||
1. manifest.js: The manifest configures basic settings | ||
1. vendor.js: The vendor.js stores all the 3rd party libraries. |
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.
Where are the manifest
and vendor
files? I can't even find them
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.
They are under frontend/dist
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.
Na, these are only the built files I think. Unless you are explaining the built stuff - which should come much much later - you probably don't want to talk about these. I don't actually see them in the source repo tree too, because built assets are usually not committed. Tell me if you see something that I don't!
docs/how_to_dev_frontend_en.md
Outdated
|
||
1. Create Development Server | ||
|
||
Once the setup up is complete. You may create a local development server to test new features or bug fixes. |
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.
Wait a second, you haven't described what the setup is. Most importantly, it is npm install
which isn't mentioned anywhere
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.
There is a link to download the npm earlier. I will state that they should follow the installation process as well.
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.
Na, I think I wasn't clear. npm install
installs npm packages locally, not installing npm.
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.
ah sorry, the set up
process here is for how to download the VisualDL code base. and the set up for pre-commit, etc.
docs/how_to_dev_frontend_en.md
Outdated
## Development Flow | ||
The VisualDL is an open source project. Everyone is welcome to contribute to the project. To get start the process, please refer to [Contribute Code](contribute_code_en.md) to set up the environment. | ||
|
||
1. Create Development Server |
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.
More than creating a development server, you are definitely Running the development server
.
Since it is not common to run a dev server for front-end separately from the server-side, you might have to also explicitly explain that as a part of the architecture.
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.
Ah, I see. I will explicitly explain that we are only running the frontend development server.
docs/how_to_dev_frontend_en.md
Outdated
``` | ||
|
||
This means a development server is ready and is accessible at `http://localhost:8999`. Open a browser and navigate to `http://localhost:8999` to access the VisualDL in development mode. | ||
The development server will listen to any change made to the San or Javascript and update the changes in real time. We recommend doing web-app development under this mode to save time and resources. |
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.
San is JavaScript, so either one should be used here.
docs/how_to_dev_frontend_en.md
Outdated
This means a development server is ready and is accessible at `http://localhost:8999`. Open a browser and navigate to `http://localhost:8999` to access the VisualDL in development mode. | ||
The development server will listen to any change made to the San or Javascript and update the changes in real time. We recommend doing web-app development under this mode to save time and resources. | ||
|
||
1. Prepare for Production |
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.
Perhaps these titles could be markdown h3 or h4'ed?
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.
I don't think these are (1) and (2) steps. Build for production happens much later. Should probably happen in a production guide. What would be much nicer for this tutorial to focus on is how to run "the frontend", which is, the client side and server side.
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.
Agree, I will change the format.
docs/how_to_dev_frontend_en.md
Outdated
If there is no error, You may now check-in the modified files. | ||
|
||
**Note:** There is no need to check-in the generated files. | ||
During the production process, the Travis-CI will generate new packaged files and overwrite the previously generated files. Avoid checking in the generated files can keep the repo commit history clean. |
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.
Travis-CI is an assumption; you don't know what CI tool other people are using. I would generally avoid reference to bundling and deployment processes, people have their own preferences.
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.
I will remove the Travis-CI detail.
docs/how_to_dev_frontend_en.md
Outdated
VisualDL has two three components. | ||
1. The Python/C++ SDK that logs the data during training. | ||
1. The single page client side app that visualized training data. | ||
1. The server(powered on Flask) that parses the saved data and delivers to the client side app for display. |
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.
maybe say "parses the logs data", to be consistent with the first point. Also, why are all the numbers "1."?
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.
The server (powered on Flask) that reads the logs data and delivers it to the client side app for displaying graphs (scalars/histograms) and embeddings.
docs/how_to_dev_frontend_en.md
Outdated
1. The single page client side app that visualized training data. | ||
1. The server(powered on Flask) that parses the saved data and delivers to the client side app for display. | ||
|
||
The server provided the needed data and pass to the client side to draw scalars or histograms. The users can visualize the training progress and make a better network architecture evaluation. |
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.
This point "The server provided the needed data and pass to the client side to draw scalars or histograms." is kind of repeat of the previous statement. Can probably remove.
docs/how_to_dev_frontend_en.md
Outdated
|
||
The server provided the needed data and pass to the client side to draw scalars or histograms. The users can visualize the training progress and make a better network architecture evaluation. | ||
|
||
This article will go over the basic web-app architecture and development steps. |
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.
"and development guide."
docs/how_to_dev_frontend_en.md
Outdated
npm reads `package.json` to build different package according to the packaging script. | ||
If you are not familiar with npm, please refer to the [npm documentation](https://docs.npmjs.com/) for more detail. | ||
|
||
Here is a list of the dependencies used in the VisualDL. |
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.
This might be too detailed for a quick start development guide, and also the requirements/versions may change. I think we should remove this section.
docs/how_to_dev_frontend_en.md
Outdated
``` | ||
|
||
## Development Flow | ||
The VisualDL is an open source project. |
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.
Add a new line before this one
docs/how_to_dev_frontend_en.md
Outdated
Everyone is welcome to contribute to the project. | ||
To get start the process, please refer to [Contribute Code](contribute_code_en.md) to set up the environment. | ||
|
||
####Run The Client Side App In Development |
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.
Lets remove this step and add the new steps:
Prerequisite: Python 2.7, pip, npm, cmake
git clone [email protected]:PaddlePaddle/VisualDL.git
cd VisualDL
pip install -r requirements.txt
./scripts/setup_dev_env.sh
./scripts/start_dev_server.sh --logdir=<LOG_DIR>
docs/how_to_dev_frontend_en.md
Outdated
|
||
```bash | ||
# Package all the needed info and update the manifest.js, vendor.js and index.js | ||
npm run release |
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.
The user shouldn't have to do this. The packaging should just be "python setup.py bdist_wheel". Even if the user runs npm run release, they don't know what to do with the release package.
docs/how_to_dev_frontend_en.md
Outdated
|
||
San is a JavaScript component framework that helps the developer to implement web component in MVVM architecture pattern. | ||
|
||
San allows you to define a self-content view model in a .san file and attach view model objects to DOM objects. |
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.
contained?
docs/how_to_dev_frontend_en.md
Outdated
|
||
## ECharts | ||
|
||
To draw the graphs we use ECharts's framework. It can pilot charts and graphs with just a few lines of code. |
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.
We use eCharts javascript library to render our charts and graphs. eCharts is a leading opensource charting library that supports numerous data visualization.
+To learn more about ECharts framework, please visit ECharts.
67f255f
to
a362a6f
Compare
No description provided.