Skip to content

[WIP] Animation documentation #527

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

Merged
merged 4 commits into from
Sep 20, 2016
Merged

Conversation

rreusser
Copy link
Contributor

@rreusser rreusser commented Sep 15, 2016

This PR adds documentation for animations. Things that remain to be done:

  • Review docs
  • Fix some minor issues related to animations and reflect the changes in the docs.
  • find a home for animation attributes. The options are documented in the source, but they don't yet have a home in the web documentation.
  • add additional examples. e.g. Gapminder example. (needs slider implementation, but don't want to block all the docs on that).
  • Upload thumbnail to AWS:

animations

Copy link
Member

@cldougl cldougl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such awesome docs -- thanks so much for adding the markdown option earlier, the text is super important for these examples and you did an amazing job of keeping the text extremely informative while concise as well !!

@@ -0,0 +1,72 @@
---
name: Animating many frames quickly
Copy link
Member

@cldougl cldougl Sep 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rreusser the name serves as the title of the example so I would recommend capitalizing like: Animating Many Frames Quickly

@@ -0,0 +1,44 @@
---
name: Animating sequences of frames
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalize title

title: JavaScript Graphing Library Animations | Examples | Plotly
name: Animations
permalink: javascript/animations/
description: How to animate charts in JavaScript with the animate API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To stay consistent with the other docs you can set the description to: How to animate D3.js-based line and scatter plots in JavaScript.

Copy link
Contributor Author

@rreusser rreusser Sep 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do. The only reason I didn't is that it's not limited to scatter traces or D3-based traces. See: https://rreusser.github.io/animation-experiments/#3d (the timing is not great at the moment; needs a patch)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! How about: How to animate Plotly graphs in JavaScript.

language: plotly_js
page_type: example_index
has_thumbnail: true
display_as: basic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this would fit better under the chart_events category: https://plot.ly/javascript/#chart-events (https://github.com/plotly/documentation/blob/source-design-merge/_includes/documentation_eg.html#L9)?
If you do move it to chart_events rather than basic, I would change the order to #1 (get this front and center :) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go with chart_events and order: 0.5 (could readjust to integers, but… why? 😄 )

@@ -0,0 +1,38 @@
---
name: Object constancy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalize

@@ -0,0 +1,94 @@
---
name: Frame groups and animation modes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capitalize

@@ -0,0 +1,94 @@
---
name: Frame groups and animation modes
plot_url: http://codepen.io/plotly/embed/rrZRmA/?height=500&theme-id=15263&default-tab=result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 I love this example so much-- this is one of the coolest thing I've ever seen plotly do!!!!!!!!!!!!!


The first row of buttons animates a different set of predefined frames by changing the second argument of `Plotly.animate`. Passing `null` animates all defined frames in sequence, while passing an array of strings (here, the frames in reverse) animates a specific sequence of frames. By passing a plain string (here, `lower` or `upper`), it filters the animated frames to those with a `group` property equal to that name.

The second row of buttons chnages the animation `mode`. The mode defines whether an animation either interrupts or follows the current animation. `immediate` mode discards all queued frames and begins a new sequence immediately. The `next` mode is very similar but doesn't begin the new animation until the *end* of the current frame. Finally, `afterall` queues the new frames so that the new animation begins only after all previous animations have completed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chnages

changes

sitemap: false
arrangement: horizontal
markdown_content: |
The animate command lets you add dynamic behavior to Plotly graphs in a number of different ways. At its core, `Plotly.animate` transitions traces to a new state or sequence of states. Therefore to animate a trace, *you must first plot the trace you wish to animate*.
Copy link
Member

@cldougl cldougl Sep 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably also mention: At the moment, you can only animate scatter traces. & you can link to the line & scatter doc to show scatter traces include line & filled line plots

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, slight subtlety. You can only smoothly transition scatter traces, but you can animate anything. If it doesn't know how to interpolate smoothly, it will just update instantaneously.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok cool! In that case I think it's good to leave as is for now and if questions/confusion come up we can add info accordingly!

@@ -0,0 +1,55 @@
---
name: Defing named frames with <code>Plotly.addFrames</code>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be Defining?

@cldougl
Copy link
Member

cldougl commented Sep 16, 2016

@rreusser I'm good for you to 💃 💃 this after taking a look at my comments (mostly tiny typos/grammar things) and adding the thumbnail.
(and as I mentioned earlier, it's totally fine to merge then add additional examples or edit existing examples later :) )

@rreusser rreusser merged commit 18f7780 into source-design-merge Sep 20, 2016
@rreusser rreusser deleted the animation-documentation branch September 20, 2016 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants