-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Docs update #403
Merged
Merged
Docs update #403
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,19 +42,19 @@ $ mkdir templates | |
```python | ||
import random | ||
from pyecharts import Scatter3D | ||
from pyecharts.constants import DEFAULT_HOST | ||
from flask import Flask, render_template | ||
|
||
|
||
app = Flask(__name__) | ||
|
||
REMOTE_HOST = "https://pyecharts.github.io/assets/js" | ||
|
||
@app.route("/") | ||
def hello(): | ||
s3d = scatter3d() | ||
return render_template('pyecharts.html', | ||
myechart=s3d.render_embed(), | ||
host=DEFAULT_HOST, | ||
host=REMOTE_HOST, | ||
script_list=s3d.get_js_dependencies()) | ||
|
||
|
||
|
@@ -75,7 +75,7 @@ def generate_3d_random_point(): | |
``` | ||
`script_list` 是 Page() 类渲染网页所需要依赖的 echarts js 库,依赖的库的数量取决于所要渲染的图形种类。 | ||
|
||
`host` 是 echarts js 库的地址,默认的地址为 http://pyecharts.github.io/jupyter-echarts/echarts 当然,如果你愿意你也可以改变这个地址,先克隆 https://github.com/pyecharts/jupyter-echarts 然后将 `echarts` 文件夹挂载在你自己的服务器上即可。 | ||
`host` 是 echarts js 库的地址,默提供的地址为 https://pyecharts.github.io/assets/js 当然,如果你愿意你也可以改变这个地址,先克隆 https://github.com/pyecharts/assets 然后将 `echarts` 文件夹挂载在你自己的服务器上即可。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 然后将 |
||
|
||
此时 flask-echarts 目录下为 | ||
``` | ||
|
@@ -183,10 +183,10 @@ $ flask run | |
|
||
```python | ||
from pyecharts import Bar | ||
from pyecharts.constants import DEFAULT_HOST | ||
from pyecharts.utils import json_dumps | ||
from flask import Flask, render_template | ||
|
||
REMOTE_HOST = "https://pyecharts.github.io/assets/js" | ||
|
||
app = Flask(__name__) | ||
|
||
|
@@ -196,7 +196,7 @@ def hello(): | |
_bar = bar_chart() | ||
return render_template('pyecharts.html', | ||
chart_id=_bar.chart_id, | ||
host=DEFAULT_HOST, | ||
host=REMOTE_HOST, | ||
my_width="100%", | ||
my_height=600, | ||
my_option=json_dumps(_bar.options), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
然后将 js 文件夹挂载在你自己的服务器上即可