Skip to content

Commit

Permalink
Import directly from correct crates rather than the reimports
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed May 17, 2024
1 parent 738ea75 commit 68fc6a3
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 23 deletions.
4 changes: 4 additions & 0 deletions crates/egui_plot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ serde = ["dep:serde", "egui/serde"]


[dependencies]
ahash.workspace = true
ecolor.workspace = true
egui = { workspace = true, default-features = false }
emath.workspace = true
epaint.workspace = true


#! ### Optional dependencies
Expand Down
8 changes: 3 additions & 5 deletions crates/egui_plot/src/axis.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::{fmt::Debug, ops::RangeInclusive, sync::Arc};

use egui::{
emath::{remap_clamp, round_to_decimals, Rot2},
epaint::TextShape,
Pos2, Rangef, Rect, Response, Sense, TextStyle, Ui, Vec2, WidgetText,
};
use egui::{Rangef, Response, Sense, TextStyle, Ui, WidgetText};
use emath::{remap_clamp, round_to_decimals, Pos2, Rect, Rot2, Vec2};
use epaint::TextShape;

use super::{transform::PlotTransform, GridMark};

Expand Down
4 changes: 2 additions & 2 deletions crates/egui_plot/src/items/bar.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui::emath::NumExt;
use egui::epaint::{Color32, RectShape, Rounding, Shape, Stroke};
use emath::NumExt;
use epaint::{Color32, RectShape, Rounding, Shape, Stroke};

use super::{add_rulers_and_text, highlighted_color, Orientation, PlotConfig, RectElement};
use crate::{BarChart, Cursor, PlotPoint, PlotTransform};
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_plot/src/items/box_elem.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui::emath::NumExt as _;
use egui::epaint::{Color32, RectShape, Rounding, Shape, Stroke};
use emath::NumExt as _;
use epaint::{Color32, RectShape, Rounding, Shape, Stroke};

use crate::{BoxPlot, Cursor, PlotPoint, PlotTransform};

Expand Down
9 changes: 5 additions & 4 deletions crates/egui_plot/src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

use std::ops::RangeInclusive;

use epaint::{emath::Rot2, Mesh};

use crate::*;
use ecolor::{Color32, Rgba};
use egui::{Id, ImageOptions, NumExt as _, TextStyle, Ui, WidgetText};
use emath::{pos2, vec2, Align2, Float as _, Pos2, Rect, Rot2, Vec2};
use epaint::{Mesh, Rounding, Shape, Stroke, TextureId};

use super::{Cursor, LabelFormatter, PlotBounds, PlotTransform};
use rect_elem::*;
use rect_elem::{highlighted_color, RectElement};

pub use bar::Bar;
pub use box_elem::{BoxElem, BoxSpread};
Expand Down
5 changes: 3 additions & 2 deletions crates/egui_plot/src/items/rect_elem.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use egui::emath::NumExt as _;
use egui::epaint::{Color32, Rgba, Stroke};
use ecolor::{Color32, Rgba};
use emath::NumExt as _;
use epaint::Stroke;

use crate::transform::{PlotBounds, PlotTransform};

Expand Down
3 changes: 2 additions & 1 deletion crates/egui_plot/src/items/values.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::ops::{Bound, RangeBounds, RangeInclusive};

use egui::{Pos2, Shape, Stroke, Vec2};
use emath::{Pos2, Vec2};
use epaint::{Shape, Stroke};

use crate::transform::PlotBounds;

Expand Down
7 changes: 6 additions & 1 deletion crates/egui_plot/src/legend.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use std::{collections::BTreeMap, string::String};

use crate::*;
use ecolor::Color32;
use egui::{
Direction, Frame, Layout, PointerButton, Response, Sense, TextStyle, Ui, Widget, WidgetInfo,
WidgetType,
};
use emath::{pos2, vec2, Align, Rect};

use super::items::PlotItem;

Expand Down
3 changes: 1 addition & 2 deletions crates/egui_plot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ mod transform;

use std::{cmp::Ordering, ops::RangeInclusive, sync::Arc};

use egui::ahash::HashMap;
use ahash::HashMap;
use egui::*;
use emath::Float as _;
use epaint::Hsva;

pub use crate::{
axis::{Axis, AxisHints, HPlacement, Placement, VPlacement},
Expand Down
2 changes: 1 addition & 1 deletion crates/egui_plot/src/memory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;

use egui::{ahash, Context, Id, Pos2, Vec2b};
use egui::{Context, Id, Pos2, Vec2b};

use crate::{PlotBounds, PlotTransform};

Expand Down
8 changes: 7 additions & 1 deletion crates/egui_plot/src/plot_ui.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
use crate::*;
use crate::{
Arrows, BarChart, BoundsModification, BoxPlot, HLine, Line, PlotBounds, PlotImage, PlotItem,
PlotPoint, PlotTransform, Points, Polygon, Text, VLine,
};
use ecolor::{Color32, Hsva};
use egui::{Context, Response};
use emath::{Pos2, Vec2, Vec2b};

/// Provides methods to interact with a plot while building it. It is the single argument of the closure
/// provided to [`Plot::show`]. See [`Plot`] for an example of how to use it.
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_plot/src/transform.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::ops::RangeInclusive;

use super::PlotPoint;
use crate::*;
use super::{Axis, PlotPoint};
use emath::{pos2, remap, Pos2, Rect, Vec2};

/// 2D bounding box of f64 precision.
///
Expand Down

0 comments on commit 68fc6a3

Please sign in to comment.