-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Improve frames
support in graph_objs.py.
#656
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
Conversation
@Kully and I hacked in frames support when we were in a rush. This improves how Still working on this one, since I think saying that an entry in a |
851b21a
to
8a3124f
Compare
Can't add |
|
||
def _value_to_graph_object(self, index, value, _raise=True): | ||
if isinstance(value, six.string_types): | ||
return value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a patch to allow a string
in the frames
array.
indent=' ' * indent * (level + 1)) | ||
for index, entry in enumerate(self): | ||
if isinstance(entry, six.string_types): | ||
string += repr(entry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another patch to allow a string in the frames
array. This sorta sucks since it's not possible to super
... but I'm not terribly concerned.
else: | ||
# There are no lists objects which can contain list entries. | ||
items_classes.add('dict') | ||
items_classes = list(items_classes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows us to print dict
in a list's to_string()
return if the item isn't a publicly-available class
.
8a3124f
to
2bb8a58
Compare
'group': {'role': 'info'}, | ||
'layout': {'role': 'object'}, | ||
'name': {'role': 'info'} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately there's not a dedicated doc page since this doesn't currently live on the plot scheme. In lieu of that, the attributes are defined here. @etpinard is there some way I can add these to the plot schema? The way animation config and frame attributes live outside of the rest of plotly is not the best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! That'll do for now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh damn boom!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard , trying to grok datasrc
, that one's a little confusing for me. How do you src
an array of objects?
Also, traces
are meant to be stored in a Grid
? I.e., it's definitely not info
, right? (just to confirm).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh datasrc
shouldn't be in there. Same for tracessrc
.
@etpinard , OK, this would work well from the Python side of things for the
The name Note that |
2bb8a58
to
a750909
Compare
OK, I "updated" the default schema with what I'd like to be in there. Obviously not ready to merge since this isn't a real reflection of the plot-schema, I just figured It'd be helpful. |
a750909
to
61fc0e3
Compare
Oh right, we have a test on the schema anyhow so I can't merge it 😊 |
@theengineear done (I think) in plotly/plotly.js#1292 |
This does the following: * Allow object-or-string in frames array * Refuse `frames` in frame object if nested * Generates a non-public `FramesEntry` graph obj * Tests this functionality
61fc0e3
to
887d839
Compare
graph_reference = utils.decode_unicode(_json.loads(s)) | ||
|
||
# TODO: Patch in frames info until it hits streambed. See #659 | ||
graph_reference['frames'] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just patching in what I'm expecting to see here. This means that we don't need to wait for any changes to land on Plotly prod and can get this into 1.X
now. I'll remove this once that changes.
@Kully, this look OK to you? Mind giving it a review? |
Yeah, will do today. |
@theengineear 💃 Looks like a lot of work you had to do! 😅 |
Yah, the fact that you can have |
Cool, I'm able to play around and make frames and such using the python api lib still. Gonna update changelog and merge. |
This does the following:
frames
in frame object if nesteddata
andlayout
objects tofigure
attribute information.Fixes #604