Skip to content

Conversation

@pearmini
Copy link
Member

@pearmini pearmini commented Mar 29, 2025

related: https://github.com/charming-art/charming/pull/363

links:

Better because:

  • consistent style with other attributes
  • easy to use and implement

@pearmini pearmini requested a review from Copilot March 29, 2025 14:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the rendering logic to support child callbacks, improving consistency with other attributes and simplifying usage.

  • In src/render.js, the patch function now returns only parents and child nodes, with previous nodes being set separately.
  • In src/mark.js, the patch method is refactored to update how child nodes are processed, using a consistent callback style.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/render.js Refactored patch function signature and variable assignment for patches
src/mark.js Refactored children callback handling and return values in patch method
Comments suppressed due to low confidence (1)

src/mark.js:124

  • [nitpick] Consider reviewing the use of '.flat(Infinity)' below: if the depth of children is known, specifying the depth may improve efficiency.
newNodesChildren[i] = (isFunction(children) ? children(datum, i, data) : children)

@pearmini pearmini merged commit beb0158 into next Mar 29, 2025
2 checks passed
@pearmini pearmini deleted the children-callback branch March 29, 2025 14:21
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.

1 participant