diff --git a/crates/egui_plot/Cargo.toml b/crates/egui_plot/Cargo.toml index bc42765ea162..06d738955259 100644 --- a/crates/egui_plot/Cargo.toml +++ b/crates/egui_plot/Cargo.toml @@ -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 diff --git a/crates/egui_plot/src/axis.rs b/crates/egui_plot/src/axis.rs index 059349d6673b..018da9144755 100644 --- a/crates/egui_plot/src/axis.rs +++ b/crates/egui_plot/src/axis.rs @@ -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}; diff --git a/crates/egui_plot/src/items/bar.rs b/crates/egui_plot/src/items/bar.rs index 9b86b52ef17b..1e5b7a4c7f30 100644 --- a/crates/egui_plot/src/items/bar.rs +++ b/crates/egui_plot/src/items/bar.rs @@ -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}; diff --git a/crates/egui_plot/src/items/box_elem.rs b/crates/egui_plot/src/items/box_elem.rs index 90755146653b..db0ec07b6a6e 100644 --- a/crates/egui_plot/src/items/box_elem.rs +++ b/crates/egui_plot/src/items/box_elem.rs @@ -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}; diff --git a/crates/egui_plot/src/items/mod.rs b/crates/egui_plot/src/items/mod.rs index 0470d9559650..21509a4dbba9 100644 --- a/crates/egui_plot/src/items/mod.rs +++ b/crates/egui_plot/src/items/mod.rs @@ -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}; diff --git a/crates/egui_plot/src/items/rect_elem.rs b/crates/egui_plot/src/items/rect_elem.rs index b83da7c3dbb9..2f6d924f4e65 100644 --- a/crates/egui_plot/src/items/rect_elem.rs +++ b/crates/egui_plot/src/items/rect_elem.rs @@ -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}; diff --git a/crates/egui_plot/src/items/values.rs b/crates/egui_plot/src/items/values.rs index 6e9bff096b67..ade873bd335b 100644 --- a/crates/egui_plot/src/items/values.rs +++ b/crates/egui_plot/src/items/values.rs @@ -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; diff --git a/crates/egui_plot/src/legend.rs b/crates/egui_plot/src/legend.rs index a3b353e994cf..af3eb65a5bd7 100644 --- a/crates/egui_plot/src/legend.rs +++ b/crates/egui_plot/src/legend.rs @@ -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; diff --git a/crates/egui_plot/src/lib.rs b/crates/egui_plot/src/lib.rs index 164710bef265..01e8e5e4b1a8 100644 --- a/crates/egui_plot/src/lib.rs +++ b/crates/egui_plot/src/lib.rs @@ -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}, diff --git a/crates/egui_plot/src/memory.rs b/crates/egui_plot/src/memory.rs index 6a982269f269..5e6718651440 100644 --- a/crates/egui_plot/src/memory.rs +++ b/crates/egui_plot/src/memory.rs @@ -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}; diff --git a/crates/egui_plot/src/plot_ui.rs b/crates/egui_plot/src/plot_ui.rs index c4a39a6d7287..2ba0b7e70ad7 100644 --- a/crates/egui_plot/src/plot_ui.rs +++ b/crates/egui_plot/src/plot_ui.rs @@ -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. diff --git a/crates/egui_plot/src/transform.rs b/crates/egui_plot/src/transform.rs index 665132519fa1..73160008ec7e 100644 --- a/crates/egui_plot/src/transform.rs +++ b/crates/egui_plot/src/transform.rs @@ -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. ///