Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… simpler rendering flow
…b-down series renderers
bcf0ae7 to
726079a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: Charts package – shared renderers, unified API, and composition cleanup
Summary
This PR refactors the
@inglorious/chartspackage for clearer structure, less duplication, and a single public entry point for composition mode. It does not change behaviour for existing callers ofchart.render(...)or Config Mode.Main changes
1. Unified composition API
chart.render(entity, params, api)(no publicrenderLineChart,renderAreaChart, etc.).api.render(entityId); the template renderer stays the same.chart.renderLineChart,chart.renderAreaChart,chart.renderBarChart,chart.renderPieChart) are no longer part of the public API. web-charts has been updated to usechart.render.2. Shared cartesian core
cartesian-renderer.js,cartesian-children.js).type: "composed"withseries); web-charts has an example next to the composition version.3. Centralised config and helpers
utils/constants.js; bar/line/area and cartesian children use them instead of hardcoded values.getResolvedEntity(ctx, entity)incartesian-helpers.jscentralisesctx.entity || entity(andctx.fullEntityfor brush); all cartesian, tooltip, brush, legend, and pie renderers use it.resolveDataKeysand key exclusion live indata-utils.jsand are used by all renderers for consistent series inference.4. Chart core and instance API
core/(e.g.chart-core.js,create-chart-instance.js,render-dispatch.js,declarative-children.js). Index was split so the facade stays thin.5. Tests
config: { width, height, padding }shape after rebase.Commits (34)
The work is split into small commits for review; they group roughly as:
core/, clarify naming, simplify method maps, legacy adapter, and instance render inputs.chart.render– remove per-type render from the facade, update web-charts to usechart.render.Checklist
chart.render(...); no publicrenderLineChart/renderAreaChart/renderBarChart/renderPieChart.chart.render(oneObject, api)usage unchanged.