Skip to content

Conversation

@ES-Alexander
Copy link
Contributor

Fixes #90, per this comment

⚠️ Untested, so it's likely worth checking that it actually works for the main use-cases:

  1. plotting and displaying a new Figure (standard behaviour)
  2. plotting, displaying, and returning a Figure (extended behaviour)
  3. plotting and returning a Figure, with controls.show = False (new behaviour)
  4. inputting a preconfigured Figure (new behaviour)

@fullcontrol-xyz
Copy link
Contributor

Very interesting to see this.

There is an additional use case of no plotting at all - only returning raw data. This is a very useful output so does need to remain, but I understand your statement in the issue #90 that it's bad practice to have conditional return types.

In fact, the fc.transform() function already has multiple return types, but that seems like a logical rule-break since a transformation to gcode or to a visualisation are clearly not going to return the same thing. However, I do see that tranforming to 'plot', and then having a second-condition for the returned object type can get confusing.

It may be best practice to move that functionality out of the 'plot' transform option. It could be a new standalone transform option of 'plot_data'. I mean that the user writes fc.transform(steps, 'plot_data') instead of the current approach of fc.transform(steps, 'plot', fc.GcodeControls(raw_data=True)

What are your thoughts?

Fixes #90, per this comment

⚠️ Untested, so it's likely worth checking that it actually works for the main use-cases:

  1. plotting and displaying a new Figure (standard behaviour)
  2. plotting, displaying, and returning a Figure (extended behaviour)
  3. plotting and returning a Figure, with controls.show = False (new behaviour)
  4. inputting a preconfigured Figure (new behaviour)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Add possibility to get "raw" plotly fig object

2 participants