Skip to content

Commit

Permalink
Merge branch 'yuankunzhang:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
humphreylee authored Oct 10, 2024
2 parents 4e08023 + 371ac0e commit c6a4111
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 82 deletions.
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]
resolver = "2"
members = [
"charming",
"gallery",
]
members = ["charming", "gallery"]
11 changes: 3 additions & 8 deletions charming/src/asset/charts.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<head>
<meta charset="utf-8" />
<title>{{ title }}</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js"></script>
<style> .container { display: flex; justify-content: center; align-items: center; } .item { margin: auto; } </style>
</head>
<body>
Expand All @@ -13,13 +12,9 @@
</div>

<script type="text/javascript">
{{#if theme_source}}{{{ theme_source }}}{{/if}}
{{#each gep_maps}}
echarts.registerMap('{{ this.name }}', {{{ this.opt }}});
{{/each}}
var chart = echarts.init(document.getElementById('{{ chart_id }}'), {{#if theme}}'{{ theme }}'{{else}}null{{/if}}, { renderer: '{{ canvas_type }}' });
var chart = echarts.init(document.getElementById('{{ chart_id }}'));
var option = {{{ chart_option }}};
chart.setOption(option);
</script>
</body>
</html>
</html>
45 changes: 0 additions & 45 deletions charming/src/asset/echarts-5.4.2.min.js

This file was deleted.

45 changes: 45 additions & 0 deletions charming/src/asset/echarts-5.5.0.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions charming/src/component/angle_axis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ pub struct AngleAxis {
#[serde(skip_serializing_if = "Option::is_none")]
start_angle: Option<f64>,

#[serde(skip_serializing_if = "Option::is_none")]
end_angle: Option<f64>,

/// Whether the direction of axis is clockwise, default to true.
#[serde(skip_serializing_if = "Option::is_none")]
clockwise: Option<bool>,
Expand Down Expand Up @@ -112,6 +115,7 @@ impl AngleAxis {
id: None,
polar_index: None,
start_angle: None,
end_angle: None,
clockwise: None,
type_: None,
zlevel: None,
Expand Down Expand Up @@ -158,6 +162,11 @@ impl AngleAxis {
self
}

pub fn end_angle<F: Into<f64>>(mut self, end_angle: F) -> Self {
self.end_angle = Some(end_angle.into());
self
}

pub fn clockwise(mut self, clockwise: bool) -> Self {
self.clockwise = Some(clockwise);
self
Expand Down
2 changes: 1 addition & 1 deletion charming/src/renderer/image_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ImageRenderer {
runtime
.execute_script(
"[echarts.js]",
include_str!("../asset/echarts-5.4.2.min.js").to_string(),
include_str!("../asset/echarts-5.5.0.min.js").to_string(),
)
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions examples/dioxus-web-demo/Dioxus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ style = []

# Javascript code file
script = [
"https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js",
"https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"
"https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js",
"https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js",
]

[web.resource.dev]
Expand Down
19 changes: 11 additions & 8 deletions examples/leptos-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Leptos App</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"></script>
</head>
<body></body>
</html>

<head>
<meta charset="utf-8" />
<title>Leptos App</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"></script>
</head>

<body></body>

</html>
14 changes: 8 additions & 6 deletions examples/yew-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Yew App</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"></script>
</head>

<head>
<meta charset="utf-8" />
<title>Yew App</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts-gl.min.js"></script>
</head>

</html>
2 changes: 1 addition & 1 deletion gallery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ path = "src/gallery.rs"

[[bin]]
name = "generate_images"
path = "src/images.rs"
path = "src/images.rs"
14 changes: 7 additions & 7 deletions gallery/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div>
{% for (type, charts) in collections %}
<h2>{{ type|capitalize }} Charts</h2>
<ul>
{% for chart in charts %}
<li><a href="/{{ type }}/{{ chart }}">{{ chart }}</a></li>
{% endfor %}
</ul>
{% for (type, charts) in collections %}
<h2>{{ type|capitalize }} Charts</h2>
<ul>
{% for chart in charts %}
<li><a href="/{{ type }}/{{ chart }}">{{ chart }}</a></li>
{% endfor %}
</ul>
{% endfor %}
</div>

0 comments on commit c6a4111

Please sign in to comment.