Skip to content

Commit

Permalink
docs: update license
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Oct 1, 2024
1 parent e9a6173 commit 9414014
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,6 @@ get_or_try_init_fonts(vec![&buf]));

## 开源协议声明

This project is licensed under the [Apache License 2.0 license].
This project is licensed under the [MPL-2.0 license].

[Apache License 2.0 license]: https://github.com/vicanso/charts-rs/blob/main/LICENSE
[MPL-2.0 license]: https://github.com/vicanso/charts-rs/blob/main/LICENSE
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,6 @@ get_or_try_init_fonts(vec![&buf]));

## License

This project is licensed under the [Apache License 2.0 license].
This project is licensed under the [MPL-2.0 license].

[Apache License 2.0 license]: https://github.com/vicanso/charts-rs/blob/main/LICENSE
[MPL-2.0 license]: https://github.com/vicanso/charts-rs/blob/main/LICENSE
4 changes: 4 additions & 0 deletions src/charts.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

mod bar_chart;
mod candlestick_chart;
mod canvas;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/bar_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/candlestick_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/canvas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::component::{
generate_svg, Arrow, Axis, Bubble, Circle, Component, Grid, Legend, Line, Pie, Polygon,
Polyline, Rect, SmoothLine, SmoothLineFill, StraightLine, StraightLineFill, Text, LEGEND_WIDTH,
Expand Down
4 changes: 4 additions & 0 deletions src/charts/color.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use serde::{Deserialize, Serialize};
use substring::Substring;

Expand Down
4 changes: 4 additions & 0 deletions src/charts/common.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::{Box, Color};
use crate::Point;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 4 additions & 0 deletions src/charts/component.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use serde::{Deserialize, Serialize};
use snafu::{ResultExt, Snafu};
use std::fmt;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/encoder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use image::ImageFormat;
use once_cell::sync::OnceCell;
use resvg::{tiny_skia, usvg};
Expand Down
4 changes: 4 additions & 0 deletions src/charts/font.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::util::*;
use fontdue::layout::{CoordinateSystem, Layout, TextStyle};
use fontdue::Font;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/heatmap_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/horizontal_bar_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/line_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
5 changes: 4 additions & 1 deletion src/charts/multi_chart.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use substring::Substring;
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::component::generate_svg;
Expand All @@ -9,6 +11,7 @@ use super::{
ScatterChart, TableChart,
};
use super::{Box, Color};
use substring::Substring;

pub enum ChildChart {
Bar(BarChart, Option<(f32, f32)>),
Expand Down
8 changes: 5 additions & 3 deletions src/charts/params.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::sync::Arc;
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::{Align, Box, Color, LegendCategory, Series, SeriesCategory, Theme, YAxisConfig};
use crate::{
MarkLine, MarkLineCategory, MarkPoint, MarkPointCategory, Position, Symbol, NIL_VALUE,
};

use super::{Align, Box, Color, LegendCategory, Series, SeriesCategory, Theme, YAxisConfig};
use std::sync::Arc;

/// Gets bool value from serde json.
pub(crate) fn get_bool_from_value(value: &serde_json::Value, key: &str) -> Option<bool> {
Expand Down
4 changes: 4 additions & 0 deletions src/charts/path.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::util::*;
use std::fmt;

Expand Down
5 changes: 4 additions & 1 deletion src/charts/pie_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand All @@ -10,7 +14,6 @@ use crate::charts::measure_text_width_family;
use charts_rs_derive::Chart;
use core::f32;
use std::sync::Arc;
use std::u8;

#[derive(Clone, Debug, Default, Chart)]
pub struct PieChart {
Expand Down
4 changes: 4 additions & 0 deletions src/charts/radar_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/scatter_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/table_chart.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::canvas;
use super::color::*;
use super::common::*;
Expand Down
4 changes: 4 additions & 0 deletions src/charts/theme.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use super::color::Color;
use super::common::Align;
use super::font::DEFAULT_FONT_FAMILY;
Expand Down
12 changes: 7 additions & 5 deletions src/charts/util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

use serde::{Deserialize, Serialize};
use std::fmt;
use substring::Substring;
Expand Down Expand Up @@ -289,12 +293,10 @@ pub fn get_quadrant(cx: f32, cy: f32, point: &Point) -> u8 {
} else {
1
}
} else if point.y > cy {
3
} else {
if point.y > cy {
3
} else {
2
}
2
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

//! Charts support multi charts: bar chart, horizontal bar chart,
//! line chart, pie chart, radar chart and table.
//!
Expand Down

0 comments on commit 9414014

Please sign in to comment.