Fix sunburst/partition hierarchy display and add partition (icicle) example#29
Conversation
Agent-Logs-Url: https://github.com/yihui/gglite/sessions/9e24294a-ef56-41d3-a30b-801c3267d316 Co-authored-by: yihui-bot <264330240+yihui-bot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/yihui/gglite/sessions/9e24294a-ef56-41d3-a30b-801c3267d316 Co-authored-by: yihui-bot <264330240+yihui-bot@users.noreply.github.com>
yihui-bot
left a comment
There was a problem hiding this comment.
the two plots are still wrong (i don't see clear hierarchies in them); for the partition mark, x axis title is Time/Order; where is that from?
Agent-Logs-Url: https://github.com/yihui/gglite/sessions/91e5efa3-806c-4f5a-8552-3b7654cebb12 Co-authored-by: yihui-bot <264330240+yihui-bot@users.noreply.github.com>
Fixed in b886f5c:
|


Summary
Fixes the sunburst mark example which used overly uniform data (all children at the same depth), adds the missing partition (icicle) mark example, and improves both charts to show clear visual hierarchies with name-based labels and colors.
Changes
Sunburst example data improved
The tree data now has varying nesting depths so the sunburst "sun rays" extend to different heights:
Hierarchy display fixed for both marks
color = 'name'encoding so each node gets a distinct color, making the hierarchy visually clearlabelswithtext = 'name'to show node names instead of G2's default numeric value labelsposition = 'left'withdx = 8offset (matching G2's own test examples)mark_partition()upgraded to proper wrapperG2's partition mark has a hardcoded
axis: { x: { title: 'Time/Order' } }default that is confusing for R users. Upgradedmark_partition()from a simple one-line wrapper to a proper function (likemark_sunburst()) that setsaxis = FALSEandlegend = FALSEby default.Partition (icicle) example added
Added a new
## Partition (Icicle) Marksection toexamples/marks.Rmdusing the same tree data, with name labels andoverflowHidetransform.Roxygen updates
mark_sunburst()example to includecolor = 'name'encoding and name labelsmark_partition()example with name-based encoding and labelsOther missing mark examples
Checked all marks defined in
R/mark.Ragainstexamples/marks.Rmd. The remaining marks without Rmd examples are low-level primitives not typically used directly:mark_vector— specialized for wind/flow field visualizationmark_node/mark_edge— graph primitives wrapped bymark_force_graph()mark_box— pre-computed box elements (low-level building block formark_boxplot())mark_shape— custom JS render functionVerification
Screenshots
Sunburst Mark (varying depth, name labels and colors)
Partition (Icicle) Mark (name labels, no Time/Order axis)