Skip to content

Commit 4639f09

Browse files
committed
更新 README
1 parent e0c038f commit 4639f09

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Function-plot accepts configuration options via a JavaScript object. Function-Pl
1212

1313
Tools like GeoGebra and Desmos offer more powerful plotting capabilities, additional assistive features, and support for exporting to various image formats. If you're looking for a drawing tool primarily for teaching or learning purposes, they are likely better suited for your needs.
1414

15-
However, GeoGebra and Desmos are not open-source, meaning you can't host them yourself. To embed their graphs in your webpage, you have to use the `iframe` they provide. Relying on external services can introduce higher maintenance costs and potential reliability issues. As an alternative, using function-plot-GUI for configuration and the function-plot library for rendering offers a solid self-hosted solution. Config files can be written in plain-text formats like JSON, JSON5, or YAML, and you can even define custom syntax for rendering directly in Markdown files. The documentation site [LinhoNotes](https://notes.linho.cc/) adopts this approach.
15+
GeoGebra provides comprehensive deployment options and APIs, but setting it up and integrating it into a web service can be quite complex. Desmos is not open-source, which means you cannot self-host it. If you want to embed its graphs in your own site, you're limited to using the iframe they provide. Relying on external services can introduce additional maintenance overhead and potential instability. Therefore, using Function-Plot-GUI for editing and the function-plot library for rendering is a solid alternative. Configuration files can be written in plain text formats like JSON, JSON5, or YAMLand even embedded directly into Markdown files using custom syntax. The documentation site [LinhoNotes](https://notes.linho.cc/) adopts this approach.
1616

1717
## Integrating with Your Application
1818

@@ -22,6 +22,7 @@ For example, given the following function-plot configuration:
2222

2323
```js
2424
functionPlot({
25+
target: "example",
2526
data: [
2627
{
2728
fn: "x^2-1",
@@ -30,7 +31,7 @@ functionPlot({
3031
});
3132
```
3233

33-
Convert the options to JSON or JSON5:
34+
Convert the options to JSON or JSON5, excluding the `target` field:
3435

3536
```json
3637
{"data":[{"fn":"x^2-1"}]}

README_zh-CN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Function-plot 通过一个 JS 对象传入选项。Function-plot-GUI 提供了
1212

1313
GeoGebra/Desmos 等工具拥有更强大的绘制能力、更多的辅助功能,并且支持导出为多样的图像格式。如果你只是需要一个教学用的绘图工具,它们是更好的选择。
1414

15-
但是 GeoGebra Desmos 不是开源的,这意味着你无法自行部署如果要将图像嵌入你的网页,只能用他们提供的 `iframe`。依赖外部服务会带来更多的维护成本和不可靠性。因此,使用 function-plot-GUI 编辑、使用 function-plot 库绘制是一个不错的选择。并且配置文件可以以 JSON/JSON5/YAML 等纯文本格式书写,甚至还能通过定义一些私有语法直接放在 Markdown 文件中渲染。文档仓库 [LinhoNotes](https://notes.linho.cc/) 便采用此路线。
15+
GeoGebra 提供完善的部署方案与 API,但部署和集成到 Web 服务中相当复杂。Desmos 不是开源的,这意味着你无法自行部署如果要将图像嵌入你的网页,只能用他们提供的 `iframe`。依赖外部服务会带来更多的维护成本和不可靠性。因此,使用 function-plot-GUI 编辑、使用 function-plot 库绘制是一个不错的选择。并且配置文件可以以 JSON/JSON5/YAML 等纯文本格式书写,甚至还能通过定义一些私有语法直接放在 Markdown 文件中渲染。文档仓库 [LinhoNotes](https://notes.linho.cc/) 便采用此路线。
1616

1717
## 接入你的应用
1818

@@ -22,6 +22,7 @@ Function-plot-GUI 支持通过 base64 编码的 URL 参数传入数据。
2222

2323
```js
2424
functionPlot({
25+
target: "example",
2526
data: [
2627
{
2728
fn: "x^2-1",
@@ -30,7 +31,7 @@ functionPlot({
3031
});
3132
```
3233

33-
将选项转换为 JSON 或 JSON5:
34+
将选项转换为 JSON 或 JSON5,忽略 `target` 字段
3435

3536
```json
3637
{"data":[{"fn":"x^2-1"}]}

0 commit comments

Comments
 (0)