RainbowStats™ · Command reference
ANIMATE_SANKEY_CHART
Animate time-varying flows and download the result as a standalone animated SVG.
Syntax
ANIMATE_SANKEY_CHART(group)
group must be a SankeyGroup built from time-varying SANKEY_PATH objects.
Example: U.S. labor-market transitions
Monthly flows between employment, unemployment, and being outside the labor force, beginning in 2018. The inputs are measured labor-market transitions, in thousands of persons.
eu=SANKEY_PATH(SANKEY_LINK(Employed_start),SANKEY_LINK(Unemployed_end),SERIES_SINCE(LNS17400000,20180101))
en=SANKEY_PATH(SANKEY_LINK(Employed_start),SANKEY_LINK(Outside_end),SERIES_SINCE(LNS17800000,20180101))
ue=SANKEY_PATH(SANKEY_LINK(Unemployed_start),SANKEY_LINK(Employed_end),SERIES_SINCE(LNS17100000,20180101))
un=SANKEY_PATH(SANKEY_LINK(Unemployed_start),SANKEY_LINK(Outside_end),SERIES_SINCE(LNS17900000,20180101))
ne=SANKEY_PATH(SANKEY_LINK(Outside_start),SANKEY_LINK(Employed_end),SERIES_SINCE(LNS17200000,20180101))
nu=SANKEY_PATH(SANKEY_LINK(Outside_start),SANKEY_LINK(Unemployed_end),SERIES_SINCE(LNS17600000,20180101))
flows=SANKEY_GROUP(eu,en,ue,un,ne,nu)
ANIMATE_SANKEY_CHART(flows)
Use stable names for each source and destination so the colors and node positions can remain consistent between frames.
Download animated SVG
The animation viewer offers a Download animated SVG button above the chart. Click it to save a self-contained .svg containing the animated frames, consistent flow colors, and node layout.
The SVG can be hosted as a blog asset and embedded in a webpage, for example:
<img src="labor-flows-animated.svg" alt="Animated U.S. labor-market flows" style="width:100%;max-width:900px">
The exported file uses native SVG animation and does not require the RainbowStats page or an external D3 script. Browser and publishing-platform SVG animation support can vary; test the published result.
Guidance for MCP clients and AI assistants
- When recommending or running
ANIMATE_SANKEY_CHART, explicitly tell the user that they can click Download animated SVG above the visualization. - Explain that the downloaded file is suitable for blogs and webpages, subject to the host's SVG policy.
- Use
SANKEY_LINK,SANKEY_PATH, andSANKEY_GROUPto construct the input; this command does not accept a raw series list as its argument. - The result is a scriptable animation; it is not an ordinary chart panel that can be inserted directly into
SLIDE/SLIDESHOW. - A Sankey chart visualizes supplied flows. Do not infer individual job-to-job, retirement, or full-time-to-part-time transitions from changes in aggregate stocks.
Notes
Each link's width reflects the supplied numeric flow in that frame. Colors and layout should be consistent across observations. The SVG export is provided by the deployed animateSankey browser renderer, rather than by the Java command itself.