-
Notifications
You must be signed in to change notification settings - Fork 106
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
Traces for Mesh3d, Image, ScatterMapbox #88
Conversation
Thanks for the PR. Yes, as a basic requirement, the code would need to be Adding the remaining setters, along with tests would be necessary, and then crediting yourself in the changelog would be essential. I agree, there is a lot of code duplication, but I haven't figured out a good way of resolving that at present... |
May I ask what is the reason for using traits so much? For example
instead of just
or even
|
Mostly it was a decision taken before I started contributing, but I think it does make for a clean user API. For let trace = Scatter::new().x0(10_u32);
// or...
let trace = Scatter::new().x0("something"); Without, it would look something like: let trace = Scatter::new().x0(NumOrString::I(10_u32 as i64));
// or...
let trace = Scatter::new().x0(NumOrString::S("something".to_string())); I think the former is much nicer. |
Ah I see, so it is sort of dual to the use of |
Hi, in the latest commit I have sketched a new trait for the |
It is pretty much all done now, except for that part about an |
That's some intense refactoring going on there :-) |
Yes :D sorry it took a while to get around to your PR, as you can see there was a lot of groundwork going on in the meantime.
I'll just put one or two more finishing touches to this PR today and get it merged.
…________________________________
From: Joel Sjögren ***@***.***>
Sent: Wednesday, November 2, 2022 9:07:19 PM
To: igiagkiozis/plotly ***@***.***>
Cc: Michael Freeborn ***@***.***>; Comment ***@***.***>
Subject: Re: [igiagkiozis/plotly] Traces for Mesh3d, Image, ScatterMapbox (PR #88)
That's some intense refactoring going on there :-)
—
Reply to this email directly, view it on GitHub<#88 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHSVKWCKKOAAD7MPM4C2JX3WGLJYPANCNFSM5XNQT4IQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
* Refactor examples and readme (#113) * update main readme * update plotly_kaleido readme * update readme * typo * add readme * Refactor examples and readme * update changelog * fix CI workflow * update workflows * tpyo * formatting * fix workflows * update workflows * update readme * update readme * update url * final tweaks * Remove 'static lifetime requirement for `Plot.to_inline_html()` (#115) * remove 'static lifetime requirement * update changelog * add `legend_group_title` to existing traces (#110) * feat: add legendgrouptitle too all existing traces Fixes #109 * update changelog Co-authored-by: Michael Freeborn <michaelfreeborn1@gmail.com> * Traces for Mesh3d, Image, ScatterMapbox (#88) * Add basic Mesh3D trace functionality * Add basic Image trace functionality * Add basic ScatterMapbox functionality * Fix compilation errors due to merge * Copy some setters * Fill in some more Mesh3D setters * Complete the Mesh3D setters * Complete the Image setters * Sketch idea of ImageData trait * Complete the ScatterMapbox setters * Add tests for Mesh3D * Fix cargo warnings * Make greater use of IntoIterator trait * Add tests for Image * Add tests for ScatterMapbox * Fix compilation errors * Insert _ in setter names * Run rustfmt and add line breaks to documentation * Add jupyter lab examples for Mesh3D, Image, ScatterMapbox * Update CHANGELOG * Remove setter assertions * refactoring * fix tests * formatting * add ImageData trait * add Image trace examples * add mesh3d example * rustfmt * add map example * tweak zoom data type * rustfmt * clippy * update workflows Co-authored-by: Michael Freeborn <michaelfreeborn1@gmail.com> * add plotly_image to features list * v0.8.2 Co-authored-by: Kai Howelmeyer <kai@hoewelmeyer.eu> Co-authored-by: Joel Sjögren <joelsjogren.wii@gmail.com>
Hi, I have implemented some basic wrapping code for go.Mesh3D and go.Image as suggested in #49. I used @mrhrzg's
scatter3d.rs
as a starting point.I am sending this pull request now to get some feedback. Should I do the following things to complete the added features? Anything else?
Just before sending this I decided to also add some mapbox support, as suggested in #86. Specifically I started adding go.Scattermapbox. I am a little confused about
layout.mapbox
andlayout.mapbox_style
which seems to lack a documentation entry, and I have not been able to getlayout.mapbox_style
to work properly. I tried "stamen-watercolor" and "open-street-map" but they seem to have no effect. I guess it should be turned into an enum in the end, but this can't be the problem can it?By the way I am using Evcxr.
Also by the way I think there is a fair bit of code duplication going on with parameters being repeated across different structs. Maybe this could be improved using some kind of rust macro? I guess the most difficult part of this might be to handle the documentation properly.