Skip to content

Commit

Permalink
Fix naming and resolver version
Browse files Browse the repository at this point in the history
  • Loading branch information
dorian.pinaud committed Feb 19, 2024
1 parent 7ba0452 commit 66f53d1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[workspace]
resolver = "1"
members = ["plotters-dioxus", "demo"]
1 change: 1 addition & 0 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "demo"
version = "0.1.0"
edition = "2021"
resolver = "1"

[dependencies.plotters-dioxus]
path = "../plotters-dioxus"
Expand Down
4 changes: 2 additions & 2 deletions demo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use plotters_dioxus::{Backend, Plotter};
use plotters_dioxus::{Backend, Plotters};
use plotters::{coord::Shift, prelude::*};

fn main() {
Expand Down Expand Up @@ -43,7 +43,7 @@ fn draw_histogram(drawing_area : DrawingArea<Backend, Shift>) -> () {
}

fn App<'a>(cx: Scope<'a>) -> Element {
render!(Plotter {
render!(Plotters {
size: (400, 400),
on_drawing: draw_histogram,
})
Expand Down
6 changes: 3 additions & 3 deletions plotters-dioxus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = "plotters-dioxus"
version = "0.1.0"
edition = "2021"
license = "MIT"
resolver = "2"
description = "A plotter-rs component for dioxus"
resolver = "1"
description = "A plotters-rs component for dioxus"
readme = "../README.md"
repository = "https://github.com/DorianPinaud/plotters-dioxus"
keywords = ["dioxus", "plotter-rs", "plot", "chart", "drawing"]
keywords = ["dioxus", "plotters-rs", "plot", "chart", "drawing"]
authors = ["Dorian Pinaud [email protected]"]
categories = ["visualization", "gui"]

Expand Down
2 changes: 1 addition & 1 deletion plotters-dioxus/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod backend;
mod plotter;

pub use plotter::Plotter;
pub use plotter::Plotters;
pub use backend::Backend;
4 changes: 2 additions & 2 deletions plotters-dioxus/src/plotter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use std::rc::Rc;
use crate::backend::Backend;

#[derive(Props)]
pub struct PlotterProps<'a> {
pub struct PlottersProps<'a> {
pub size: (u32, u32),
pub on_drawing: EventHandler<'a, DrawingArea<Backend<'a>, Shift>>,
}

pub fn Plotter<'a>(cx: Scope<'a, PlotterProps<'a>>) -> Element<'a> {
pub fn Plotters<'a>(cx: Scope<'a, PlottersProps<'a>>) -> Element<'a> {
let backend = Rc::new(std::cell::RefCell::new(Backend::new(cx.props.size)));
let drawing_area = DrawingArea::<Backend, Shift>::from(&backend);
cx.props.on_drawing.call(drawing_area);
Expand Down

0 comments on commit 66f53d1

Please sign in to comment.