Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: expose a way to create arbitrary element? #66

Closed
gre opened this issue Feb 8, 2023 · 2 comments
Closed

feature request: expose a way to create arbitrary element? #66

gre opened this issue Feb 8, 2023 · 2 comments

Comments

@gre
Copy link

gre commented Feb 8, 2023

I have a trivial need which is to create an element with some attributes on it, outside of scope of the elements provided in this library, and I don't seem to find an API to allow this. Element::new(name) can be created but it doesn't allows to set attributes and the struct Element is private.

Thanks

@gre
Copy link
Author

gre commented Feb 8, 2023

Ok, I've found this way

let mut new_element = Element::new("plotdata");
for attr in attributes {
  new_element.assign(attr.0, attr.1);
}

@gre gre closed this as completed Feb 8, 2023
@abey79
Copy link

abey79 commented Mar 28, 2023

Came here for the same. Great "plotter minds" think alike? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants