├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feaure_request.yml ├── PULL_REQUEST_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE │ └── pr_cn.md ├── labeler.yml └── workflows │ ├── bug-server.yml │ ├── hotfix.yml │ ├── label.yml │ ├── pre-release.yml │ ├── release-changelog.yml │ ├── release.yml │ ├── stale.yml │ ├── sync-develop.yml │ └── unit-test.yml ├── .gitignore ├── .lintstagedrc ├── .prettierignore ├── .prettierrc.js ├── .vscode ├── find-unused-exports.json ├── launch.json ├── settings.json └── tasks.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTING.zh-CN.md ├── LICENSE ├── README.ja-JP.md ├── README.md ├── README.zh-CN.md ├── common ├── autoinstallers │ ├── create │ │ ├── README.md │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── src │ │ │ ├── cli.ts │ │ │ ├── create.ts │ │ │ ├── global.d.ts │ │ │ ├── logger.ts │ │ │ └── template.ts │ │ ├── templates │ │ │ └── library │ │ │ │ ├── .eslintrc.js │ │ │ │ ├── README.md │ │ │ │ ├── bundler.config.js │ │ │ │ ├── package.json │ │ │ │ ├── src │ │ │ │ ├── global.d.ts │ │ │ │ └── index.ts │ │ │ │ ├── tsconfig.json │ │ │ │ └── vite │ │ │ │ ├── index.html │ │ │ │ ├── public │ │ │ │ └── vite.svg │ │ │ │ ├── src │ │ │ │ ├── App.css │ │ │ │ ├── App.tsx │ │ │ │ ├── assets │ │ │ │ │ └── react.svg │ │ │ │ ├── index.css │ │ │ │ ├── main.tsx │ │ │ │ └── vite-env.d.ts │ │ │ │ ├── tsconfig.json │ │ │ │ ├── tsconfig.node.json │ │ │ │ └── vite.config.ts │ │ └── tsconfig.json │ ├── lint │ │ ├── change-all.ts │ │ ├── commit-lint.js │ │ ├── commitlint.config.js │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── prettier.ts │ │ └── tsconfig.json │ └── run-script │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── run.ts │ │ ├── start.ts │ │ └── tsconfig.json ├── config │ └── rush │ │ ├── .npmrc │ │ ├── .npmrc-publish │ │ ├── .pnpmfile.cjs │ │ ├── artifactory.json │ │ ├── build-cache.json │ │ ├── command-line.json │ │ ├── common-versions.json │ │ ├── experiments.json │ │ ├── pnpm-config.json │ │ ├── pnpm-lock.yaml │ │ ├── repo-state.json │ │ ├── rush-plugins.json │ │ └── version-policies.json ├── git-hooks │ ├── commit-msg │ ├── pre-commit │ └── pre-push └── scripts │ ├── apply-release-version.js │ ├── get-package-json.js │ ├── install-run-rush-pnpm.js │ ├── install-run-rush.js │ ├── install-run-rushx.js │ ├── install-run.js │ ├── parse-version.js │ ├── pre-release.js │ ├── release.js │ ├── set-json-file.js │ ├── set-prerelease-version.js │ ├── sort_deps.js │ └── version-policies.js ├── docs ├── dev-demos │ ├── .gitignore │ ├── favicon.svg │ ├── index.html │ ├── package.json │ ├── public │ │ └── data │ │ │ ├── basic.csv │ │ │ └── basic.json │ ├── src │ │ ├── api │ │ │ ├── api-test.ts │ │ │ ├── api-usage.ts │ │ │ ├── arrange-animate.ts │ │ │ ├── bar.ts │ │ │ ├── boxplot.ts │ │ │ ├── brush.ts │ │ │ ├── clip-animate.ts │ │ │ ├── contour.ts │ │ │ ├── coordinate-polar.ts │ │ │ ├── data.ts │ │ │ ├── drill-down.ts │ │ │ ├── gauge-animate.ts │ │ │ ├── glyph.ts │ │ │ ├── grammar-rank.ts │ │ │ ├── grid-bar.ts │ │ │ ├── kde-bar.ts │ │ │ ├── large-boxplot.ts │ │ │ ├── layout-data-update.ts │ │ │ ├── legend.ts │ │ │ ├── line-animation.ts │ │ │ ├── line.ts │ │ │ ├── multi-states.ts │ │ │ ├── pie.ts │ │ │ ├── player.ts │ │ │ ├── polar-line.ts │ │ │ ├── rect-animation.ts │ │ │ ├── remove.ts │ │ │ ├── scrollbar-filter.ts │ │ │ ├── scrollbar.ts │ │ │ ├── slider.ts │ │ │ ├── stack.ts │ │ │ ├── state-encode.ts │ │ │ ├── stream.ts │ │ │ ├── text-animate.ts │ │ │ ├── title.ts │ │ │ ├── tooltip.ts │ │ │ ├── update-api.ts │ │ │ ├── use-states.ts │ │ │ ├── violin.ts │ │ │ └── wave-animate.ts │ │ ├── bind-helpers.ts │ │ ├── color-utils.ts │ │ ├── data │ │ │ ├── budgets.json │ │ │ ├── cars.json │ │ │ ├── coffee.json │ │ │ ├── diamond.json │ │ │ ├── disk.json │ │ │ ├── gdp.json │ │ │ ├── hierarchy.json │ │ │ ├── normal-2d.json │ │ │ ├── sankey-energy.json │ │ │ ├── sankey-simple.json │ │ │ ├── simpsons.json │ │ │ ├── unemployment.json │ │ │ ├── wordcloud │ │ │ │ ├── fewData.json │ │ │ │ ├── fewData2.json │ │ │ │ ├── longText.json │ │ │ │ ├── movieData.json │ │ │ │ ├── siteData.json │ │ │ │ ├── siteData2.json │ │ │ │ ├── siteData3.json │ │ │ │ ├── social-media.json │ │ │ │ ├── webData.json │ │ │ │ └── webData2.json │ │ │ ├── world-2.json │ │ │ └── world.json │ │ ├── image │ │ │ ├── shape_bears.png │ │ │ ├── shape_bears2.png │ │ │ ├── shape_dolphin.png │ │ │ ├── shape_logo.png │ │ │ ├── shape_man2.png │ │ │ ├── shape_man4.png │ │ │ ├── shape_moustache.png │ │ │ ├── shape_recycle.png │ │ │ ├── shape_test2.png │ │ │ └── shape_tie.png │ │ ├── indexes.ts │ │ ├── main.ts │ │ ├── plot │ │ │ ├── area.ts │ │ │ ├── bar-race.ts │ │ │ ├── circle-packing.ts │ │ │ ├── interval.ts │ │ │ ├── line.ts │ │ │ ├── polar-interval.ts │ │ │ ├── sankey.ts │ │ │ ├── sunburst.ts │ │ │ ├── tree.ts │ │ │ ├── treemap.ts │ │ │ ├── wordcloud-shape.ts │ │ │ └── wordcloud.ts │ │ ├── specs │ │ │ ├── area-animation.ts │ │ │ ├── area-mark.ts │ │ │ ├── bar-animation.ts │ │ │ ├── bar-chart.ts │ │ │ ├── bidirectional-bar.ts │ │ │ ├── budget-forecasts.ts │ │ │ ├── cell-chart.ts │ │ │ ├── circle-packing-image.ts │ │ │ ├── circle-packing.ts │ │ │ ├── colorful-bar-chart.ts │ │ │ ├── datazoom-bar.ts │ │ │ ├── fish-eye-bubbles.ts │ │ │ ├── geo-path.ts │ │ │ ├── group-bar-chart.ts │ │ │ ├── group-chart.ts │ │ │ ├── group-mark.ts │ │ │ ├── image-mark.ts │ │ │ ├── interval-chart.ts │ │ │ ├── jitter-x-symbols.ts │ │ │ ├── large-bar-chart.ts │ │ │ ├── large-bar-group-encode.ts │ │ │ ├── large-glyph.ts │ │ │ ├── large-group-area-chart.ts │ │ │ ├── large-group-bar-chart.ts │ │ │ ├── large-group-line-chart.ts │ │ │ ├── large-group-symbol-chart.ts │ │ │ ├── large-line-group-encode.ts │ │ │ ├── layout-demo.ts │ │ │ ├── line-chart-overlap.ts │ │ │ ├── line-chart-sampling.ts │ │ │ ├── line-chart-segments.ts │ │ │ ├── line-chart.ts │ │ │ ├── line-mark.ts │ │ │ ├── pie-animation.ts │ │ │ ├── pie-animation3d.ts │ │ │ ├── polygon-mark.ts │ │ │ ├── projections-2.ts │ │ │ ├── projections.ts │ │ │ ├── relation-chart-right.ts │ │ │ ├── relation-chart-top.ts │ │ │ ├── relation-chart.ts │ │ │ ├── roam-filter-bar.ts │ │ │ ├── roam-scale-bar.ts │ │ │ ├── sankey-gap.ts │ │ │ ├── sankey-hierarchy.ts │ │ │ ├── sankey-label.ts │ │ │ ├── sankey-vertical.ts │ │ │ ├── sankey.ts │ │ │ ├── simple-area-chart.ts │ │ │ ├── simple-bar-chart.ts │ │ │ ├── sunburst.ts │ │ │ ├── symbol-chart.ts │ │ │ ├── text.tsx │ │ │ ├── tree.ts │ │ │ ├── treemap-color.ts │ │ │ ├── treemap.ts │ │ │ ├── update-spec.ts │ │ │ ├── venn3.ts │ │ │ ├── venn4.ts │ │ │ ├── wordcloud-fast-3d.ts │ │ │ ├── wordcloud-fast.ts │ │ │ ├── wordcloud-shape-linear-color.ts │ │ │ ├── wordcloud-shape.ts │ │ │ ├── wordcloud.ts │ │ │ └── zoomable-scatter-plot.ts │ │ ├── style.css │ │ └── vite-env.d.ts │ ├── tsconfig.json │ └── vite.config.ts └── site │ ├── .eslintrc.js │ ├── assets │ ├── api │ │ ├── en │ │ │ └── API │ │ │ │ ├── Component.md │ │ │ │ ├── Coordinate.md │ │ │ │ ├── Data.md │ │ │ │ ├── GlyphMark.md │ │ │ │ ├── GroupMark.md │ │ │ │ ├── Mark.md │ │ │ │ ├── Projection.md │ │ │ │ ├── Scale.md │ │ │ │ ├── Signal.md │ │ │ │ └── View.md │ │ ├── menu.json │ │ └── zh │ │ │ └── API │ │ │ ├── Component.md │ │ │ ├── Coordinate.md │ │ │ ├── Data.md │ │ │ ├── GlyphMark.md │ │ │ ├── GroupMark.md │ │ │ ├── Mark.md │ │ │ ├── Projection.md │ │ │ ├── Scale.md │ │ │ ├── Signal.md │ │ │ └── View.md │ ├── changelog │ │ ├── en │ │ │ └── release.md │ │ └── zh │ │ │ └── release.md │ ├── examples │ │ ├── en │ │ │ ├── 3d-mark │ │ │ │ ├── arc3d.md │ │ │ │ ├── pyramid3d.md │ │ │ │ └── rect3d.md │ │ │ ├── animate │ │ │ │ ├── arrange-animate.md │ │ │ │ ├── basic-animate.md │ │ │ │ ├── custom-animate.md │ │ │ │ ├── loop-animate.md │ │ │ │ ├── morph-animate.md │ │ │ │ └── timeline.md │ │ │ ├── basic-mark-arc │ │ │ │ ├── basic-arc.md │ │ │ │ ├── progress-arc.md │ │ │ │ ├── radial-arc.md │ │ │ │ └── simple-pie.md │ │ │ ├── basic-mark-area │ │ │ │ ├── basic-area.md │ │ │ │ ├── connect-nulls-area.md │ │ │ │ ├── connect-nulls-segments-area.md │ │ │ │ ├── intersection.md │ │ │ │ ├── percent-area.md │ │ │ │ ├── stack-area.md │ │ │ │ └── vertical-area.md │ │ │ ├── basic-mark-circle │ │ │ │ ├── relation-circle-right.md │ │ │ │ ├── relation-circle-top.md │ │ │ │ └── relation-circle.md │ │ │ ├── basic-mark-image │ │ │ │ └── basic-image.md │ │ │ ├── basic-mark-line │ │ │ │ ├── basic-line.md │ │ │ │ ├── connect-nulls-line.md │ │ │ │ ├── connect-nulls-segments.md │ │ │ │ ├── log-line.md │ │ │ │ ├── segmental-line.md │ │ │ │ └── spiral.md │ │ │ ├── basic-mark-polygon │ │ │ │ ├── basic-polygon.md │ │ │ │ ├── flow-funnel.md │ │ │ │ └── polygon-intersect.md │ │ │ ├── basic-mark-rect │ │ │ │ ├── api-rect.md │ │ │ │ ├── basic-rect.md │ │ │ │ ├── bi-direction-rect.md │ │ │ │ ├── customized-shape.md │ │ │ │ ├── percent-rect.md │ │ │ │ ├── range-rect.md │ │ │ │ ├── stack-rect.md │ │ │ │ └── symmetry-rect.md │ │ │ ├── basic-mark-richtext │ │ │ │ └── basic-richtext.md │ │ │ ├── basic-mark-rule │ │ │ │ ├── basic-rule.md │ │ │ │ └── rule-symbol.md │ │ │ ├── basic-mark-symbol │ │ │ │ ├── basic-symbol.md │ │ │ │ ├── bubble.md │ │ │ │ └── jitter-symbol.md │ │ │ ├── basic-mark-text │ │ │ │ └── basic-text.md │ │ │ ├── component │ │ │ │ ├── dataZoom.md │ │ │ │ ├── label.md │ │ │ │ ├── legend.md │ │ │ │ ├── player.md │ │ │ │ └── slider.md │ │ │ ├── glyph-mark │ │ │ │ ├── bar-boxplot.md │ │ │ │ ├── boxplot.md │ │ │ │ ├── candle.md │ │ │ │ ├── horizontal-boxplot.md │ │ │ │ ├── link-path.md │ │ │ │ ├── polar-boxplot.md │ │ │ │ ├── ripple.md │ │ │ │ ├── violin.md │ │ │ │ └── wave.md │ │ │ ├── hierarchy │ │ │ │ ├── circlepacking.md │ │ │ │ ├── sunburst.md │ │ │ │ ├── tree.md │ │ │ │ └── treemap.md │ │ │ ├── mark-cell │ │ │ │ ├── basic-cell.md │ │ │ │ └── calender-cell.md │ │ │ ├── mark-interval │ │ │ │ ├── bar-symmetry-group.md │ │ │ │ ├── bar-symmetry.md │ │ │ │ ├── basic-bar.md │ │ │ │ ├── basic-interval.md │ │ │ │ ├── polar-interval.md │ │ │ │ └── radial-interval.md │ │ │ ├── performance │ │ │ │ ├── progressive-line.md │ │ │ │ └── progressive-rect.md │ │ │ ├── plot │ │ │ │ ├── connected-scatter-line.md │ │ │ │ ├── plot-diverging-color-point.md │ │ │ │ ├── plot-line.md │ │ │ │ ├── plot-stack-point.md │ │ │ │ ├── plot-symbol-rule.md │ │ │ │ └── plot-symbol.md │ │ │ ├── sankey │ │ │ │ └── basic-sankey.md │ │ │ ├── wordcloud-shape │ │ │ │ └── basic-wordcloud-shape.md │ │ │ └── wordcloud │ │ │ │ └── basic-wordcloud.md │ │ ├── menu.json │ │ └── zh │ │ │ ├── 3d-mark │ │ │ ├── arc3d.md │ │ │ ├── pyramid3d.md │ │ │ └── rect3d.md │ │ │ ├── animate │ │ │ ├── arrange-animate.md │ │ │ ├── basic-animate.md │ │ │ ├── custom-animate.md │ │ │ ├── loop-animate.md │ │ │ ├── morph-animate.md │ │ │ └── timeline.md │ │ │ ├── basic-mark-arc │ │ │ ├── basic-arc.md │ │ │ ├── progress-arc.md │ │ │ ├── radial-arc.md │ │ │ └── simple-pie.md │ │ │ ├── basic-mark-area │ │ │ ├── basic-area.md │ │ │ ├── connect-nulls-area.md │ │ │ ├── connect-nulls-segments-area.md │ │ │ ├── intersection.md │ │ │ ├── percent-area.md │ │ │ ├── stack-area.md │ │ │ └── vertical-area.md │ │ │ ├── basic-mark-circle │ │ │ ├── relation-circle-right.md │ │ │ ├── relation-circle-top.md │ │ │ └── relation-circle.md │ │ │ ├── basic-mark-image │ │ │ └── basic-image.md │ │ │ ├── basic-mark-line │ │ │ ├── basic-line.md │ │ │ ├── connect-nulls-line.md │ │ │ ├── connect-nulls-segments.md │ │ │ ├── log-line.md │ │ │ ├── segmental-line.md │ │ │ └── spiral.md │ │ │ ├── basic-mark-polygon │ │ │ ├── basic-polygon.md │ │ │ ├── flow-funnel.md │ │ │ └── polygon-intersect.md │ │ │ ├── basic-mark-rect │ │ │ ├── api-rect.md │ │ │ ├── basic-rect.md │ │ │ ├── bi-direction-rect.md │ │ │ ├── customized-shape.md │ │ │ ├── percent-rect.md │ │ │ ├── range-rect.md │ │ │ ├── stack-rect.md │ │ │ └── symmetry-rect.md │ │ │ ├── basic-mark-richtext │ │ │ └── basic-richtext.md │ │ │ ├── basic-mark-rule │ │ │ ├── basic-rule.md │ │ │ └── rule-symbol.md │ │ │ ├── basic-mark-symbol │ │ │ ├── basic-symbol.md │ │ │ ├── bubble.md │ │ │ └── jitter-symbol.md │ │ │ ├── basic-mark-text │ │ │ └── basic-text.md │ │ │ ├── component │ │ │ ├── dataZoom.md │ │ │ ├── label.md │ │ │ ├── legend.md │ │ │ ├── player.md │ │ │ └── slider.md │ │ │ ├── glyph-mark │ │ │ ├── bar-boxplot.md │ │ │ ├── boxplot.md │ │ │ ├── candle.md │ │ │ ├── horizontal-boxplot.md │ │ │ ├── link-path.md │ │ │ ├── polar-boxplot.md │ │ │ ├── ripple.md │ │ │ ├── violin.md │ │ │ └── wave.md │ │ │ ├── hierarchy │ │ │ ├── circlepacking.md │ │ │ ├── sunburst.md │ │ │ ├── tree.md │ │ │ └── treemap.md │ │ │ ├── mark-cell │ │ │ ├── basic-cell.md │ │ │ └── calender-cell.md │ │ │ ├── mark-interval │ │ │ ├── bar-symmetry-group.md │ │ │ ├── bar-symmetry.md │ │ │ ├── basic-bar.md │ │ │ ├── basic-interval.md │ │ │ ├── polar-interval.md │ │ │ └── radial-interval.md │ │ │ ├── performance │ │ │ ├── progressive-line.md │ │ │ └── progressive-rect.md │ │ │ ├── plot │ │ │ ├── connected-scatter-line.md │ │ │ ├── plot-diverging-color-point.md │ │ │ ├── plot-line.md │ │ │ ├── plot-stack-point.md │ │ │ ├── plot-symbol-rule.md │ │ │ └── plot-symbol.md │ │ │ ├── sankey │ │ │ └── basic-sankey.md │ │ │ ├── wordcloud-shape │ │ │ └── basic-wordcloud-shape.md │ │ │ └── wordcloud │ │ │ └── basic-wordcloud.md │ ├── guide │ │ ├── en │ │ │ └── guides │ │ │ │ ├── advanced-guide.md │ │ │ │ ├── animation.md │ │ │ │ ├── chart.md │ │ │ │ ├── developer │ │ │ │ ├── react.md │ │ │ │ └── vue.md │ │ │ │ ├── event.md │ │ │ │ ├── grammar-element.md │ │ │ │ ├── layout.md │ │ │ │ ├── marks │ │ │ │ ├── base.md │ │ │ │ ├── basic-mark.md │ │ │ │ ├── component.md │ │ │ │ ├── glyph-mark.md │ │ │ │ └── semantic-mark.md │ │ │ │ ├── quick-start.md │ │ │ │ └── website-guide.md │ │ ├── menu.json │ │ └── zh │ │ │ └── guides │ │ │ ├── advanced-guide.md │ │ │ ├── animation.md │ │ │ ├── chart.md │ │ │ ├── developer │ │ │ ├── react.md │ │ │ └── vue.md │ │ │ ├── event.md │ │ │ ├── grammar-element.md │ │ │ ├── layout.md │ │ │ ├── marks │ │ │ ├── base.md │ │ │ ├── basic-mark.md │ │ │ ├── component.md │ │ │ ├── glyph-mark.md │ │ │ └── semantic-mark.md │ │ │ ├── quick-start.md │ │ │ └── website-guide.md │ └── option │ │ ├── en │ │ ├── common │ │ │ ├── aggregateop.md │ │ │ ├── callback.md │ │ │ ├── gradient.md │ │ │ ├── grammar.md │ │ │ ├── image.md │ │ │ └── padding.md │ │ ├── coordinates │ │ │ ├── base.md │ │ │ ├── index.md │ │ │ ├── polar.md │ │ │ └── rect.md │ │ ├── data │ │ │ └── index.md │ │ ├── events │ │ │ └── index.md │ │ ├── marks │ │ │ ├── animate.md │ │ │ ├── arc.md │ │ │ ├── arc3d.md │ │ │ ├── area.md │ │ │ ├── base.md │ │ │ ├── cell.md │ │ │ ├── circle.md │ │ │ ├── common │ │ │ │ ├── channels.md │ │ │ │ ├── fieldEncode.md │ │ │ │ ├── funtionType.md │ │ │ │ ├── large.md │ │ │ │ ├── markTarget.md │ │ │ │ ├── morph.md │ │ │ │ ├── scale.md │ │ │ │ ├── target.md │ │ │ │ └── tooltipRow.md │ │ │ ├── component.md │ │ │ ├── component │ │ │ │ ├── axis.md │ │ │ │ ├── datazoom.md │ │ │ │ ├── label.md │ │ │ │ ├── legend.md │ │ │ │ ├── player.md │ │ │ │ └── slider.md │ │ │ ├── encode.md │ │ │ ├── glyph.md │ │ │ ├── glyph │ │ │ │ ├── barboxplot.md │ │ │ │ ├── boxplot.md │ │ │ │ ├── linkpath.md │ │ │ │ ├── ripplepoint.md │ │ │ │ └── wave.md │ │ │ ├── group.md │ │ │ ├── image.md │ │ │ ├── index.md │ │ │ ├── interval.md │ │ │ ├── line.md │ │ │ ├── path.md │ │ │ ├── polygon.md │ │ │ ├── pyramid3d.md │ │ │ ├── rect.md │ │ │ ├── rect3d.md │ │ │ ├── richtext.md │ │ │ ├── rule.md │ │ │ ├── shape.md │ │ │ ├── symbol.md │ │ │ └── text.md │ │ ├── option.md │ │ ├── projections │ │ │ ├── function.md │ │ │ └── index.md │ │ ├── scales │ │ │ ├── band.md │ │ │ ├── common │ │ │ │ ├── domain.md │ │ │ │ ├── function.md │ │ │ │ ├── nice.md │ │ │ │ ├── niceminmax.md │ │ │ │ ├── range.md │ │ │ │ └── uservalue.md │ │ │ ├── index.md │ │ │ ├── linear.md │ │ │ ├── log.md │ │ │ ├── ordinal.md │ │ │ ├── point.md │ │ │ ├── pow.md │ │ │ ├── quantile.md │ │ │ ├── quantize.md │ │ │ ├── sqrt.md │ │ │ ├── symlog.md │ │ │ ├── threshold.md │ │ │ ├── time.md │ │ │ └── utc.md │ │ ├── signals │ │ │ └── index.md │ │ └── transform │ │ │ ├── aggregate.md │ │ │ ├── circlepacking.md │ │ │ ├── dodge.md │ │ │ ├── extent.md │ │ │ ├── filter.md │ │ │ ├── funnel.md │ │ │ ├── join.md │ │ │ ├── map.md │ │ │ ├── pick.md │ │ │ ├── pie.md │ │ │ ├── range.md │ │ │ ├── sankey.md │ │ │ ├── sort.md │ │ │ ├── stack.md │ │ │ ├── sunburst.md │ │ │ ├── tree.md │ │ │ ├── treemap.md │ │ │ ├── unfold.md │ │ │ ├── wordcloud.md │ │ │ └── wordcloudshape.md │ │ └── zh │ │ ├── common │ │ ├── aggregateop.md │ │ ├── callback.md │ │ ├── gradient.md │ │ ├── grammar.md │ │ ├── image.md │ │ └── padding.md │ │ ├── coordinates │ │ ├── base.md │ │ ├── index.md │ │ ├── polar.md │ │ └── rect.md │ │ ├── data │ │ └── index.md │ │ ├── events │ │ └── index.md │ │ ├── marks │ │ ├── animate.md │ │ ├── arc.md │ │ ├── arc3d.md │ │ ├── area.md │ │ ├── base.md │ │ ├── cell.md │ │ ├── circle.md │ │ ├── common │ │ │ ├── channels.md │ │ │ ├── fieldEncode.md │ │ │ ├── funtionType.md │ │ │ ├── large.md │ │ │ ├── markTarget.md │ │ │ ├── morph.md │ │ │ ├── scale.md │ │ │ ├── target.md │ │ │ └── tooltipRow.md │ │ ├── component.md │ │ ├── component │ │ │ ├── axis.md │ │ │ ├── datazoom.md │ │ │ ├── label.md │ │ │ ├── legend.md │ │ │ ├── player.md │ │ │ └── slider.md │ │ ├── encode.md │ │ ├── glyph.md │ │ ├── glyph │ │ │ ├── barboxplot.md │ │ │ ├── boxplot.md │ │ │ ├── linkpath.md │ │ │ ├── ripplepoint.md │ │ │ └── wave.md │ │ ├── group.md │ │ ├── image.md │ │ ├── index.md │ │ ├── interval.md │ │ ├── line.md │ │ ├── path.md │ │ ├── polygon.md │ │ ├── pyramid3d.md │ │ ├── rect.md │ │ ├── rect3d.md │ │ ├── richtext.md │ │ ├── rule.md │ │ ├── shape.md │ │ ├── symbol.md │ │ └── text.md │ │ ├── option.md │ │ ├── projections │ │ ├── function.md │ │ └── index.md │ │ ├── scales │ │ ├── band.md │ │ ├── common │ │ │ ├── domain.md │ │ │ ├── function.md │ │ │ ├── nice.md │ │ │ ├── niceminmax.md │ │ │ ├── range.md │ │ │ └── uservalue.md │ │ ├── index.md │ │ ├── linear.md │ │ ├── log.md │ │ ├── ordinal.md │ │ ├── point.md │ │ ├── pow.md │ │ ├── quantile.md │ │ ├── quantize.md │ │ ├── sqrt.md │ │ ├── symlog.md │ │ ├── threshold.md │ │ ├── time.md │ │ └── utc.md │ │ ├── signals │ │ └── index.md │ │ └── transform │ │ ├── aggregate.md │ │ ├── circlepacking.md │ │ ├── dodge.md │ │ ├── extent.md │ │ ├── filter.md │ │ ├── funnel.md │ │ ├── join.md │ │ ├── map.md │ │ ├── pick.md │ │ ├── pie.md │ │ ├── range.md │ │ ├── sankey.md │ │ ├── sort.md │ │ ├── stack.md │ │ ├── sunburst.md │ │ ├── tree.md │ │ ├── treemap.md │ │ ├── unfold.md │ │ ├── wordcloud.md │ │ └── wordcloudshape.md │ ├── index.html │ ├── libs │ ├── preview.js │ ├── sync-example-code.js │ ├── template-parse │ │ ├── build.js │ │ ├── etpl.js │ │ ├── md2json.js │ │ └── schemaHelper.js │ └── update-example-reference.js │ ├── menu.json │ ├── package.json │ ├── public │ └── vgrammar │ │ ├── preview │ │ ├── 3d-mark-arc3d_0.7.6.png │ │ ├── 3d-mark-pyramid3d_0.7.6.png │ │ ├── 3d-mark-rect3d_0.7.6.png │ │ ├── animate-arrange-animate_0.7.6.gif │ │ ├── animate-basic-animate_0.7.6.gif │ │ ├── animate-custom-animate_0.7.6.gif │ │ ├── animate-loop-animate_0.7.6.gif │ │ ├── animate-morph-animate_0.7.6.gif │ │ ├── animate-timeline_0.7.6.gif │ │ ├── basic-mark-arc-basic-arc_0.7.6.png │ │ ├── basic-mark-arc-progress-arc_0.7.6.png │ │ ├── basic-mark-arc-radial-arc_0.7.6.png │ │ ├── basic-mark-arc-simple-pie_0.7.6.png │ │ ├── basic-mark-area-basic-area_0.7.6.png │ │ ├── basic-mark-area-connect-nulls-area_0.10.8.png │ │ ├── basic-mark-area-intersection_0.7.6.png │ │ ├── basic-mark-area-percent-area_0.7.6.png │ │ ├── basic-mark-area-stack-area_0.7.6.png │ │ ├── basic-mark-area-vertical-area_0.7.6.png │ │ ├── basic-mark-circle-relation-circle-right_0.7.6.png │ │ ├── basic-mark-circle-relation-circle-top_0.7.6.png │ │ ├── basic-mark-circle-relation-circle_0.7.6.png │ │ ├── basic-mark-image-basic-image_0.7.6.png │ │ ├── basic-mark-line-basic-line_0.7.6.png │ │ ├── basic-mark-line-connect-nulls-line_0.10.8.png │ │ ├── basic-mark-line-connect-nulls-segments_0.10.8.png │ │ ├── basic-mark-line-log-line_0.7.6.png │ │ ├── basic-mark-line-segmental-line_0.7.6.png │ │ ├── basic-mark-line-spiral_0.7.6.png │ │ ├── basic-mark-polygon-basic-polygon_0.7.6.png │ │ ├── basic-mark-polygon-flow-funnel_0.7.6.png │ │ ├── basic-mark-polygon-polygon-intersect_0.7.6.png │ │ ├── basic-mark-rect-api-rect_0.7.6.png │ │ ├── basic-mark-rect-basic-rect_0.7.6.png │ │ ├── basic-mark-rect-bi-direction-rect_0.7.6.png │ │ ├── basic-mark-rect-customized-shape_0.7.6.png │ │ ├── basic-mark-rect-percent-rect_0.7.6.png │ │ ├── basic-mark-rect-range-rect_0.7.6.png │ │ ├── basic-mark-rect-stack-rect_0.7.6.png │ │ ├── basic-mark-rect-symmetry-rect_0.7.6.png │ │ ├── basic-mark-richtext-basic-richtext_0.7.6.png │ │ ├── basic-mark-rule-basic-rule_0.7.6.png │ │ ├── basic-mark-rule-rule-symbol_0.7.6.png │ │ ├── basic-mark-symbol-basic-symbol_0.7.6.png │ │ ├── basic-mark-symbol-bubble_0.7.6.png │ │ ├── basic-mark-symbol-jitter-symbol_0.10.8.png │ │ ├── basic-mark-text-basic-text_0.7.6.png │ │ ├── component-dataZoom_0.7.6.png │ │ ├── component-label_0.7.6.png │ │ ├── component-legend_0.7.6.png │ │ ├── component-player_0.10.8.png │ │ ├── component-player_0.7.6.png │ │ ├── component-slider_0.7.6.png │ │ ├── failedPreviewLists.json │ │ ├── glyph-mark-bar-boxplot_0.7.6.png │ │ ├── glyph-mark-boxplot_0.7.6.png │ │ ├── glyph-mark-candle_0.7.6.png │ │ ├── glyph-mark-horizontal-boxplot_0.7.6.png │ │ ├── glyph-mark-link-path_0.7.6.png │ │ ├── glyph-mark-polar-boxplot_0.7.6.png │ │ ├── glyph-mark-ripple_0.7.6.png │ │ ├── glyph-mark-violin_0.7.6.png │ │ ├── glyph-mark-wave_0.7.6.png │ │ ├── hierarchy-circlepacking_0.7.6.png │ │ ├── hierarchy-sunburst_0.7.6.png │ │ ├── hierarchy-tree_0.7.6.png │ │ ├── hierarchy-treemap_0.7.6.png │ │ ├── mark-cell-basic-cell_0.7.6.png │ │ ├── mark-cell-calender-cell_0.7.6.png │ │ ├── mark-interval-bar-symmetry-group_0.7.6.png │ │ ├── mark-interval-bar-symmetry_0.7.6.png │ │ ├── mark-interval-basic-bar_0.7.6.png │ │ ├── mark-interval-basic-interval_0.7.6.png │ │ ├── mark-interval-polar-interval_0.7.6.png │ │ ├── mark-interval-radial-interval_0.7.6.png │ │ ├── performance-progressive-line_0.7.6.gif │ │ ├── performance-progressive-rect_0.7.6.gif │ │ ├── plot-connected-scatter-line_0.7.6.png │ │ ├── plot-plot-diverging-color-point_0.7.6.png │ │ ├── plot-plot-line_0.7.6.png │ │ ├── plot-plot-stack-point_0.7.6.png │ │ ├── plot-plot-symbol-rule_0.7.6.png │ │ ├── plot-plot-symbol_0.7.6.png │ │ ├── sankey-basic-sankey_0.7.6.png │ │ ├── wordcloud-basic-wordcloud_0.7.6.png │ │ └── wordcloud-shape-basic-wordcloud-shape_0.7.6.png │ │ └── static-preview │ │ ├── animate-arrange-animate.gif │ │ ├── animate-basic-animate.gif │ │ ├── animate-custom-animate.gif │ │ ├── animate-loop-animate.gif │ │ ├── animate-morph-animate.gif │ │ ├── animate-timeline.gif │ │ ├── component-player.png │ │ ├── performance-progressive-line.gif │ │ └── performance-progressive-rect.gif │ ├── src │ ├── app.tsx │ ├── demo.tsx │ ├── header.tsx │ ├── i18n.tsx │ ├── main.tsx │ ├── markdown.tsx │ ├── option.tsx │ └── option │ │ ├── description.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ └── outline.tsx │ ├── style.css │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.js ├── packages ├── vgrammar-coordinate │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── cartesian.test.ts │ │ ├── polar.test.ts │ │ └── tsconfig.json │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── base.ts │ │ ├── cartesian.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ └── polar.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-core │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── component │ │ │ ├── axis.test.ts │ │ │ ├── datazoom.test.ts │ │ │ ├── grid.test.ts │ │ │ ├── label.test.ts │ │ │ ├── player.test.ts │ │ │ ├── slider.test.ts │ │ │ └── title.test.ts │ │ ├── event-selector.test.ts │ │ ├── glyph │ │ │ ├── boxplot.test.ts │ │ │ ├── link-path.test.ts │ │ │ ├── ripple.test.ts │ │ │ ├── tree-path.test.ts │ │ │ ├── violin.test.ts │ │ │ └── wave.test.ts │ │ ├── grammar │ │ │ ├── coordinate.test.ts │ │ │ ├── data.test.ts │ │ │ ├── mark.test.ts │ │ │ ├── scale.test.ts │ │ │ └── signal.test.ts │ │ ├── graph │ │ │ ├── attribute.test.ts │ │ │ ├── layout.test.ts │ │ │ └── view-diff.test.ts │ │ ├── mark │ │ │ ├── datajoin.test.ts │ │ │ ├── element-state.test.ts │ │ │ ├── element.test.ts │ │ │ ├── glyph.test.ts │ │ │ ├── group-encode.test.ts │ │ │ ├── group.test.ts │ │ │ ├── line.test.ts │ │ │ ├── rect.test.ts │ │ │ └── symbol.test.ts │ │ ├── transforms │ │ │ ├── bin.test.ts │ │ │ ├── circlular-relation.test.ts │ │ │ ├── contour.test.ts │ │ │ ├── dodge.test.ts │ │ │ ├── filter.test.ts │ │ │ ├── fold.test.ts │ │ │ ├── funnel.test.ts │ │ │ ├── identifier.test.ts │ │ │ ├── jitter.test.ts │ │ │ ├── join.test.ts │ │ │ ├── kde.test.ts │ │ │ ├── map.test.ts │ │ │ ├── mark-overlap.test.ts │ │ │ ├── pick.test.ts │ │ │ ├── range.test.ts │ │ │ ├── sampling.test.ts │ │ │ ├── sort.test.ts │ │ │ ├── stack.test.ts │ │ │ ├── symmetry.test.ts │ │ │ └── unfold.test.ts │ │ ├── tsconfig.json │ │ ├── util.ts │ │ └── util │ │ │ ├── grammar-heap.test.ts │ │ │ └── unique-list.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── component │ │ │ ├── axis.ts │ │ │ ├── datazoom.ts │ │ │ ├── grid.ts │ │ │ ├── index.ts │ │ │ ├── label.ts │ │ │ ├── legend.ts │ │ │ ├── player.ts │ │ │ ├── scale.ts │ │ │ ├── scrollbar.ts │ │ │ ├── slider.ts │ │ │ └── title.ts │ │ ├── core │ │ │ └── factory.ts │ │ ├── env.ts │ │ ├── global.d.ts │ │ ├── glyph │ │ │ ├── boxplot.ts │ │ │ ├── index.ts │ │ │ ├── link-path.ts │ │ │ ├── ripple.ts │ │ │ ├── tree-path.ts │ │ │ ├── violin.ts │ │ │ └── wave.ts │ │ ├── graph │ │ │ ├── animation │ │ │ │ ├── animate.ts │ │ │ │ ├── animation │ │ │ │ │ ├── clip.ts │ │ │ │ │ ├── fade.ts │ │ │ │ │ ├── grow-cartesian.ts │ │ │ │ │ ├── grow-interval.ts │ │ │ │ │ ├── grow-points.ts │ │ │ │ │ ├── grow-polar.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── move.ts │ │ │ │ │ ├── rotate.ts │ │ │ │ │ ├── scale.ts │ │ │ │ │ └── update.ts │ │ │ │ ├── animator.ts │ │ │ │ ├── arranger.ts │ │ │ │ ├── attribute.ts │ │ │ │ ├── config.ts │ │ │ │ └── morph.ts │ │ │ ├── attributes │ │ │ │ ├── common.ts │ │ │ │ ├── helpers.ts │ │ │ │ ├── index.ts │ │ │ │ ├── line.ts │ │ │ │ └── transform.ts │ │ │ ├── canvas-renderer.ts │ │ │ ├── constants.ts │ │ │ ├── element.ts │ │ │ ├── enums.ts │ │ │ ├── glyph-element.ts │ │ │ ├── index.ts │ │ │ ├── layout │ │ │ │ ├── grid.ts │ │ │ │ ├── layout.ts │ │ │ │ └── relative.ts │ │ │ ├── mark-tree.ts │ │ │ ├── mark │ │ │ │ ├── differ.ts │ │ │ │ ├── encode.ts │ │ │ │ ├── graphic.ts │ │ │ │ ├── large-rects.ts │ │ │ │ └── large-symbols.ts │ │ │ ├── util │ │ │ │ ├── env.ts │ │ │ │ ├── events-extend.ts │ │ │ │ ├── graphic.ts │ │ │ │ └── point.ts │ │ │ └── view-diff.ts │ │ ├── index.ts │ │ ├── interactions │ │ │ ├── base-tooltip.ts │ │ │ ├── base.ts │ │ │ ├── brush-active.ts │ │ │ ├── brush-base.ts │ │ │ ├── brush-filter.ts │ │ │ ├── brush-highlight.ts │ │ │ ├── crosshair.ts │ │ │ ├── datazoom-filter.ts │ │ │ ├── dimension-tooltip.ts │ │ │ ├── drill-down.ts │ │ │ ├── element-active-by-legend.ts │ │ │ ├── element-active.ts │ │ │ ├── element-highlight-by-graphic-name.ts │ │ │ ├── element-highlight-by-group.ts │ │ │ ├── element-highlight-by-key.ts │ │ │ ├── element-highlight-by-legend.ts │ │ │ ├── element-highlight-by-name.ts │ │ │ ├── element-highlight.ts │ │ │ ├── element-select-by-graphic-name.ts │ │ │ ├── element-select.ts │ │ │ ├── filter.ts │ │ │ ├── fish-eye.ts │ │ │ ├── index.ts │ │ │ ├── legend-filter.ts │ │ │ ├── player-filter.ts │ │ │ ├── roll-up.ts │ │ │ ├── scrollbar-filter.ts │ │ │ ├── slider-filter.ts │ │ │ ├── toggle-state-mixin.ts │ │ │ ├── tooltip.ts │ │ │ ├── utils.ts │ │ │ ├── view-drag-mixin.ts │ │ │ ├── view-drag.ts │ │ │ ├── view-navigation-base.ts │ │ │ ├── view-roam.ts │ │ │ ├── view-scroll-mixin.ts │ │ │ ├── view-scroll.ts │ │ │ ├── view-utils.ts │ │ │ ├── view-zoom-mixin.ts │ │ │ └── view-zoom.ts │ │ ├── parse │ │ │ ├── coordinate.ts │ │ │ ├── event.ts │ │ │ ├── mark.ts │ │ │ ├── option.ts │ │ │ ├── scale.ts │ │ │ ├── transform.ts │ │ │ ├── util.ts │ │ │ └── view.ts │ │ ├── semantic-marks │ │ │ ├── cell.ts │ │ │ ├── interval.ts │ │ │ └── text.ts │ │ ├── theme │ │ │ ├── common │ │ │ │ ├── component.ts │ │ │ │ ├── constants.ts │ │ │ │ └── mark.ts │ │ │ ├── dark.ts │ │ │ ├── default.ts │ │ │ └── theme-manager.ts │ │ ├── transforms │ │ │ ├── data │ │ │ │ ├── bin.ts │ │ │ │ ├── circular-relation.ts │ │ │ │ ├── contour.ts │ │ │ │ ├── filter.ts │ │ │ │ ├── fold.ts │ │ │ │ ├── funnel.ts │ │ │ │ ├── join.ts │ │ │ │ ├── kde.ts │ │ │ │ ├── map.ts │ │ │ │ ├── pick.ts │ │ │ │ ├── pie.ts │ │ │ │ ├── range.ts │ │ │ │ ├── sampling.ts │ │ │ │ ├── sort.ts │ │ │ │ ├── stack.ts │ │ │ │ └── unfold.ts │ │ │ ├── index.ts │ │ │ ├── mark │ │ │ │ ├── dodge.ts │ │ │ │ ├── jitter.ts │ │ │ │ ├── mark-overlap.ts │ │ │ │ └── symmetry.ts │ │ │ ├── util │ │ │ │ └── util.ts │ │ │ └── view │ │ │ │ └── identifier.ts │ │ ├── types │ │ │ ├── animate.ts │ │ │ ├── base.ts │ │ │ ├── component.ts │ │ │ ├── coordinate.ts │ │ │ ├── data.ts │ │ │ ├── dataflow.ts │ │ │ ├── element.ts │ │ │ ├── event.ts │ │ │ ├── glyph.ts │ │ │ ├── grammar.ts │ │ │ ├── hooks.ts │ │ │ ├── index.ts │ │ │ ├── interaction.ts │ │ │ ├── layout.ts │ │ │ ├── mark.ts │ │ │ ├── morph.ts │ │ │ ├── plot.ts │ │ │ ├── projection.ts │ │ │ ├── renderer.ts │ │ │ ├── scale.ts │ │ │ ├── signal.ts │ │ │ ├── theme.ts │ │ │ ├── transform.ts │ │ │ └── view.ts │ │ ├── util │ │ │ ├── data.ts │ │ │ ├── grammar-heap.ts │ │ │ ├── scale.ts │ │ │ ├── text.ts │ │ │ └── unique-list.ts │ │ └── view │ │ │ ├── View.ts │ │ │ ├── animate.ts │ │ │ ├── component.ts │ │ │ ├── constants.ts │ │ │ ├── coordinate.ts │ │ │ ├── data.ts │ │ │ ├── dataflow.ts │ │ │ ├── events.ts │ │ │ ├── glyph-meta.ts │ │ │ ├── glyph.ts │ │ │ ├── grammar-base.ts │ │ │ ├── grammar-record.ts │ │ │ ├── group.ts │ │ │ ├── index.ts │ │ │ ├── mark-animate-mixin.ts │ │ │ ├── mark.ts │ │ │ ├── scale.ts │ │ │ ├── signal.ts │ │ │ ├── view-animate-mixin.ts │ │ │ ├── view-event-mixin.ts │ │ │ └── view-morph-mixin.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-full │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── scripts │ │ └── trigger-test.ts │ ├── src │ │ └── index.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-hierarchy │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── circle-packing.test.ts │ │ ├── data │ │ │ └── tree.ts │ │ ├── format.test.ts │ │ ├── global.d.ts │ │ ├── sunburst.test.ts │ │ ├── transform.test.ts │ │ ├── tree.test.ts │ │ ├── treemap.test.ts │ │ ├── tsconfig.json │ │ └── utils.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── circle-packing │ │ │ ├── enclose.ts │ │ │ ├── layout.ts │ │ │ ├── siblings.ts │ │ │ └── transform.ts │ │ ├── format.ts │ │ ├── global.d.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── lcg.ts │ │ ├── sunburst │ │ │ ├── layout.ts │ │ │ └── transform.ts │ │ ├── tree │ │ │ ├── cluster.ts │ │ │ ├── layout.ts │ │ │ ├── transform.ts │ │ │ └── tree.ts │ │ ├── treemap │ │ │ ├── binary.ts │ │ │ ├── dice.ts │ │ │ ├── layout.ts │ │ │ ├── slice.ts │ │ │ ├── sliceDice.ts │ │ │ ├── squarify.ts │ │ │ └── transform.ts │ │ └── utils.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-plot │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── components │ │ │ ├── grid.test.ts │ │ │ └── title.test.ts │ │ ├── global.d.ts │ │ ├── marks │ │ │ ├── interval.test.ts │ │ │ ├── rect-x.test.ts │ │ │ ├── rect-y.test.ts │ │ │ └── rect.test.ts │ │ ├── tsconfig.json │ │ ├── util.test.ts │ │ └── util.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── area.ts │ │ ├── cell.ts │ │ ├── circle-packing.ts │ │ ├── enums.ts │ │ ├── image.ts │ │ ├── index.ts │ │ ├── interval.ts │ │ ├── line.ts │ │ ├── path.ts │ │ ├── plot-all.ts │ │ ├── plot.ts │ │ ├── polygon.ts │ │ ├── rect-x.ts │ │ ├── rect-y.ts │ │ ├── rect.ts │ │ ├── rule-x.ts │ │ ├── rule-y.ts │ │ ├── rule.ts │ │ ├── sankey.ts │ │ ├── semantic-mark.ts │ │ ├── sunburst.ts │ │ ├── symbol.ts │ │ ├── text.ts │ │ ├── tree.ts │ │ ├── treemap.ts │ │ ├── util.ts │ │ ├── wordcloud-shape.ts │ │ └── wordcloud.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-projection │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── data.ts │ │ ├── geo-path.test.ts │ │ ├── global.d.ts │ │ ├── projection.test.ts │ │ ├── projections.test.ts │ │ ├── tsconfig.json │ │ └── utils.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── geo-path.ts │ │ ├── global.d.ts │ │ ├── index.ts │ │ ├── projection.ts │ │ └── projections.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-sankey │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── data.ts │ │ ├── format.test.ts │ │ ├── global.d.ts │ │ ├── layout.test.ts │ │ ├── transform.test.ts │ │ └── tsconfig.json │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── format.ts │ │ ├── global.d.ts │ │ ├── hierarchy.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── layout.ts │ │ ├── sankey-highlight.ts │ │ └── transform.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-util │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── accessor.test.ts │ │ ├── accessors.test.ts │ │ ├── compare.test.ts │ │ ├── extent.test.ts │ │ ├── field.test.ts │ │ ├── getter.test.ts │ │ ├── regression-linear.test.ts │ │ ├── shape.test.ts │ │ ├── splitAccessPath.test.ts │ │ ├── to-percent.test.ts │ │ ├── tsconfig.json │ │ └── view-box.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── accessor.ts │ │ ├── accessors.ts │ │ ├── compare.ts │ │ ├── direction.ts │ │ ├── error.ts │ │ ├── extent.ts │ │ ├── field.ts │ │ ├── getter.ts │ │ ├── global.d.ts │ │ ├── image.ts │ │ ├── index.ts │ │ ├── regression-linear.ts │ │ ├── shapes.ts │ │ ├── splitAccessPath.ts │ │ ├── toPercent.ts │ │ ├── types │ │ │ ├── function.ts │ │ │ ├── index.ts │ │ │ └── wordcloud.ts │ │ └── view-box.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-venn │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── global.d.ts │ │ ├── tranform.test.ts │ │ ├── tsconfig.json │ │ └── venn.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── animation.ts │ │ ├── global.d.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── utils │ │ │ ├── index.ts │ │ │ ├── interface.ts │ │ │ ├── label.ts │ │ │ ├── layout │ │ │ │ ├── common.ts │ │ │ │ ├── constrained-mds-layout.ts │ │ │ │ ├── greedy-layout.ts │ │ │ │ ├── index.ts │ │ │ │ ├── layout.ts │ │ │ │ └── loss.ts │ │ │ ├── path.ts │ │ │ └── solution │ │ │ │ ├── common.ts │ │ │ │ ├── index.ts │ │ │ │ ├── normalize-solution.ts │ │ │ │ └── scale-solution.ts │ │ └── venn.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-wordcloud-shape │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── global.d.ts │ │ ├── tsconfig.json │ │ └── wordcloud-shape.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── cloud-shape-layout.ts │ │ ├── filling.ts │ │ ├── global.d.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── layout.ts │ │ ├── segmentation.ts │ │ ├── util.ts │ │ ├── wordcloud-shape.ts │ │ └── wordle.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── vgrammar-wordcloud │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── __tests__ │ │ ├── cloud-layout.test.ts │ │ ├── fast-layout.test.ts │ │ ├── global.d.ts │ │ ├── grid-layout.test.ts │ │ ├── tranform.test.ts │ │ ├── tsconfig.json │ │ ├── util.test.ts │ │ └── wordcloud.test.ts │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── base.ts │ │ ├── cloud-layout.ts │ │ ├── fast-layout.ts │ │ ├── global.d.ts │ │ ├── grid-layout.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── spirals.ts │ │ ├── util.ts │ │ └── wordcloud.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json └── vgrammar │ ├── .eslintrc.js │ ├── CHANGELOG.json │ ├── CHANGELOG.md │ ├── README.md │ ├── README.zh-CN.md │ ├── bundler.config.js │ ├── jest.config.js │ ├── package.json │ ├── src │ └── index.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── rush.json ├── share ├── eslint-config │ ├── package.json │ └── profile │ │ ├── common.js │ │ ├── lib.js │ │ └── react.js ├── jest-config │ ├── jest.base.js │ └── package.json └── ts-config │ ├── package.json │ └── tsconfig.base.json └── tools └── bundler ├── .eslintrc.js ├── README.md ├── bin └── index.js ├── fixtures └── config │ ├── .gitignore │ ├── bundler.config.js │ ├── package.json │ ├── source │ ├── custom.css │ ├── foo │ │ ├── bar │ │ │ ├── index.ts │ │ │ └── web.png │ │ └── index.ts │ ├── global.d.ts │ ├── index.ts │ └── utils │ │ └── index.ts │ └── tsconfig.json ├── package.json ├── src ├── bootstrap.ts ├── global.d.ts ├── index.ts ├── logic │ ├── alias.ts │ ├── babel.config.ts │ ├── config.test.ts │ ├── config.ts │ ├── debug.ts │ ├── package.ts │ └── rollup.config.ts └── tasks │ ├── clean.ts │ ├── copy.ts │ ├── modules.ts │ ├── style.ts │ └── umd.ts ├── tsconfig.json └── vitest.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | # contact_links: 3 | # - name: @VisaActor/vgrammar 4 | # url: https://www.visactor.io/ 5 | # about: Please search question here before opening a new issue 6 | -------------------------------------------------------------------------------- /.github/workflows/label.yml: -------------------------------------------------------------------------------- 1 | # This workflow will triage pull requests and apply a label based on the 2 | # paths that are modified in the pull request. 3 | # 4 | # To use this workflow, you will need to set up a .github/labeler.yml 5 | # file with configuration. For more information, see: 6 | # https://github.com/actions/labeler 7 | 8 | name: Labeler 9 | on: [pull_request_target] 10 | 11 | jobs: 12 | label: 13 | runs-on: ubuntu-latest 14 | permissions: 15 | contents: read 16 | pull-requests: write 17 | 18 | steps: 19 | - uses: actions/labeler@4.x 20 | with: 21 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 22 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "{packages,tools}/**/*.{ts,tsx}": ["eslint --color --fix", "prettier --write --ignore-unknown"] 3 | } 4 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Documentation for this file: https://prettier.io/en/configuration.html 3 | */ 4 | module.exports = { 5 | printWidth: 120, 6 | tabWidth: 2, 7 | useTabs: false, 8 | semi: true, 9 | singleQuote: true, 10 | quoteProps: 'as-needed', 11 | trailingComma: 'none', 12 | bracketSpacing: true, 13 | arrowParens: 'avoid', 14 | proseWrap: 'preserve', 15 | htmlWhitespaceSensitivity: 'css', 16 | endOfLine: 'lf' 17 | }; 18 | -------------------------------------------------------------------------------- /.vscode/find-unused-exports.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": {} 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "web", 6 | "type": "shell", 7 | "isBackground": true, 8 | "command": "${workspaceFolder}/node_modules/.bin/tsc", 9 | "args": [ 10 | "${file}", 11 | "--outFile", 12 | "${workspaceFolder}/packages/chartspace/test/dist/index.js", 13 | "--strict", 14 | "--experimentalDecorators", 15 | "--sourceMap", 16 | "--skipLibCheck", 17 | "--watch" 18 | ], 19 | "problemMatcher": ["$tsc-watch"] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /common/autoinstallers/create/README.md: -------------------------------------------------------------------------------- 1 | # Create project 2 | 3 | ## Description 4 | 5 | Create a project 6 | 7 | ## Usage 8 | 9 | ```bash 10 | rush create [--name | -n] [packageName] 11 | ``` 12 | -------------------------------------------------------------------------------- /common/autoinstallers/create/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create", 3 | "version": "1.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@microsoft/rush-lib": "5.94.1", 7 | "chalk": "4.1.2", 8 | "fast-glob": "3.2.11", 9 | "minimist": "1.2.6", 10 | "prettier": "2.7.1", 11 | "prompts": "2.4.2", 12 | "string.prototype.replaceall": "1.0.6", 13 | "ts-node": "10.9.0", 14 | "zx": "4.2.0" 15 | }, 16 | "devDependencies": { 17 | "@types/minimist": "1.2.2", 18 | "@types/node": "*", 19 | "@types/prompts": "2.0.14", 20 | "typescript": "4.9.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/autoinstallers/create/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'string.prototype.replaceall' { 2 | type ReplaceAll = (source: string, sbuStr: RegExp | string, newSubStr: string) => string; 3 | 4 | const replaceAll: ReplaceAll = () => {}; 5 | 6 | export default replaceAll; 7 | } 8 | -------------------------------------------------------------------------------- /common/autoinstallers/create/src/logger.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | 3 | export const logger = { 4 | info: (...messages: any[]) => console.info(chalk.greenBright.bold('[rush create]'), ...messages), 5 | 6 | error: (...messages: any[]) => { 7 | console.error(chalk.redBright.bold('[rush create][error]'), ...messages); 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/README.md: -------------------------------------------------------------------------------- 1 | # @{{scope}}/{{projectName}} 2 | 3 | ## Description 4 | 5 | {{description}} 6 | 7 | ## Usage 8 | 9 | ```typescript 10 | import { xxx } from '@{{scope}}/{{projectName}}'; 11 | ``` 12 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es', 'umd'] 6 | }; 7 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/src/index.ts: -------------------------------------------------------------------------------- 1 | export const version = __VERSION__; 2 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "outDir": "output" 6 | }, 7 | "include": ["src", "__tests__"] 8 | } 9 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/vite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/vite/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App.tsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') as HTMLElement 11 | ); 12 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/vite/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/vite/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /common/autoinstallers/create/templates/library/vite/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react({ jsxRuntime: 'classic' })] 7 | }); 8 | -------------------------------------------------------------------------------- /common/autoinstallers/lint/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lint", 3 | "version": "0.0.1", 4 | "private": true, 5 | "dependencies": { 6 | "@commitlint/cli": "17.0.3", 7 | "@commitlint/config-conventional": "17.0.3", 8 | "@inquirer/confirm": "^2.0.2", 9 | "@microsoft/rush-lib": "5.94.1", 10 | "chalk": "4.1.2", 11 | "commitizen": "4.2.5", 12 | "eslint": "~8.18.0", 13 | "lint-staged": "13.0.3", 14 | "minimist": "1.2.6", 15 | "prettier": "2.7.1", 16 | "ts-node": "10.9.0" 17 | }, 18 | "devDependencies": { 19 | "@types/minimist": "1.2.2", 20 | "@types/node": "*", 21 | "typescript": "5.0.2" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/autoinstallers/run-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "run-script", 3 | "version": "0.0.1", 4 | "private": true, 5 | "dependencies": { 6 | "@microsoft/rush-lib": "5.94.1", 7 | "minimist": "1.2.6", 8 | "ts-node": "10.9.0" 9 | }, 10 | "devDependencies": { 11 | "@types/node": "*", 12 | "@types/minimist": "1.2.2", 13 | "typescript": "5.0.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/config/rush/repo-state.json: -------------------------------------------------------------------------------- 1 | // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. 2 | { 3 | "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" 4 | } 5 | -------------------------------------------------------------------------------- /common/config/rush/version-policies.json: -------------------------------------------------------------------------------- 1 | [{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.16.8","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}] 2 | -------------------------------------------------------------------------------- /common/git-hooks/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | node common/scripts/install-run-rush.js commitlint || exit $? #++ -------------------------------------------------------------------------------- /common/git-hooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while read local_ref local_sha remote_ref remote_sha 4 | do 5 | # 检查是否是删除操作 6 | if [ "$local_sha" = "0000000000000000000000000000000000000000" ]; then 7 | echo "Ignoring push deletion. Skipping local test." 8 | exit 0 9 | fi 10 | 11 | node common/scripts/install-run-rush.js test --only tag:package 12 | # 其他推送逻辑... 13 | done 14 | 15 | -------------------------------------------------------------------------------- /common/scripts/get-package-json.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | function getPackageJson(pkgJsonPath) { 4 | const pkgJson = fs.readFileSync(pkgJsonPath, { encoding: 'utf-8' }) 5 | return JSON.parse(pkgJson); 6 | } 7 | 8 | module.exports = getPackageJson; -------------------------------------------------------------------------------- /common/scripts/parse-version.js: -------------------------------------------------------------------------------- 1 | // see more about the regex here: https://semver.org/lang/zh-CN/ 2 | // reg test: https://regex101.com/r/vkijKf/1/ 3 | 4 | function parseVersion(version) { 5 | const res = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm.exec(version); 6 | 7 | if (res) { 8 | return { 9 | major: +res[1], 10 | minor: +res[2], 11 | patch: +res[3], 12 | preReleaseName: res[4], 13 | preReleaseType: res[4] && res[4].includes('.') ? res[4].split('.')[0] : res[4] 14 | }; 15 | } 16 | 17 | return null; 18 | } 19 | 20 | module.exports = parseVersion -------------------------------------------------------------------------------- /docs/dev-demos/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /docs/dev-demos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 |
13 | 16 |
17 | 18 |
19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/dev-demos/public/data/basic.csv: -------------------------------------------------------------------------------- 1 | eruid,description 2 | batman,uses technology 3 | superman,flies through the air 4 | spiderman,uses a web 5 | ghostrider, rides a motorcycle 6 | #GROUP_OBJECT_PROFILE#accessgroupGroupProfile 7 | cn,description 8 | daredevil,this group represents daredevils 9 | superhero,this group represents superheroes -------------------------------------------------------------------------------- /docs/dev-demos/public/data/basic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "category": "A", "amount": 28, "index": 0 }, 3 | { "category": "B", "amount": 55, "index": 1 }, 4 | { "category": "C", "amount": 43, "index": 2 }, 5 | { "category": "D", "amount": 91, "index": 3 }, 6 | { "category": "E", "amount": 81, "index": 4 }, 7 | { "category": "F", "amount": 53, "index": 5 }, 8 | { "category": "G", "amount": 19, "index": 6 }, 9 | { "category": "H", "amount": 87, "index": 7 } 10 | ] 11 | -------------------------------------------------------------------------------- /docs/dev-demos/src/api/multi-states.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | import { IView } from '@visactor/vgrammar'; 3 | 4 | const originData = [ 5 | { category: 'A', amount: 28, index: 0 }, 6 | { category: 'B', amount: 55, index: 1 }, 7 | { category: 'C', amount: 43, index: 2 }, 8 | { category: 'D', amount: 91, index: 3 }, 9 | { category: 'E', amount: 81, index: 4 }, 10 | { category: 'F', amount: 53, index: 5 }, 11 | { category: 'G', amount: 19, index: 6 }, 12 | { category: 'H', amount: 87, index: 7 } 13 | ]; 14 | 15 | export const runner = (view: IView) => { 16 | const data = view.data(originData); 17 | }; 18 | 19 | export const callback = (view: IView) => { 20 | // do nothing 21 | }; 22 | -------------------------------------------------------------------------------- /docs/dev-demos/src/color-utils.ts: -------------------------------------------------------------------------------- 1 | export const category20 = [ 2 | '#1f77b4', 3 | '#aec7e8', 4 | '#ff7f0e', 5 | '#ffbb78', 6 | '#2ca02c', 7 | '#98df8a', 8 | '#d62728', 9 | '#ff9896', 10 | '#9467bd', 11 | '#c5b0d5', 12 | '#8c564b', 13 | '#c49c94', 14 | '#e377c2', 15 | '#f7b6d2', 16 | '#7f7f7f', 17 | '#c7c7c7', 18 | '#bcbd22', 19 | '#dbdb8d', 20 | '#17becf', 21 | '#9edae5' 22 | ]; 23 | 24 | export const category10 = [ 25 | '#1f77b4', 26 | '#ff7f0e', 27 | '#2ca02c', 28 | '#d62728', 29 | '#9467bd', 30 | '#8c564b', 31 | '#e377c2', 32 | '#7f7f7f', 33 | '#bcbd22', 34 | '#17becf' 35 | ]; 36 | -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_bears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_bears.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_bears2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_bears2.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_dolphin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_dolphin.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_logo.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_man2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_man2.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_man4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_man4.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_moustache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_moustache.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_recycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_recycle.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_test2.png -------------------------------------------------------------------------------- /docs/dev-demos/src/image/shape_tie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/dev-demos/src/image/shape_tie.png -------------------------------------------------------------------------------- /docs/dev-demos/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare module "react/jsx-runtime" { 3 | export default any; 4 | } 5 | -------------------------------------------------------------------------------- /docs/site/assets/api/en/API/GroupMark.md: -------------------------------------------------------------------------------- 1 | # GroupMark 2 | 3 | Group Graphics 4 | Inherits `Mark`, all APIs supported by `Mark` can be called on `Component` instances. 5 | 6 | ## Instance Methods 7 | 8 | ### appendChild 9 | 10 | Add a child graphic 11 | 12 | ```ts 13 | (mark: IMark | IGroupMark | IGlyphMark) => this; 14 | ``` 15 | 16 | ### removeChild 17 | 18 | Remove child graphic 19 | 20 | ```ts 21 | (mark: IMark | IGroupMark | IGlyphMark) => this; 22 | ``` 23 | -------------------------------------------------------------------------------- /docs/site/assets/api/zh/API/GlyphMark.md: -------------------------------------------------------------------------------- 1 | # GlyphMark 2 | 3 | 组合图元 4 | 继承`Mark`,所有`Mark`支持的 API,都能在`Component`实例上调用 5 | 6 | ## 实例属性 7 | 8 | ### glyphType 9 | 10 | 类型: `string` 11 | 12 | 组合图元的类型,现在内置了以下几种类型: 13 | 14 | - 'linkPath' 15 | 16 | ## 实例方法 17 | 18 | ### getGlyphMeta 19 | 20 | 获取组合图元的元数据 21 | 22 | ```ts 23 | () => IGlyphMeta; 24 | ``` 25 | 26 | ### configureGlyph 27 | 28 | 配置组合图元 29 | 30 | ```ts 31 | (glyph: IGlyph) => => this; 32 | ``` 33 | 34 | ### getGlyphConfig 35 | 36 | 获取组合图元的配置 37 | 38 | ```ts 39 | () => any; 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/site/assets/api/zh/API/GroupMark.md: -------------------------------------------------------------------------------- 1 | # GroupMark 2 | 3 | Group 图元 4 | 继承`Mark`,所有`Mark`支持的 API,都能在`Component`实例上调用 5 | 6 | ## 实例方法 7 | 8 | ### appendChild 9 | 10 | 添加子图元 11 | 12 | ```ts 13 | (mark: IMark | IGroupMark | IGlyphMark) => this; 14 | ``` 15 | 16 | ### removeChild 17 | 18 | 删除子图元 19 | 20 | ```ts 21 | (mark: IMark | IGroupMark | IGlyphMark) => this; 22 | ``` 23 | -------------------------------------------------------------------------------- /docs/site/assets/api/zh/API/Projection.md: -------------------------------------------------------------------------------- 1 | # Projection 2 | 3 | 图形语法元素 - 投影 4 | 5 | ## 实例方法 6 | 7 | ### id 8 | 9 | 设置或者读取组件的唯一标识符`id`。 10 | 11 | ### name 12 | 13 | 设置或者读取组件的名称`name`。 14 | 15 | ### depend 16 | 17 | 设置依赖的语法元素,ts 类型定义如下: 18 | 19 | ```ts 20 | (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this; 21 | ``` 22 | 23 | 参数可以是其他语法元素的实例,也可以是一个语法元素对应的`id`。 24 | 25 | ### clear 26 | 27 | 清除当前语法元素所有的配置 28 | 29 | ### release 30 | 31 | 释放销毁该语法元素实例 32 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/common/grammar.md: -------------------------------------------------------------------------------- 1 | {{ target: common-grammar }} 2 | 3 | 4 | 5 | #${prefix} id(string) 6 | 7 | The id of the ${grammarType}, which can be used for reference in other elements 8 | 9 | #${prefix} name(string) 10 | 11 | The name of the ${grammarType}, which can be used for querying the ${grammarType} 12 | 13 | #${prefix} dependency 14 | 15 | Type that can be passed: (IGrammarBase[] | IGrammarBase | string[] | string) 16 | 17 | The other elements that the current ${grammarType} depends on, can be the id of the element, or the element itself 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/common/image.md: -------------------------------------------------------------------------------- 1 | {{ target: common-image }} 2 | 3 | Image, supporting multiple formats: 4 | 5 | - `string`: Image URL 6 | - `HTMLImageElement`: The `image` tag corresponding to the image 7 | - `HTMLCanvasElement`: The `canvas` tag corresponding to the image 8 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/coordinates/index.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-index }} 2 | 3 | # coordinates 4 | 5 | Coordinate system configuration, VGrammar currently has two built-in types of coordinate systems 6 | 7 | {{ use: common-grammar( 8 | prefix = '#', 9 | grammarType = 'coordinate' 10 | ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/coordinates/polar.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-polar }} 2 | 3 | # coordinates.polar 4 | 5 | Polar coordinate system, which can convert Cartesian coordinate system coordinates into polar coordinate system coordinates and can be used to transform Cartesian coordinate system charts into polar coordinate system charts. 6 | 7 | ## type(string) = 'polar' 8 | 9 | Set the coordinate system type to polar coordinate system 10 | 11 | {{ use: coordinates-base() }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/coordinates/rect.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-rect }} 2 | 3 | # coordinates.rect 4 | 5 | Rectangular coordinate system, which can set transformations on it to achieve chart transformations, such as row and column transposition. 6 | 7 | ## type(string) = 'rect' 8 | 9 | Set the type to a rectangular coordinate system 10 | 11 | {{ use: coordinates-base() }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/arc.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-arc }} 2 | 3 | # marks.arc(Object) 4 | 5 | ** arc element ** 6 | 7 | ## type(string) = 'arc' 8 | 9 | Set the element type to `arc` 10 | 11 | {{ use: marks-encode(type = 'arc', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'arc') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/arc3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-arc3d }} 2 | 3 | # marks.arc3d(Object) 4 | 5 | ** arc3d Graphic Element ** 6 | 7 | ## type(string) = 'arc3d' 8 | 9 | Set the graphic element type as `arc3d` 10 | 11 | {{ use: marks-encode(type = 'arc3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'arc3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/area.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-area }} 2 | 3 | # marks.area(Object) 4 | 5 | ** area mark ** 6 | 7 | ## type(string) = 'area' 8 | 9 | Set the mark type to `area` 10 | 11 | 12 | ## enableSegments(boolean) 13 | 14 | Whether to enable segmented style; because parsing segmented style requires a certain performance cost, it will only be automatically enabled when the feature is turned on, and all points correspond to different styles. 15 | 16 | {{ use: marks-encode(type = 'area', prefix = '#') }} 17 | 18 | {{ use: marks-animate(type = 'area') }} 19 | 20 | {{ use: marks-base( prefix = '#' ) }} 21 | {{ use: marks-common-large( prefix = '#' ) }} 22 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/cell.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-cell }} 2 | 3 | # marks.cell(Object) 4 | 5 | ** Cell Graphic Element ** 6 | 7 | ## type(string) = 'cell' 8 | 9 | Set the graphic element type to `cell` 10 | 11 | {{ use: marks-encode(type = 'cell', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'cell') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/circle.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-circle }} 2 | 3 | # marks.circle(Object) 4 | 5 | ** circle graphic element ** 6 | 7 | ## type(string) = 'circle' 8 | 9 | Set the graphic element type to `circle` 10 | 11 | {{ use: marks-encode(type = 'circle', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'circle') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/common/fieldEncode.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-fieldEncode }} 2 | 3 | The type definition is: 4 | 5 | ```ts 6 | type FieldEncodeType = { 7 | field: string; 8 | }; 9 | ``` 10 | 11 | The `field` setting reads the value from the corresponding field in the related data. -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/common/funtionType.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-functionType }} 2 | 3 | Support two types of setting methods: 4 | 5 | - `${returnType}` type 6 | - `function` type, calculate the result through custom function, where the ts type definition of the function is: 7 | 8 | ``` 9 | (datum: any, el: IElement, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | The `parameters` are the other syntax elements that this mark syntax element depends on. -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/common/large.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-large }} 2 | 3 | #${prefix} large(boolean) 4 | 5 | Whether to enable large data rendering mode 6 | 7 | #${prefix} largeThreshold(number) 8 | 9 | The threshold for enabling large data rendering optimization, corresponding to the length of data 10 | 11 | #${prefix} progressiveStep(number) 12 | 13 | The step length for enabling progressive rendering, corresponding to the length of data in each shard 14 | 15 | #${prefix} progressiveThreshold(number) 16 | 17 | The threshold for enabling progressive rendering, corresponding to the length of single series data -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/common/scale.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-scale }} 2 | 3 | #${prefix} scale 4 | 5 | Set the associated `scale` grammar element, supporting two types of settings: 6 | 7 | - The id corresponding to the `string` grammar element 8 | - The instance corresponding to the `IScale` grammar element, mainly used for API creation mode -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/component.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component }} 2 | 3 | # marks.component(Object) 4 | 5 | ** component Graphics ** 6 | 7 | ## type(string) = 'component' 8 | 9 | Set the graphics type to `component` 10 | 11 | ## componentType(string) 12 | 13 | Set the type of the component 14 | 15 | {{ use: marks-component-axis() }} 16 | {{ use: marks-component-datazoom() }} 17 | {{ use: marks-component-label() }} 18 | {{ use: marks-component-legend() }} 19 | {{ use: marks-component-player() }} 20 | {{ use: marks-component-slider() }} 21 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/component/label.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-label }} 2 | 3 | ## componentType.label(Object) 4 | 5 | ### componentType(string) = 'label' 6 | 7 | Set the component type to `label` 8 | 9 | ### labelStyle(object) 10 | 11 | Set the style of the label 12 | 13 | ### size 14 | 15 | When associating with the `symbol` element, set the `size` visual channel for the corresponding `symbol` 16 | 17 | {{ use: marks-common-markTarget( prefix = '##' ) }} 18 | 19 | {{ use: marks-encode(type = 'label', prefix = '##') }} 20 | 21 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/component/legend.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-legend }} 2 | 3 | ## componentType.legend(Object) 4 | 5 | ### componentType(string) = 'legend' 6 | 7 | Set the component type to `legend` 8 | 9 | ### legendType(string) 10 | 11 | Set the legend type 12 | 13 | - 'auto' Automatically resolve based on the associated `scale` 14 | - 'discrete' Discrete type 15 | - 'color' Color type 16 | - 'size' Size type 17 | 18 | {{ use: marks-common-scale( prefix = '##' ) }} 19 | 20 | {{ use: marks-common-target( 21 | prefix = '##', 22 | type = 'legend', 23 | filterValueType = 'any[]' 24 | ) }} 25 | 26 | {{ use: marks-encode(type = 'legend', prefix = '##') }} 27 | 28 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/component/player.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-player }} 2 | 3 | ## componentType.player(Object) 4 | 5 | ### componentType(string) = 'player' 6 | 7 | Sets the component type to `player` 8 | 9 | ### playerType(string) 10 | 11 | Supported types: 12 | 13 | - 'auto' 14 | - 'discrete' 15 | - 'continuous' 16 | 17 | {{ use: marks-common-target( 18 | prefix = '##', 19 | type = 'player' 20 | ) }} 21 | 22 | {{ use: marks-encode(type = 'player', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/component/slider.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-slider }} 2 | 3 | ## componentType.slider(Object) 4 | 5 | ### componentType(string) = 'slider' 6 | 7 | Set the component type to `slider` 8 | 9 | ### min(number) 10 | 11 | Set the minimum value 12 | 13 | ### max(number) 14 | 15 | Set the maximum value 16 | 17 | {{ use: marks-common-target( 18 | prefix = '##', 19 | type = 'slider', 20 | filterValueType = '{ start: number; end: number }' 21 | ) }} 22 | 23 | {{ use: marks-encode(type = 'slider', prefix = '##') }} 24 | 25 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/glyph.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph }} 2 | 3 | # marks.glyph(Object) 4 | 5 | ** glyph Chart Element ** 6 | 7 | ## type(string) = 'glyph' 8 | 9 | Set the chart element type to `glyph` 10 | 11 | ## glyphType(string) 12 | 13 | Set the glyph type, supporting built-in glyph types, as well as custom registered glyph types 14 | 15 | {{ use: marks-glyph-barboxplot() }} 16 | {{ use: marks-glyph-boxplot() }} 17 | {{ use: marks-glyph-linkpath() }} 18 | {{ use: marks-glyph-ripplepoint() }} 19 | {{ use: marks-glyph-wave() }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/glyph/linkpath.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-linkpath }} 2 | 3 | ## glyphType.linkPath(Object) 4 | 5 | Execute `registerLinkPathGlyph()` to register the linkPath glyph before using it 6 | 7 | ### glyphType(string) = 'linkPath' 8 | 9 | Set the glyph type to `linkPath` 10 | 11 | ### glyphConfig 12 | 13 | Supported glyph configurations include: 14 | 15 | - `direction`: `'vertical'|'horizontal'`, the direction of the linkPath glyph, default is `'vertical'` 16 | 17 | ### animation 18 | 19 | {{ use: marks-encode(type = 'linkPath', prefix = '##') }} 20 | 21 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/glyph/ripplepoint.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-ripplepoint }} 2 | 3 | ## glyphType.ripplePoint(Object) 4 | 5 | Execute `registerRippleGlyph()` to register the ripplePoint glyph before using it. 6 | 7 | ### glyphType(string) = 'ripplePoint' 8 | 9 | Set the glyph type to `ripplePoint` 10 | 11 | ### animation 12 | 13 | Implement the loop playback of ripples through the `ripple` channel: 14 | 15 | ```json 16 | { 17 | "channel": { "ripple": { "from": 0, "to": 1 } }, 18 | "loop": true 19 | } 20 | ``` 21 | 22 | {{ use: marks-encode(type = 'ripplePoint', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/glyph/wave.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-wave }} 2 | 3 | ## glyphType.wave(Object) 4 | 5 | You need to perform `registerWaveGlyph()` to register the wave glyph before using it 6 | 7 | ### glyphType(string) = 'wave' 8 | 9 | Set the glyph type to `wave` 10 | 11 | ### animation 12 | 13 | You can implement the ripple loop playback through the `wave` channel: 14 | 15 | ```json 16 | { 17 | "channel": { "wave": { "from": 0, "to": 1 } }, 18 | "loop": true 19 | } 20 | ``` 21 | 22 | {{ use: marks-encode(type = 'wave', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/group.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-group }} 2 | 3 | # marks.group(Object) 4 | 5 | ** group Mark ** 6 | 7 | ## type(string) = 'group' 8 | 9 | Set the mark type to `group` 10 | 11 | ## clip(boolean)=false 12 | 13 | Whether the `group` mark clips its child marks 14 | 15 | {{ use: marks-encode(type = 'group', prefix = '#') }} 16 | {{ use: marks-animate(type = 'group') }} 17 | {{ use: marks-base( prefix = '#' ) }} 18 | {{ use: marks-common-large( prefix = '#' ) }} 19 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/image.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-image }} 2 | 3 | # marks.image(Object) 4 | 5 | **Image mark** 6 | 7 | ## type(string) = 'image' 8 | 9 | Set the mark type to `image` 10 | 11 | {{ use: marks-encode(type = 'image', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'image') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/index.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-index }} 2 | 3 | # marks 4 | 5 | Graphic element configuration, supporting multiple types 6 | 7 | {{ use: common-grammar( 8 | prefix = '#', 9 | grammarType = 'mark' 10 | ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/interval.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-interval }} 2 | 3 | # marks.interval(Object) 4 | 5 | ** Interval Graphic element ** 6 | 7 | ## type(string) = 'interval' 8 | 9 | Set the graphic element type to `interval` 10 | 11 | {{ use: marks-encode(type = 'interval', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'interval') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/path.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-path }} 2 | 3 | # marks.path(Object) 4 | 5 | ** Path element ** 6 | 7 | ## type(string) = 'path' 8 | 9 | Set the element type to `path` 10 | 11 | {{ use: marks-encode(type = 'path', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'path') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/polygon.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-polygon }} 2 | 3 | # marks.polygon(Object) 4 | 5 | ** polygon mark ** 6 | 7 | ## type(string) = 'polygon' 8 | 9 | Set the mark type to `polygon` 10 | 11 | {{ use: marks-encode(type = 'polygon', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'polygon') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/pyramid3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-pyramid3d }} 2 | 3 | # marks.pyramid3d(Object) 4 | 5 | ** pyramid3d primitive ** 6 | 7 | ## type(string) = 'pyramid3d' 8 | 9 | Set the primitive type to `pyramid3d` 10 | 11 | {{ use: marks-encode(type = 'pyramid3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'pyramid3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/rect.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rect }} 2 | 3 | # marks.rect(Object) 4 | 5 | ** Rectangle Element ** 6 | 7 | ## type(string) = 'rect' 8 | 9 | Set the element type to `rect` 10 | 11 | {{ use: marks-encode(type = 'rect', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'rect') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/rect3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rect3d }} 2 | 3 | # marks.rect3d(Object) 4 | 5 | ** rect3d Primitive ** 6 | 7 | ## type(string) = 'rect3d' 8 | 9 | Set the primitive type to `rect3d` 10 | 11 | {{ use: marks-encode(type = 'rect3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'rect3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | ``` -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/richtext.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-richtext }} 2 | 3 | # marks.richtext(Object) 4 | 5 | ** Richtext Graphic Element ** 6 | 7 | ## type(string) = 'richtext' 8 | 9 | Set the graphic element type to `richtext` 10 | 11 | {{ use: marks-encode(type = 'richtext', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'richtext') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/rule.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rule }} 2 | 3 | # marks.rule (Object) 4 | 5 | ** Rule geom ** 6 | 7 | ## type (string) = 'rule' 8 | 9 | Set the geom type to `rule` 10 | 11 | {{ use: marks-encode (type = 'rule', prefix = '#') }} 12 | 13 | {{ use: marks-animate (type = 'rule') }} 14 | 15 | {{ use: marks-base (prefix = '#') }} 16 | {{ use: marks-common-large (prefix = '#') }} 17 | {{ use: marks-common-morph (prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/shape.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-shape }} 2 | 3 | # marks.shape(Object) 4 | 5 | ** shape Primitive ** 6 | 7 | ## type(string) = 'shape' 8 | 9 | Set the primitive type to `shape` 10 | 11 | {{ use: marks-encode(type = 'shape', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'shape') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/symbol.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-symbol }} 2 | 3 | # marks.symbol(Object) 4 | 5 | **Symbol Element** 6 | 7 | ## type(string) = 'symbol' 8 | 9 | Sets the element type as `symbol`. 10 | 11 | {{ use: marks-encode(type = 'symbol', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'symbol') }} 14 | 15 | {{ use: marks-base(prefix = '#') }} 16 | {{ use: marks-common-large(prefix = '#') }} 17 | {{ use: marks-common-morph(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/marks/text.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-text }} 2 | 3 | # marks.text(Object) 4 | 5 | ** text primitive ** 6 | 7 | ## type(string) = 'text' 8 | 9 | Set the primitive type to `text` 10 | 11 | {{ use: marks-encode(type = 'text', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'text') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/projections/function.md: -------------------------------------------------------------------------------- 1 | {{ target: projections-function }} 2 | 3 | Supports two types of setting methods 4 | 5 | - `${returnType}` type 6 | - `function` type, calculating the result through a custom function, with the ts type definition of the function being: 7 | 8 | ``` 9 | (projection: any, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | where `parameters` are the other syntax elements that this `projection` syntax element depends on. -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/common/domain.md: -------------------------------------------------------------------------------- 1 | {{target: scales-common-domain}} 2 | 3 | 4 | 5 | #${prefix} domain(Object) 6 | 7 | Set the domain of the `scale`, supporting two formats of settings: 8 | 9 | - Object type, with the specific type definition as follows: 10 | 11 | ```ts 12 | { 13 | data: string | IData; 14 | field: string | string[]; 15 | sort?: (datumA: any, datumB: any) => number 16 | } 17 | ``` 18 | 19 | - Custom function type, with the specific type definition as follows: 20 | 21 | ```ts 22 | (scale: IBaseScale, parameters: any) => any; 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/common/function.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-function }} 2 | 3 | Supports two formats for settings 4 | 5 | - `${returnType}` type 6 | - `function` type, calculating the result through custom functions, and the ts type definition of the function is: 7 | 8 | ``` 9 | (scale: IBaseScale, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | Where `parameters` are the other syntax elements that the scale syntax element depends on. -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/common/nice.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-nice }} 2 | 3 | 4 | 5 | #${prefix} nice 6 | 7 | For scale, calculate the optimized ticks and update the `domain` based on the tick values. It supports multiple types of values: 8 | 9 | - `boolean`: `true` means automatic calculation, `false` means no optimization 10 | - `number`: The number of optimized ticks -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/common/niceminmax.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-niceminmax }} 2 | 3 | 4 | 5 | #${prefix} niceMin 6 | 7 | Optimize only the minimum value of the `domain`, keep the maximum value unchanged, and support multiple values: 8 | 9 | - `boolean`: `true` means automatic calculation, `false` means no optimization 10 | - `number`: indicates the number of ticks after optimization 11 | 12 | #${prefix} niceMax 13 | 14 | Optimize only the maximum value of the `domain`, keep the minimum value unchanged, and support multiple values: 15 | 16 | - `boolean`: `true` means automatic calculation, `false` means no optimization 17 | - `number`: indicates the number of ticks after optimization -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/index.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-index }} 2 | 3 | # scales(Array) 4 | 5 | Scale related configuration -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/linear.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-linear }} 2 | 3 | # scales.linear 4 | 5 | ## type(string) = 'linear' 6 | 7 | Set the scale type to `linear` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} 18 | 19 | ## roundRange(boolean) 20 | 21 | Whether to round the value range automatically 22 | 23 | ## config(object) 24 | 25 | Configuration options for `scale` 26 | 27 | ### clamp(boolean) 28 | 29 | Range of clamp values 30 | 31 | ### interpolate(function) 32 | 33 | Interpolation function -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/ordinal.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-ordinal }} 2 | 3 | # scales.ordinal 4 | 5 | ## type(string) = 'ordinal' 6 | 7 | Set the scale type to `ordinal` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/point.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-point }} 2 | 3 | # scales.point 4 | 5 | ## type(string) = 'point' 6 | 7 | Set the scale type to `point`. 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/quantile.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-quantile }} 2 | 3 | # scales.quantile 4 | 5 | ## type(string) = 'quantile' 6 | 7 | Set the scale type to `quantile` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/quantize.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-quantize }} 2 | 3 | # scales.quantize 4 | 5 | ## type(string) = 'quantize' 6 | 7 | Set the scale type to `quantize` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/sqrt.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-sqrt }} 2 | 3 | # scales.sqrt 4 | 5 | ## type(string) = 'sqrt' 6 | 7 | Set the scale type to `sqrt` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} 18 | 19 | ## roundRange(boolean) 20 | 21 | Whether to round the value range automatically 22 | 23 | ## config(object) 24 | 25 | Configuration options for `scale` 26 | 27 | ### clamp(boolean) 28 | 29 | Value range of clamp 30 | 31 | ### interpolate(function) 32 | 33 | Interpolation function -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/threshold.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-threshold }} 2 | 3 | # scales.threshold 4 | 5 | ## type(string) = 'threshold' 6 | 7 | Set the scale type to `threshold` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/time.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-time }} 2 | 3 | # scales.time 4 | 5 | ## type(string) = 'time' 6 | 7 | Set the scale type to `time` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-uservalue(prefix = '#') }} 16 | 17 | ## roundRange(boolean) 18 | 19 | Whether to automatically round the value range 20 | 21 | ## config(object) 22 | 23 | Configuration options for `scale` 24 | 25 | ### clamp(boolean) 26 | 27 | Value range of clamp 28 | 29 | ### interpolate(function) 30 | 31 | Interpolation function -------------------------------------------------------------------------------- /docs/site/assets/option/en/scales/utc.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-utc }} 2 | 3 | # scales.utc 4 | 5 | ## type(string) = 'utc' 6 | 7 | Set the scale type to `utc` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-uservalue(prefix = '#') }} 16 | 17 | ## roundRange(boolean) 18 | 19 | Whether to round the range automatically 20 | 21 | ## config(object) 22 | 23 | Configuration options for `scale` 24 | 25 | ### clamp(boolean) 26 | 27 | Clamp the value range 28 | 29 | ### interpolate(function) 30 | 31 | Interpolation function -------------------------------------------------------------------------------- /docs/site/assets/option/en/signals/index.md: -------------------------------------------------------------------------------- 1 | {{ target: signals-index }} 2 | 3 | 4 | 5 | # signals(Array) 6 | 7 | Used to create dynamic variables 8 | 9 | {{ use: common-grammar( 10 | prefix = '#', 11 | grammarType = 'signal' 12 | ) }} 13 | 14 | ## value 15 | 16 | The current value of the signal 17 | 18 | ## update 19 | 20 | The update method for the signal -------------------------------------------------------------------------------- /docs/site/assets/option/en/transform/extent.md: -------------------------------------------------------------------------------- 1 | {{target: transform-extent}} 2 | 3 | ## transform.extent(Object) 4 | 5 | ### type(string) = 'extent' 6 | 7 | Set the data transformation type to `'extent'` 8 | 9 | ### field 10 | 11 | Set the data field, supporting two types: 12 | 13 | - string - A string to get the value under the specified field in the array element, supports the format of 'a.b', to get the value in the data element `{ a: { b: 12 } }` 14 | - function - Function type, a custom callback function for obtaining data 15 | -------------------------------------------------------------------------------- /docs/site/assets/option/en/transform/filter.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-filter }} 2 | 3 | ## transform.filter(Object) 4 | 5 | Implement filter transformation on data 6 | 7 | ### type(string) = filter 8 | 9 | Set the data transformation type to `filter` 10 | 11 | ### callback 12 | 13 | The callback function for performing filtering, return a boolean value 14 | 15 | {{ use: common-callback() }} -------------------------------------------------------------------------------- /docs/site/assets/option/en/transform/map.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-map }} 2 | 3 | ## transform.map(Object) 4 | 5 | Implement filtering transformation for data 6 | 7 | ### type(string) = map 8 | 9 | Type of transformation 10 | 11 | ### callback 12 | 13 | The callback function to perform the transformation. The callback function will receive two parameters 14 | 15 | {{ use: common-callback() }} 16 | 17 | ### as(string) 18 | 19 | Perform a transformation for each element in the array, and set the result of the transformation to the key declared by `as` 20 | 21 | ### all(boolean) = false 22 | 23 | Whether to get the entire data and perform a custom transformation. By default, the transformation is performed on a specific element in the array. -------------------------------------------------------------------------------- /docs/site/assets/option/en/transform/range.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-range }} 2 | 3 | ## transform.range(Object) 4 | 5 | Used to create a numeric array from the given start value up to but not including the end value 6 | 7 | ### type(string)='range' 8 | 9 | Set the data transformation type to `'range'`, used to create a numeric array from the given start value up to but not including the end value 10 | 11 | ### start(number) 12 | 13 | Set the start value 14 | 15 | ### stop(number) 16 | 17 | Set the end value 18 | 19 | ### step(number)=1 20 | 21 | Step value, default is 1 22 | 23 | ### as(string)='data' 24 | 25 | Set the field name for writing the result -------------------------------------------------------------------------------- /docs/site/assets/option/zh/common/aggregateop.md: -------------------------------------------------------------------------------- 1 | {{ target: common-aggregateop }} 2 | 3 | 聚合函数支持的类型有如下的: 4 | 5 | - 'count' - 计数 6 | - 'missing' - 缺失值的个数 7 | - 'valid' - 合法值的个数 8 | - 'sum' - 求和 9 | - 'product' - 乘积 10 | - 'mean' - 平均值 11 | - 'average' - 平均值 12 | - 'variance' - 方差 13 | - 'variancep' - 方差比 14 | - 'stdev' - 标准差 15 | - 'stdevp' - 标准差比 16 | - 'stderr' - 标准误差 17 | - 'distinct' - 去重的个数 18 | - 'ci0' - 对原始数据进行 1000 次采样,计算置信度为 95%的 置信区间的下区间值 19 | - 'ci1' - 对原始数据进行 1000 次采样,计算置信度为 95%的 置信区间的上区间值 20 | - 'median' - 中位数 21 | - 'q1' - 1/4 分位数 22 | - 'q3' - 3/4 分位数 23 | - 'min' - 最小值 24 | - 'max' - 最大值 25 | - 'argmin' - 最小值对应的整个数组元素 26 | - 'argmax' - 最大值对应的整个数据元素 27 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/common/callback.md: -------------------------------------------------------------------------------- 1 | {{ target: common-callback }} 2 | 3 | `callback` 可以接受接受到两个参数,第一个参数是数据对象,第二个参数是语法元素 data 上依赖的参数, 4 | 5 | 如下案例中,数据依赖`test`signal 6 | 7 | ``` 8 | { 9 | signals: [{ 10 | id: 'test', 11 | value: 0, 12 | }], 13 | data: [ 14 | { 15 | id: 'table', 16 | values: [ 17 | { a: 1, b: 3, c: 5 }, 18 | ] 19 | }, 20 | { 21 | id: 'filter', 22 | source: 'table', 23 | dependency: ['test'], 24 | transform: [ 25 | { 26 | type: 'filter', 27 | callback: (datum, params) => { 28 | return data.a > params.test; 29 | }, 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/common/grammar.md: -------------------------------------------------------------------------------- 1 | {{ target: common-grammar }} 2 | 3 | 4 | 5 | #${prefix} id(string) 6 | 7 | ${grammarType}的 id,可以用于在其他元素中引用 8 | 9 | #${prefix} name(string) 10 | 11 | ${grammarType}的 name,可以用于查询该 ${grammarType} 12 | 13 | #${prefix} dependency 14 | 15 | 可传类型: (IGrammarBase[] | IGrammarBase | string[] | string) 16 | 17 | 当前${grammarType}依赖的其他元素,可以是元素的 id,也可以是元素本身 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/common/image.md: -------------------------------------------------------------------------------- 1 | {{ target: common-image }} 2 | 3 | 图片,支持多种格式: 4 | 5 | - `string` 图片地址 6 | - `HTMLImageElement` 图片对应的`image`标签 7 | - `HTMLCanvasElement` 图片对应的`canvas`标签 8 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/common/padding.md: -------------------------------------------------------------------------------- 1 | {{ target: common-padding }} 2 | 3 | ${componentName}内边距,单位 px,默认各方向内边距为 0,接受数值、数值数组以及对象设置。 4 | 5 | 使用示例: 6 | 7 | ```ts 8 | // 数值类型,设置内边距为 5 9 | padding: 5; 10 | // 数值数组,设置上下的内边距为 5,左右的内边距为 10,用法同 CSS 盒模型 11 | padding: [5, 10]; 12 | // 数值数组,分别设置四个方向的内边距 13 | padding: [ 14 | 5, // 上 15 | 10, // 右 16 | 5, // 下 17 | 10 // 左 18 | ]; 19 | // 对象类型 20 | padding: { 21 | top: 5, 22 | right: 10, 23 | bottom: 5, 24 | left: 10 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/coordinates/base.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-base }} 2 | 3 | ## start(array) 4 | 5 | 坐标系起始点坐标,配置类型为 `[number, number]` 6 | 7 | ## end(array) 8 | 9 | 坐标系终止点坐标,配置类型为 `[number, number]` 10 | 11 | ## origin(array) 12 | 13 | 坐标系原点坐标,配置类型为 `[number, number]` 14 | 15 | ## translate(array) 16 | 17 | 坐标系应用的额外平移变换,配置类型为 `[number, number]` 18 | 19 | ## rotate(number) 20 | 21 | 坐标系应用的额外旋转变换 22 | 23 | ## scale(array) 24 | 25 | 坐标系应用的额外缩放变换,配置类型为 `[number, number]` 26 | 27 | ## transpose(boolean) 28 | 29 | 坐标系应用的额外转置变换 30 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/coordinates/index.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-index }} 2 | 3 | # coordinates 4 | 5 | 坐标系配置,VGrammar 目前内置了两种类型的坐标系 6 | 7 | {{ use: common-grammar( 8 | prefix = '#', 9 | grammarType = 'coordinate' 10 | ) }} 11 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/coordinates/polar.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-polar }} 2 | 3 | # coordinates.polar 4 | 5 | 极坐标系,可以将直角坐标系的坐标转换为极坐标系下的坐标,可以用于将直角坐标系下的图表转换为极坐标系图表 6 | 7 | ## type(string) = 'polar' 8 | 9 | 将坐标系类型设置为极坐标系 10 | 11 | {{ use: coordinates-base() }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/coordinates/rect.md: -------------------------------------------------------------------------------- 1 | {{ target: coordinates-rect }} 2 | 3 | # coordinates.rect 4 | 5 | 直角坐标系,可以在直角坐标系上设置变换,来实现图表的行列转置等变换 6 | 7 | ## type(string) = 'rect' 8 | 9 | 将类型设置为直角坐标系 10 | 11 | {{ use: coordinates-base() }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/arc.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-arc }} 2 | 3 | # marks.arc(Object) 4 | 5 | ** arc 图元 ** 6 | 7 | ## type(string) = 'arc' 8 | 9 | 设置图元类型为 `arc` 10 | 11 | {{ use: marks-encode(type = 'arc', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'arc') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/arc3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-arc3d }} 2 | 3 | # marks.arc3d(Object) 4 | 5 | ** arc3d 图元 ** 6 | 7 | ## type(string) = 'arc3d' 8 | 9 | 设置图元类型为 `arc3d` 10 | 11 | {{ use: marks-encode(type = 'arc3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'arc3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/area.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-area }} 2 | 3 | # marks.area(Object) 4 | 5 | ** area 图元 ** 6 | 7 | ## type(string) = 'area' 8 | 9 | 设置图元类型为 `area` 10 | 11 | ## enableSegments(boolean) 12 | 13 | 是否开启分段样式;因为分段样式解析需要一定的性能消耗,所以仅在开了了该功能的时候,会检测所有的点对应的样式不一样的时候,自动开启分段样式 14 | 15 | {{ use: marks-encode(type = 'area', prefix = '#') }} 16 | 17 | {{ use: marks-animate(type = 'area') }} 18 | 19 | {{ use: marks-base( prefix = '#' ) }} 20 | {{ use: marks-common-large( prefix = '#' ) }} 21 | {{ use: marks-common-morph( prefix = '#' ) }} 22 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/cell.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-cell }} 2 | 3 | # marks.cell(Object) 4 | 5 | ** Cell 图元 ** 6 | 7 | ## type(string) = 'cell' 8 | 9 | 设置图元类型为 `cell` 10 | 11 | {{ use: marks-encode(type = 'cell', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'cell') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/circle.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-circle }} 2 | 3 | # marks.circle(Object) 4 | 5 | ** circle 图元 ** 6 | 7 | ## type(string) = 'circle' 8 | 9 | 设置图元类型为 `circle` 10 | 11 | {{ use: marks-encode(type = 'circle', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'circle') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/fieldEncode.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-fieldEncode }} 2 | 3 | 类型定义为: 4 | 5 | ```ts 6 | type FieldEncodeType = { 7 | field: string; 8 | }; 9 | ``` 10 | 11 | `field` 设置从关联数据的相应字段中读取值 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/funtionType.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-functionType }} 2 | 3 | 支持两种格式的设置方式 4 | 5 | - `${returnType}` 类型 6 | - `function` 类型,通过自定义函数计算结果,函数的 ts 类型定义为: 7 | 8 | ``` 9 | (datum: any, el: IElement, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | 其中 `parameters` 为该 mark 语法元素依赖的其他语法元素 13 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/large.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-large }} 2 | 3 | #${prefix} large(boolean) 4 | 5 | 是否开启大数据渲染模式 6 | 7 | #${prefix} largeThreshold(number) 8 | 9 | 开启大数据渲染优化的阀值,对应的是 data 的长度 10 | 11 | #${prefix} progressiveStep(number) 12 | 13 | 开启分片渲染的步长,对应的是分片的数据长度 14 | 15 | #${prefix} progressiveThreshold(number) 16 | 17 | 开启分片渲染的阀值,对应的是单系列 data 的长度 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/markTarget.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-markTarget }} 2 | 3 | #${prefix} target 4 | 5 | 关联的图元,支持关联单个图元或者多个图元,支持四种格式的配置: 6 | 7 | - `string` 关联单个图元,配置关联图元对应的 id 8 | - `string[]` 关联多个图元,配置关联图元对应的 id 9 | - `IMark` 关联单个图元,配置关联图元对应的实例,主要用于 API 创建模式 10 | - `IMark[]` 关联多个图元,配置关联图元对应的实例,主要用于 API 创建模式 11 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/morph.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-morph }} 2 | 3 | #${prefix} morph(boolean) 4 | 5 | 是否对当前图元开启全局的过渡形变动画 6 | 7 | #${prefix} morphKey(string) 8 | 9 | 用于匹配全局过渡形变动画的图元,具有相对的`morphKey`的图元,会进行形变动画 10 | 11 | #${prefix} morphElementKey(string) 12 | 13 | 对于匹配上的前后图元,通过该配置,进行图形元素的匹配;如果不申明,我们默认会读取`key`配置,用于匹配图形元素,进行形变动画; 14 | 默认支持一对一、一对多、多对一的图形形变动画 15 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/scale.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-scale }} 2 | 3 | #${prefix} scale 4 | 5 | 设置关联的`scale`语法元素,支持两种类型的设置: 6 | 7 | - `string` 语法元素对应的 id 8 | - `IScale` 语法元素对应的实例,主要用于 API 创建模式 9 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/common/target.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-common-target }} 2 | 3 | #${prefix} target 4 | 5 | 设置 ${type} 触发数据更新后,需要更新的数据元素 6 | 7 | ##${prefix} data 8 | 9 | 设置更新数据对应的`data`语法元素,支持两种类型的设置: 10 | 11 | - `string` data 语法元素对应的 id 12 | - `IData` data 语法元素对应的实例,主要用于 API 创建模式 13 | 14 | {{ if: ${type} !== 'player' }} 15 | 16 | ##${prefix} filter 17 | 18 | 对目标数据元素,执行 filter 操作,支持两种类型的设置: 19 | 20 | - `string` 更新数据元素中对应的字段 21 | - `function` 自定义过滤函数,定义为:`(datum: any, value: ${filterValueType}) => boolean` 22 | 23 | {{ else }} 24 | 25 | ##${prefix} source 26 | 27 | 设置数据来源,支持三种类型的设置: 28 | 29 | - `string` data 语法元素对应的 id 30 | - `IData` data 语法元素对应的实例,主要用于 API 创建模式 31 | - `any[]` 自定义的数据 32 | 33 | {{ /if }} 34 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component }} 2 | 3 | # marks.component(Object) 4 | 5 | ** component 图元 ** 6 | 7 | ## type(string) = 'component' 8 | 9 | 设置图元类型为 `component` 10 | 11 | ## componentType(string) 12 | 13 | 设置组件的类型 14 | 15 | {{ use: marks-component-axis() }} 16 | {{ use: marks-component-datazoom() }} 17 | {{ use: marks-component-label() }} 18 | {{ use: marks-component-legend() }} 19 | {{ use: marks-component-player() }} 20 | {{ use: marks-component-slider() }} 21 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component/axis.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-axis }} 2 | 3 | ## componentType.axis(Object) 4 | 5 | ### componentType(string) = 'axis' 6 | 7 | 将组件类型设置为 `axis` 8 | 9 | ### axisType(string) 10 | 11 | 设置轴的类型,支持两种类型的配置: 12 | 13 | - 'line' 14 | - 'circle'; 15 | 16 | ### tickCount(number) 17 | 18 | 设置刻度的个数 19 | 20 | ### inside(boolean) 21 | 22 | 坐标轴是否朝向坐标系的内部 23 | 24 | ### baseValue(number) 25 | 26 | 设置坐标值对应的基准值,比如说`x`轴对应了`y`轴基准值为`0` 27 | 28 | {{ use: marks-common-scale( prefix = '##' ) }} 29 | 30 | {{ use: marks-encode(type = 'axis', prefix = '##') }} 31 | 32 | {{ use: marks-base( prefix = '##' ) }} 33 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component/label.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-label }} 2 | 3 | ## componentType.label(Object) 4 | 5 | ### componentType(string) = 'label' 6 | 7 | 将组件类型设置为 `label` 8 | 9 | ### labelStyle(object) 10 | 11 | 设置 label 的样式 12 | 13 | ### size 14 | 15 | 当关联`symbol`图元的时候,这只`symbol`对应的`size`视觉通道 16 | 17 | {{ use: marks-common-markTarget( prefix = '##' ) }} 18 | 19 | {{ use: marks-encode(type = 'label', prefix = '##') }} 20 | 21 | {{ use: marks-base( prefix = '##' ) }} 22 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component/legend.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-legend }} 2 | 3 | ## componentType.legend(Object) 4 | 5 | ### componentType(string) = 'legend' 6 | 7 | 将组件类型设置为 `legend` 8 | 9 | ### legendType(string) 10 | 11 | 设置图例类型 12 | 13 | - 'auto' 根据关联的`scale`自动解析 14 | - 'discrete' 离散类型 15 | - 'color' 颜色类型 16 | - 'size' 大小类型 17 | 18 | {{ use: marks-common-scale( prefix = '##' ) }} 19 | 20 | {{ use: marks-common-target( 21 | prefix = '##', 22 | type = 'legend', 23 | filterValueType = 'any[]' 24 | ) }} 25 | 26 | {{ use: marks-encode(type = 'legend', prefix = '##') }} 27 | 28 | {{ use: marks-base( prefix = '##' ) }} 29 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component/player.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-player }} 2 | 3 | ## componentType.player(Object) 4 | 5 | ### componentType(string) = 'player' 6 | 7 | 将组件类型设置为 `player` 8 | 9 | ### playerType(string) 10 | 11 | 支持一下类型: 12 | 13 | - 'auto' 14 | - 'discrete' 15 | - 'continuous' 16 | 17 | {{ use: marks-common-target( 18 | prefix = '##', 19 | type = 'player' 20 | ) }} 21 | 22 | {{ use: marks-encode(type = 'player', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} 25 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/component/slider.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-component-slider }} 2 | 3 | ## componentType.slider(Object) 4 | 5 | ### componentType(string) = 'slider' 6 | 7 | 将组件类型设置为 `slider` 8 | 9 | ### min(number) 10 | 11 | 设置最小值 12 | 13 | ### max(number) 14 | 15 | 设置最大值 16 | 17 | {{ use: marks-common-target( 18 | prefix = '##', 19 | type = 'slider', 20 | filterValueType = '{ start: number; end: number }' 21 | ) }} 22 | 23 | {{ use: marks-encode(type = 'slider', prefix = '##') }} 24 | 25 | {{ use: marks-base( prefix = '##' ) }} 26 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph }} 2 | 3 | # marks.glyph(Object) 4 | 5 | ** glyph 图元 ** 6 | 7 | ## type(string) = 'glyph' 8 | 9 | 设置图元类型为 `glyph` 10 | 11 | ## glyphType(string) 12 | 13 | 设置 glyph 的类型,支持内置的 glyph 类型,以及自定义注册的 glyph 类型 14 | 15 | {{ use: marks-glyph-barboxplot() }} 16 | {{ use: marks-glyph-boxplot() }} 17 | {{ use: marks-glyph-linkpath() }} 18 | {{ use: marks-glyph-ripplepoint() }} 19 | {{ use: marks-glyph-wave() }} 20 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph/barboxplot.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-barboxplot }} 2 | 3 | ## glyphType.barBoxplot(Object) 4 | 5 | 使用 boxplot 图元前需要执行 `registerBarBoxplotGlyph()` 对 barBoxplot 图元进行注册 6 | 7 | ### glyphType(string) = 'barBoxplot' 8 | 9 | 将 glyph 类型设置为 `barBoxplot` 10 | 11 | ### glyphConfig 12 | 13 | 支持的 glyph 配置包含: 14 | 15 | - `direction`('vertical'|'horizontal'): barBoxplot 图元的方向,默认为 `'vertical'` 16 | 17 | ### animation 18 | 19 | 支持的内置动画类型包含: 20 | 21 | - `barBoxplotScaleIn`/`barBoxplotScaleOut`: barBoxplot 图元沿着中值线生长的动画 22 | 23 | {{ use: marks-encode(type = 'barBoxplot', prefix = '##') }} 24 | 25 | {{ use: marks-base( prefix = '##' ) }} 26 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph/boxplot.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-boxplot }} 2 | 3 | ## glyphType.boxplot(Object) 4 | 5 | 使用 boxplot 图元前需要执行 `registerBoxplotGlyph()` 对 boxplot 图元进行注册 6 | 7 | ### glyphType(string) = 'boxplot' 8 | 9 | 将 glyph 类型设置为 `boxplot` 10 | 11 | ### glyphConfig 12 | 13 | 支持的 glyph 配置包含: 14 | 15 | - `direction`('vertical'|'horizontal'): boxplot 图元的方向,默认为 `'vertical'` 16 | 17 | ### animation 18 | 19 | 支持的内置动画类型包含: 20 | 21 | - `boxplotScaleIn`/`boxplotScaleOut`: boxplot 图元沿着中值线生长的动画 22 | 23 | {{ use: marks-encode(type = 'boxplot', prefix = '##') }} 24 | 25 | {{ use: marks-base( prefix = '##' ) }} 26 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph/linkpath.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-linkpath }} 2 | 3 | ## glyphType.linkPath(Object) 4 | 5 | 使用 linkPath 图元前需要执行 `registerLinkPathGlyph()` 对 linkPath 图元进行注册 6 | 7 | ### glyphType(string) = 'linkPath' 8 | 9 | 将 glyph 类型设置为 `linkPath` 10 | 11 | ### glyphConfig 12 | 13 | 支持的 glyph 配置包含: 14 | 15 | - `direction`: `'vertical'|'horizontal'`,linkPath 图元的方向,默认为 `'vertical'` 16 | 17 | ### animation 18 | 19 | {{ use: marks-encode(type = 'linkPath', prefix = '##') }} 20 | 21 | {{ use: marks-base( prefix = '##' ) }} 22 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph/ripplepoint.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-ripplepoint }} 2 | 3 | ## glyphType.ripplePoint(Object) 4 | 5 | 使用 ripplePoint 图元前需要执行 `registerRippleGlyph()` 对 ripplePoint 图元进行注册 6 | 7 | ### glyphType(string) = 'ripplePoint' 8 | 9 | 将 glyph 类型设置为 `ripplePoint` 10 | 11 | ### animation 12 | 13 | 可以通过 `ripple` 通道实现涟漪的循环播放: 14 | 15 | ```json 16 | { 17 | "channel": { "ripple": { "from": 0, "to": 1 } }, 18 | "loop": true 19 | } 20 | ``` 21 | 22 | {{ use: marks-encode(type = 'ripplePoint', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} 25 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/glyph/wave.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-glyph-wave }} 2 | 3 | ## glyphType.wave(Object) 4 | 5 | 使用 wave 图元前需要执行 `registerWaveGlyph()` 对 wave 图元进行注册 6 | 7 | ### glyphType(string) = 'wave' 8 | 9 | 将 glyph 类型设置为 `wave` 10 | 11 | ### animation 12 | 13 | 可以通过 `wave` 通道实现涟漪的循环播放: 14 | 15 | ```json 16 | { 17 | "channel": { "wave": { "from": 0, "to": 1 } }, 18 | "loop": true 19 | } 20 | ``` 21 | 22 | {{ use: marks-encode(type = 'wave', prefix = '##') }} 23 | 24 | {{ use: marks-base( prefix = '##' ) }} 25 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/group.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-group }} 2 | 3 | # marks.group(Object) 4 | 5 | ** group 图元 ** 6 | 7 | ## type(string) = 'group' 8 | 9 | 设置图元类型为 `group` 10 | 11 | ## clip(boolean)=false 12 | 13 | `group`图元是否对子图元进行剪切操作 14 | 15 | {{ use: marks-encode(type = 'group', prefix = '#') }} 16 | {{ use: marks-animate(type = 'group') }} 17 | {{ use: marks-base( prefix = '#' ) }} 18 | {{ use: marks-common-large( prefix = '#' ) }} 19 | {{ use: marks-common-morph( prefix = '#' ) }} 20 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/image.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-image }} 2 | 3 | # marks.image(Object) 4 | 5 | ** image 图元 ** 6 | 7 | ## type(string) = 'image' 8 | 9 | 设置图元类型为 `image` 10 | 11 | {{ use: marks-encode(type = 'image', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'image') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/index.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-index }} 2 | 3 | # marks 4 | 5 | 图元配置,支持多种类型 6 | 7 | {{ use: common-grammar( 8 | prefix = '#', 9 | grammarType = 'mark' 10 | ) }} 11 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/interval.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-interval }} 2 | 3 | # marks.interval(Object) 4 | 5 | ** interval 图元 ** 6 | 7 | ## type(string) = 'interval' 8 | 9 | 设置图元类型为 `interval` 10 | 11 | {{ use: marks-encode(type = 'interval', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'interval') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/line.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-line }} 2 | 3 | 4 | 5 | 线图元 6 | 7 | # marks.line(Object) 8 | 9 | ** 线图元 ** 测试一下 10 | 11 | ## type(string) = 'line' 12 | 13 | 设置为线图元类型 14 | 15 | ## enableSegments(boolean) 16 | 17 | 是否开启分段样式;因为分段样式解析需要一定的性能消耗,所以仅在开了了该功能的时候,会检测所有的点对应的样式不一样的时候,自动开启分段样式 18 | 19 | {{ use: marks-encode(type = 'line', prefix = '#') }} 20 | 21 | {{ use: marks-animate(type = 'line') }} 22 | 23 | {{ use: marks-base( prefix = '#' ) }} 24 | {{ use: marks-common-large( prefix = '#' ) }} 25 | {{ use: marks-common-morph( prefix = '#' ) }} 26 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/path.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-path }} 2 | 3 | # marks.path(Object) 4 | 5 | ** path 图元 ** 6 | 7 | ## type(string) = 'path' 8 | 9 | 设置图元类型为 `path` 10 | 11 | {{ use: marks-encode(type = 'path', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'path') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/polygon.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-polygon }} 2 | 3 | # marks.polygon(Object) 4 | 5 | ** polygon 图元 ** 6 | 7 | ## type(string) = 'polygon' 8 | 9 | 设置图元类型为 `polygon` 10 | 11 | {{ use: marks-encode(type = 'polygon', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'polygon') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/pyramid3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-pyramid3d }} 2 | 3 | # marks.pyramid3d(Object) 4 | 5 | ** pyramid3d 图元 ** 6 | 7 | ## type(string) = 'pyramid3d' 8 | 9 | 设置图元类型为 `pyramid3d` 10 | 11 | {{ use: marks-encode(type = 'pyramid3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'pyramid3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/rect.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rect }} 2 | 3 | # marks.rect(Object) 4 | 5 | ** 矩形图元 ** 6 | 7 | ## type(string) = 'rect' 8 | 9 | 设置图元类型为 `rect` 10 | 11 | {{ use: marks-encode(type = 'rect', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'rect') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/rect3d.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rect3d }} 2 | 3 | # marks.rect3d(Object) 4 | 5 | ** rect3d 图元 ** 6 | 7 | ## type(string) = 'rect3d' 8 | 9 | 设置图元类型为 `rect3d` 10 | 11 | {{ use: marks-encode(type = 'rect3d', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'rect3d') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/richtext.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-richtext }} 2 | 3 | # marks.richtext(Object) 4 | 5 | ** richtext 图元 ** 6 | 7 | ## type(string) = 'richtext' 8 | 9 | 设置图元类型为 `richtext` 10 | 11 | {{ use: marks-encode(type = 'richtext', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'richtext') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/rule.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-rule }} 2 | 3 | # marks.rule(Object) 4 | 5 | ** rule 图元 ** 6 | 7 | ## type(string) = 'rule' 8 | 9 | 设置图元类型为 `rule` 10 | 11 | {{ use: marks-encode(type = 'rule', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'rule') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/shape.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-shape }} 2 | 3 | # marks.shape(Object) 4 | 5 | ** shape 图元 ** 6 | 7 | ## type(string) = 'shape' 8 | 9 | 设置图元类型为 `shape` 10 | 11 | {{ use: marks-encode(type = 'shape', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'shape') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/symbol.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-symbol }} 2 | 3 | # marks.symbol(Object) 4 | 5 | ** symbol 图元 ** 6 | 7 | ## type(string) = 'symbol' 8 | 9 | 设置图元类型为 `symbol` 10 | 11 | {{ use: marks-encode(type = 'symbol', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'symbol') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/marks/text.md: -------------------------------------------------------------------------------- 1 | {{ target: marks-text }} 2 | 3 | # marks.text(Object) 4 | 5 | ** text 图元 ** 6 | 7 | ## type(string) = 'text' 8 | 9 | 设置图元类型为 `text` 10 | 11 | {{ use: marks-encode(type = 'text', prefix = '#') }} 12 | 13 | {{ use: marks-animate(type = 'text') }} 14 | 15 | {{ use: marks-base( prefix = '#' ) }} 16 | {{ use: marks-common-large( prefix = '#' ) }} 17 | {{ use: marks-common-morph( prefix = '#' ) }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/projections/function.md: -------------------------------------------------------------------------------- 1 | {{ target: projections-function }} 2 | 3 | 支持两种格式的设置方式 4 | 5 | - `${returnType}` 类型 6 | - `function` 类型,通过自定义函数计算结果,函数的 ts 类型定义为: 7 | 8 | ``` 9 | (projection: any, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | 其中 `parameters` 为该 `projection` 语法元素依赖的其他语法元素 13 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/band.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-band }} 2 | 3 | # scales.band 4 | 5 | `band`刻度主要用于将离散的数据,映射到连续的区间 6 | 7 | ## type(string) = 'band' 8 | 9 | 设置刻度类型为 `band` 10 | 11 | {{ use: scales-common-domain(prefix = '#') }} 12 | 13 | {{ use: scales-common-range(prefix = '#') }} 14 | 15 | ## round(boolean)=false 16 | 17 | 类型为: `ScaleFunctionType` 18 | 对分段的坐标,是否自动取整,支持多种值: 19 | 20 | - `boolean` 21 | - `function`,接受参数`scale`和`params`,返回一个`boolean`值 22 | 23 | ## padding(number) 24 | 25 | 将`paddingInner`和`paddingOuter`的值统一设置为一个值 26 | 27 | ## paddingInner(number) 28 | 29 | 分组之间的 padding 占比 30 | 31 | ## paddingOuter(number) 32 | 33 | 外部 padding 占比 34 | 35 | ## align(number) 36 | 37 | 对齐的点,默认居中对齐 38 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/common/domain.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-domain }} 2 | 3 | 4 | 5 | #${prefix} domain(Object) 6 | 7 | 设置`scale`的定义域,支持两种格式的设置: 8 | 9 | - 对象类型,具体类型定义如下: 10 | 11 | ```ts 12 | { 13 | data: string | IData; 14 | field: string | string[]; 15 | sort?: (datumA: any, datumB: any) => number 16 | } 17 | ``` 18 | 19 | - 自定义函数类型,具体的类型定义如下: 20 | 21 | ```ts 22 | (scale: IBaseScale, parameters: any) => any; 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/common/function.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-function }} 2 | 3 | 支持两种格式的设置方式 4 | 5 | - `${returnType}` 类型 6 | - `function` 类型,通过自定义函数计算结果,函数的 ts 类型定义为: 7 | 8 | ``` 9 | (scale: IBaseScale, parameters: any) => ${returnType}; 10 | ``` 11 | 12 | 其中 `parameters` 为该 scale 语法元素依赖的其他语法元素 13 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/common/nice.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-nice }} 2 | 3 | 4 | 5 | #${prefix} nice 6 | 7 | 对于 scale,计算出优化后的刻度,根据刻度值,来更新`domain`,支持多种值: 8 | 9 | - `boolean`:`true`表示自动计算,`false`表示不进行优化 10 | - `number`:表示优化后的刻度个数 11 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/common/niceminmax.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-niceminmax }} 2 | 3 | 4 | 5 | #${prefix} niceMin 6 | 7 | 只对`domain`的最小值进行优化,最大值不变,支持多种值: 8 | 9 | - `boolean`:`true`表示自动计算,`false`表示不进行优化 10 | - `number`:表示优化后的刻度个数 11 | 12 | #${prefix} niceMax 13 | 14 | 只对`domain`的最大值进行优化,最小值不变,支持多种值: 15 | 16 | - `boolean`:`true`表示自动计算,`false`表示不进行优化 17 | - `number`:表示优化后的刻度个数 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/common/uservalue.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-common-uservalue }} 2 | 3 | 4 | 5 | #${prefix} zero(boolean) 6 | 7 | 对于 scale,根据数据计算出一个原始的值域,也就是`domain`,然后在如下两种情况下,更新`domain`的值: 8 | 9 | - 如果最小值大于`0`,将`domain`的最小值设置为`0` 10 | - 如果最大值小于`0`,将`domain`的最大值设置为`0` 11 | 12 | 当用户非常关心`0`这个基准值的时候,可以设置为`true`,默认为`false`。 13 | 14 | #${prefix} min(number) 15 | 16 | 根据数据计算出一个原始的值域,也就是`domain`,如果最小值大于用户配置的`min`,将`domain`的最小值设置为`min` 17 | 18 | #${prefix} max(number) 19 | 20 | 根据数据计算出一个原始的值域,也就是`domain`,如果最大值大于用户配置的`max`,将`domain`的最大值设置为`max` 21 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/index.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-index }} 2 | 3 | # scales(Array) 4 | 5 | 刻度相关配置 6 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/linear.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-linear }} 2 | 3 | # scales.linear 4 | 5 | ## type(string) = 'linear' 6 | 7 | 设置刻度类型为 `linear` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} 18 | 19 | ## roundRange(boolean) 20 | 21 | 是否对值域自动取整 22 | 23 | ## config(object) 24 | 25 | `scale`的配置项 26 | 27 | ### clamp(boolean) 28 | 29 | clamp 的值域 30 | 31 | ### interpolate(function) 32 | 33 | 差值函数 34 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/log.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-log }} 2 | 3 | # scales.log 4 | 5 | ## type(string) = 'log' 6 | 7 | 设置刻度类型为 `log` 8 | 9 | ## log(number)=10 10 | 11 | `log`函数的底数,注意一定要是大于 0 的正数,默认值为 10; 12 | 13 | {{ use: scales-common-function(returnType = 'number') }} 14 | 15 | {{ use: scales-common-domain(prefix = '#') }} 16 | 17 | {{ use: scales-common-range(prefix = '#') }} 18 | 19 | {{ use: scales-common-nice(prefix = '#') }} 20 | 21 | {{ use: scales-common-uservalue(prefix = '#') }} 22 | 23 | ## roundRange(boolean) 24 | 25 | 是否对值域自动取整 26 | 27 | ## config(object) 28 | 29 | `scale`的配置项 30 | 31 | ### clamp(boolean) 32 | 33 | clamp 的值域 34 | 35 | ### interpolate(function) 36 | 37 | 差值函数 38 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/ordinal.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-ordinal }} 2 | 3 | # scales.ordinal 4 | 5 | ## type(string) = 'ordinal' 6 | 7 | 设置刻度类型为 `ordinal` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/point.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-point }} 2 | 3 | # scales.point 4 | 5 | ## type(string) = 'point' 6 | 7 | 设置刻度类型为 `point` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/quantile.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-quantile }} 2 | 3 | # scales.quantile 4 | 5 | ## type(string) = 'quantile' 6 | 7 | 设置刻度类型为 `quantile` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/quantize.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-quantize }} 2 | 3 | # scales.quantize 4 | 5 | ## type(string) = 'quantize' 6 | 7 | 设置刻度类型为 `quantize` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} 18 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/sqrt.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-sqrt }} 2 | 3 | # scales.sqrt 4 | 5 | ## type(string) = 'sqrt' 6 | 7 | 设置刻度类型为 `sqrt` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-niceminmax(prefix = '#') }} 16 | 17 | {{ use: scales-common-uservalue(prefix = '#') }} 18 | 19 | ## roundRange(boolean) 20 | 21 | 是否对值域自动取整 22 | 23 | ## config(object) 24 | 25 | `scale`的配置项 26 | 27 | ### clamp(boolean) 28 | 29 | clamp 的值域 30 | 31 | ### interpolate(function) 32 | 33 | 差值函数 34 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/threshold.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-threshold }} 2 | 3 | # scales.threshold 4 | 5 | ## type(string) = 'threshold' 6 | 7 | 设置刻度类型为 `threshold` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/time.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-time }} 2 | 3 | # scales.time 4 | 5 | ## type(string) = 'time' 6 | 7 | 设置刻度类型为 `time` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-uservalue(prefix = '#') }} 16 | 17 | ## roundRange(boolean) 18 | 19 | 是否对值域自动取整 20 | 21 | ## config(object) 22 | 23 | `scale`的配置项 24 | 25 | ### clamp(boolean) 26 | 27 | clamp 的值域 28 | 29 | ### interpolate(function) 30 | 31 | 差值函数 32 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/scales/utc.md: -------------------------------------------------------------------------------- 1 | {{ target: scales-utc }} 2 | 3 | # scales.utc 4 | 5 | ## type(string) = 'utc' 6 | 7 | 设置刻度类型为 `utc` 8 | 9 | {{ use: scales-common-domain(prefix = '#') }} 10 | 11 | {{ use: scales-common-range(prefix = '#') }} 12 | 13 | {{ use: scales-common-nice(prefix = '#') }} 14 | 15 | {{ use: scales-common-uservalue(prefix = '#') }} 16 | 17 | ## roundRange(boolean) 18 | 19 | 是否对值域自动取整 20 | 21 | ## config(object) 22 | 23 | `scale`的配置项 24 | 25 | ### clamp(boolean) 26 | 27 | clamp 的值域 28 | 29 | ### interpolate(function) 30 | 31 | 差值函数 32 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/signals/index.md: -------------------------------------------------------------------------------- 1 | {{ target: signals-index }} 2 | 3 | 4 | 5 | # signals(Array) 6 | 7 | 用于创建动态变量 8 | 9 | {{ use: common-grammar( 10 | prefix = '#', 11 | grammarType = 'signal' 12 | ) }} 13 | 14 | ## value 15 | 16 | signal 当前的值 17 | 18 | ## update 19 | 20 | signal 的更新方法 21 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/extent.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-extent }} 2 | 3 | ## transform.extent(Object) 4 | 5 | ### type(string) = 'extent' 6 | 7 | 将数据变换类型设置为`'extent'` 8 | 9 | ### field 10 | 11 | 设置数据字段,支持两种类型: 12 | 13 | - string - 字符串,获取数组元素指定字段下的值,支持'a.b'的格式,获取数据元素 `{ a: { b: 12 } }` 中的值 14 | - function - 函数类型,自定义获取数据的回调函数 15 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/filter.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-filter }} 2 | 3 | ## transform.filter(Object) 4 | 5 | 对数据实现过滤变换 6 | 7 | ### type(string) = filter 8 | 9 | 将数据变换的类型设置为 `filter` 10 | 11 | ### callback 12 | 13 | 执行过滤的回调函数,返回一个布尔值 14 | 15 | {{ use: common-callback() }} 16 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/join.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-join }} 2 | 3 | ## transform.join(Object) 4 | 5 | 数据变换 - 查询 6 | 7 | ### type(string) = join 8 | 9 | 将数据变换的类型设置为`join`,和 SQL 的`join`类似,即将两个数据源交叉查询 10 | 11 | ### from 12 | 13 | 查询的原始数据 14 | 15 | ### key(string) 16 | 17 | 原始数据的唯一标识对应的字段,支持`a.b`的格式 18 | 19 | ### fields 20 | 21 | 类型为:string[] 22 | 23 | 待执行数据变换的数据需要查询的字段 24 | 25 | ### values 26 | 27 | 类型为:string[] 28 | 29 | 来源数据中,需要查询的字段 30 | 31 | ### as 32 | 33 | 类型为:string[] 34 | 35 | 保存的字段 36 | 37 | ### default 38 | 39 | 数据缺失的时候,使用的默认值 40 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/map.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-map }} 2 | 3 | ## transform.map(Object) 4 | 5 | 对数据实现过滤变换 6 | 7 | ### type(string) = map 8 | 9 | 变换的类型 10 | 11 | ### callback 12 | 13 | 执行变换的回调函数,回调函数会拿到两个参数 14 | 15 | {{ use: common-callback() }} 16 | 17 | ### as(string) 18 | 19 | 对数组中的每个元素执行一个变换,对变换的结果设置到`as`申明的 key 中 20 | 21 | ### all(boolean) = false 22 | 23 | 是否拿到整个数据,进行自定义的变换,默认是对数组中的某个元素进行变换 24 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/pick.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-pick }} 2 | 3 | ## transform.pick(Object) 4 | 5 | 对数据实现过滤变换 6 | 7 | ### type(string) = pick 8 | 9 | 将数据变换的类型设置为`'pick'`,即从原始数据中挑选部分字段作为新数据 10 | 11 | ### fields(Array) 12 | 13 | 设置原始的数据字段或者数据计算的回调函数,支持两种类型: 14 | 15 | - string[] - 字符串数组,每个元素都是用于指定获取数组元素指定字段下的值,支持'a.b'的格式,获取数据元素 `{ a: { b: 12 } }` 中的值 16 | - function[] - 函数数组,每个元素都是自定义获取数据的回调函数 17 | 18 | ### as 19 | 20 | 类型为`string[]`,设置返回结果中的 key,如果不设置,会读取`fields`的值,当`fields`中的值为函数类型的时候,会读取函数的`fname`属性 21 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/range.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-range }} 2 | 3 | ## transform.range(Object) 4 | 5 | 用于创建从给定的起始值到但不包括结束值的数字数组 6 | 7 | ### type(string)='range' 8 | 9 | 将数据变换的类型设置为`'range'`,用于创建从给定的起始值到但不包括结束值的数字数组 10 | 11 | ### start(number) 12 | 13 | 设置起始值 14 | 15 | ### stop(number) 16 | 17 | 设置结束值 18 | 19 | ### step(number)=1 20 | 21 | 步长值,默认值为 1 22 | 23 | ### as(string)='data' 24 | 25 | 设置结果写入的字段名称 26 | -------------------------------------------------------------------------------- /docs/site/assets/option/zh/transform/unfold.md: -------------------------------------------------------------------------------- 1 | {{ target: transform-unfold }} 2 | 3 | ## transform.unfold(Object) 4 | 5 | 对数据实现过滤变换 6 | 7 | ### type(string) = unfold 8 | 9 | 将变换的类型设置为`unfold` 10 | 11 | ### groupBy 12 | 13 | 类型为`string[]`,根据申明的字段进行分组,支持单个字段分组,也支持多个字段分组 14 | 15 | ### field 16 | 17 | 读取申明的`field`对应的字段的值,作为返回结果中的 key 18 | 19 | ### value 20 | 21 | 类型:`string` 22 | 23 | 读取申明的`value`对应的字段的值,作为返回结果中的 值 24 | 25 | ### operation 26 | 27 | 设置聚合函数的类型 28 | 29 | {{ use: common-aggregateop() }} 30 | 31 | ### limit(number) = 0 32 | 33 | 对原始数据,获取唯一 key 后,返回前 `limit` 个元素,如果`limit`为 0,就返回全部 34 | 35 | ### key(string) 36 | 37 | 设置全局唯一的 key 字段,这个字段对应的结果会被设置到返回结果中;如果未设置,会根据分组字段`groupBy`的配置,自动创建唯一的 key 38 | -------------------------------------------------------------------------------- /docs/site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Documents Site 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/site/menu.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "menu": "examples", 4 | "type": "markdown" 5 | }, 6 | { 7 | "menu": "guide", 8 | "type": "markdown" 9 | }, 10 | { 11 | "menu": "option", 12 | "type": "markdown-template", 13 | "entry": "option", 14 | "sections": ["marks", "scales", "coordinates", "marks.componentType", "marks.glyphType", "data.transform"], 15 | "arrayKeys": ["glyphType", "componentType", "type"], 16 | "sectionMap": { 17 | "marks-component.componentType": "marks-component", 18 | "marks-glyph.glyphType": "marks-glyph", 19 | "data.transform": "data-transform" 20 | } 21 | }, 22 | { 23 | "menu": "api", 24 | "type": "markdown" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/3d-mark-arc3d_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/3d-mark-arc3d_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/3d-mark-pyramid3d_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/3d-mark-pyramid3d_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/3d-mark-rect3d_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/3d-mark-rect3d_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-arrange-animate_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-arrange-animate_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-basic-animate_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-basic-animate_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-custom-animate_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-custom-animate_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-loop-animate_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-loop-animate_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-morph-animate_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-morph-animate_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/animate-timeline_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/animate-timeline_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-arc-basic-arc_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-arc-basic-arc_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-arc-progress-arc_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-arc-progress-arc_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-arc-radial-arc_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-arc-radial-arc_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-arc-simple-pie_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-arc-simple-pie_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-basic-area_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-basic-area_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-connect-nulls-area_0.10.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-connect-nulls-area_0.10.8.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-intersection_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-intersection_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-percent-area_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-percent-area_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-stack-area_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-stack-area_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-area-vertical-area_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-area-vertical-area_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle-right_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle-right_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle-top_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle-top_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-circle-relation-circle_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-image-basic-image_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-image-basic-image_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-basic-line_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-basic-line_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-connect-nulls-line_0.10.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-connect-nulls-line_0.10.8.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-connect-nulls-segments_0.10.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-connect-nulls-segments_0.10.8.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-log-line_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-log-line_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-segmental-line_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-segmental-line_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-line-spiral_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-line-spiral_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-polygon-basic-polygon_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-polygon-basic-polygon_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-polygon-flow-funnel_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-polygon-flow-funnel_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-polygon-polygon-intersect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-polygon-polygon-intersect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-api-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-api-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-basic-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-basic-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-bi-direction-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-bi-direction-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-customized-shape_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-customized-shape_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-percent-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-percent-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-range-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-range-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-stack-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-stack-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rect-symmetry-rect_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rect-symmetry-rect_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-richtext-basic-richtext_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-richtext-basic-richtext_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rule-basic-rule_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rule-basic-rule_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-rule-rule-symbol_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-rule-rule-symbol_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-symbol-basic-symbol_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-symbol-basic-symbol_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-symbol-bubble_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-symbol-bubble_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-symbol-jitter-symbol_0.10.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-symbol-jitter-symbol_0.10.8.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/basic-mark-text-basic-text_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/basic-mark-text-basic-text_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-dataZoom_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-dataZoom_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-label_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-label_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-legend_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-legend_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-player_0.10.8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-player_0.10.8.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-player_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-player_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/component-slider_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/component-slider_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/failedPreviewLists.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-bar-boxplot_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-bar-boxplot_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-boxplot_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-boxplot_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-candle_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-candle_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-horizontal-boxplot_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-horizontal-boxplot_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-link-path_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-link-path_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-polar-boxplot_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-polar-boxplot_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-ripple_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-ripple_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-violin_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-violin_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/glyph-mark-wave_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/glyph-mark-wave_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/hierarchy-circlepacking_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/hierarchy-circlepacking_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/hierarchy-sunburst_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/hierarchy-sunburst_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/hierarchy-tree_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/hierarchy-tree_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/hierarchy-treemap_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/hierarchy-treemap_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-cell-basic-cell_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-cell-basic-cell_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-cell-calender-cell_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-cell-calender-cell_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-bar-symmetry-group_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-bar-symmetry-group_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-bar-symmetry_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-bar-symmetry_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-basic-bar_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-basic-bar_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-basic-interval_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-basic-interval_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-polar-interval_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-polar-interval_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/mark-interval-radial-interval_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/mark-interval-radial-interval_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/performance-progressive-line_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/performance-progressive-line_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/performance-progressive-rect_0.7.6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/performance-progressive-rect_0.7.6.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-connected-scatter-line_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-connected-scatter-line_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-plot-diverging-color-point_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-plot-diverging-color-point_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-plot-line_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-plot-line_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-plot-stack-point_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-plot-stack-point_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-plot-symbol-rule_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-plot-symbol-rule_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/plot-plot-symbol_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/plot-plot-symbol_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/sankey-basic-sankey_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/sankey-basic-sankey_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/wordcloud-basic-wordcloud_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/wordcloud-basic-wordcloud_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/preview/wordcloud-shape-basic-wordcloud-shape_0.7.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/preview/wordcloud-shape-basic-wordcloud-shape_0.7.6.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-arrange-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-arrange-animate.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-basic-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-basic-animate.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-custom-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-custom-animate.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-loop-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-loop-animate.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-morph-animate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-morph-animate.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/animate-timeline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/animate-timeline.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/component-player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/component-player.png -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/performance-progressive-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/performance-progressive-line.gif -------------------------------------------------------------------------------- /docs/site/public/vgrammar/static-preview/performance-progressive-rect.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/docs/site/public/vgrammar/static-preview/performance-progressive-rect.gif -------------------------------------------------------------------------------- /docs/site/src/i18n.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | export enum LanguageEnum { 4 | chinese = 'zh', 5 | english = 'en' 6 | } 7 | 8 | export const getStoredLanguage = (): LanguageEnum => { 9 | const defaultLanguage = LanguageEnum.chinese; 10 | return (window.localStorage.getItem('language') as LanguageEnum) ?? defaultLanguage; 11 | }; 12 | 13 | export const storeLanguage = (language: LanguageEnum) => { 14 | window.localStorage.setItem('language', language); 15 | }; 16 | 17 | export const LanguageContext = createContext({ 18 | language: LanguageEnum.chinese, 19 | setLanguage: (language: LanguageEnum) => {} 20 | }); 21 | -------------------------------------------------------------------------------- /docs/site/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"] 7 | } 8 | }, 9 | "references": [] 10 | } 11 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Coordinate', 7 | umdOutputFilename: 'index' 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts') 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Coordinate } from './base'; 2 | export { CartesianCoordinate } from './cartesian'; 3 | export { PolarCoordinate } from './polar'; 4 | 5 | export * from './interface'; 6 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-coordinate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "ignoreDeprecations": "5.0", 5 | "baseUrl": ".", 6 | "rootDir": "./src", 7 | "outDir": "./es", 8 | "composite": true 9 | }, 10 | "ts-node": { 11 | "transpileOnly": true, 12 | "compilerOptions": { 13 | "module": "commonjs" 14 | } 15 | }, 16 | "include": ["src"] 17 | } 18 | -------------------------------------------------------------------------------- /packages/vgrammar-core/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname }, 6 | globals: { 7 | __DEV__: "readonly", 8 | __VERSION__: "readonly", 9 | NodeJS: true, 10 | }, 11 | // ignorePatterns: [], 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/transforms/filter.test.ts: -------------------------------------------------------------------------------- 1 | import { transform } from '../../src/transforms/data/filter'; 2 | import { initBrowserEnv } from '../../src/env'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('basic filter', () => { 7 | const data = [ 8 | { foo: 1, bar: 1 }, 9 | { foo: 1, bar: 2 }, 10 | { foo: null, bar: 3 } 11 | ]; 12 | 13 | expect( 14 | transform( 15 | { 16 | callback: (entry: any) => entry.bar > 2 17 | }, 18 | data 19 | ) 20 | ).toEqual([{ foo: null, bar: 3 }]); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/transforms/map.test.ts: -------------------------------------------------------------------------------- 1 | import { transform } from '../../src/transforms/data/map'; 2 | import { initBrowserEnv } from '../../src/env'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('basic map', () => { 7 | const data = [ 8 | { foo: 1, bar: 1 }, 9 | { foo: 1, bar: 2 }, 10 | { foo: null, bar: 3 } 11 | ]; 12 | 13 | expect( 14 | transform( 15 | { 16 | callback: (entry: any) => `${entry.bar}${entry.foo ?? 0}`, 17 | as: 'test' 18 | }, 19 | data 20 | ) 21 | ).toEqual([ 22 | { foo: 1, bar: 1, test: '11' }, 23 | { foo: 1, bar: 2, test: '21' }, 24 | { foo: null, bar: 3, test: '30' } 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/transforms/pick.test.ts: -------------------------------------------------------------------------------- 1 | import { transform } from '../../src/transforms/data/pick'; 2 | import { initBrowserEnv } from '../../src/env'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('basic pick', () => { 7 | const data = [ 8 | { foo: { a: 5, b: 'abc' }, bar: 0 }, 9 | { foo: { a: 6, b: 'def' }, bar: 1 }, 10 | { foo: { a: 7, b: 'ghi' }, bar: 2 } 11 | ]; 12 | 13 | expect( 14 | transform( 15 | { 16 | fields: ['bar', 'foo.a', 'foo.b'], 17 | as: ['bar', 'a', 'b'] 18 | }, 19 | data 20 | ) 21 | ).toEqual([ 22 | { bar: 0, a: 5, b: 'abc' }, 23 | { bar: 1, a: 6, b: 'def' }, 24 | { bar: 2, a: 7, b: 'ghi' } 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/transforms/range.test.ts: -------------------------------------------------------------------------------- 1 | import { transform } from '../../src/transforms/data/range'; 2 | import { initBrowserEnv } from '../../src/env'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('basic range', () => { 7 | expect( 8 | transform({ 9 | start: 0, 10 | stop: 5 11 | }) 12 | ).toEqual([{ data: 0 }, { data: 1 }, { data: 2 }, { data: 3 }, { data: 4 }]); 13 | }); 14 | 15 | test('basic aggregate', () => { 16 | expect( 17 | transform({ 18 | start: 1, 19 | stop: 10, 20 | step: 2, 21 | as: 'value' 22 | }) 23 | ).toEqual([{ value: 1 }, { value: 3 }, { value: 5 }, { value: 7 }, { value: 9 }]); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"] 8 | }, 9 | "lib": ["DOM", "ESNext"] 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-core/__tests__/util/unique-list.test.ts: -------------------------------------------------------------------------------- 1 | import { UniqueList } from '../../src/util/unique-list'; 2 | import { initBrowserEnv } from '../../src/env'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('UniqueList', () => { 7 | const uList = new UniqueList((entry: any) => entry.id); 8 | 9 | uList.add({ id: 1 }); 10 | uList.add({ id: 2 }); 11 | uList.add({ id: 3 }); 12 | uList.add({ id: 2, content: 'new' }); 13 | 14 | expect(uList.length).toBe(3); 15 | 16 | expect(uList.filter(u => u.id > 2).length).toBe(1); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/vgrammar-core/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar', 7 | umdOutputFilename: 'index' 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vgrammar-core/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/'), 9 | '@visactor/vgrammar-projection': path.resolve(__dirname, '../vgrammar-projection/src/'), 10 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/') 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/component/index.ts: -------------------------------------------------------------------------------- 1 | export { registerAxis, registerCircleAxis, registerLineAxis } from './axis'; 2 | export { registerLegend } from './legend'; 3 | export { registerSlider } from './slider'; 4 | export { registerLabel } from './label'; 5 | export { registerDataZoom } from './datazoom'; 6 | export { registerPlayer } from './player'; 7 | export { registerTitle } from './title'; 8 | export { registerGrid, registerCircleGrid, registerLineGrid } from './grid'; 9 | export { registerScrollbar } from './scrollbar'; 10 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/env.ts: -------------------------------------------------------------------------------- 1 | import { initBrowserEnv, initNodeEnv } from '@visactor/vrender-kits'; 2 | import { isBrowserEnv, isNodeEnv } from '@visactor/vrender-core'; 3 | 4 | export const initAutoEnv = () => { 5 | if (isBrowserEnv()) { 6 | initBrowserEnv(); 7 | } else if (isNodeEnv()) { 8 | initNodeEnv(); 9 | } 10 | }; 11 | 12 | export { initBrowserEnv, initNodeEnv }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/glyph/index.ts: -------------------------------------------------------------------------------- 1 | export type { IBoxplotScaleAnimationOptions } from './boxplot'; 2 | export { registerBoxplotGlyph, registerBarBoxplotGlyph } from './boxplot'; 3 | export { registerRippleGlyph } from './ripple'; 4 | export { registerWaveGlyph } from './wave'; 5 | export { registerLinkPathGlyph } from './link-path'; 6 | export { registerTreePathGlyph } from './tree-path'; 7 | export { registerViolinGlyph } from './violin'; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/graph/attributes/common.ts: -------------------------------------------------------------------------------- 1 | export const commonAttributes = ['fillOpacity']; 2 | 3 | export const transformCommonAttribute = (graphicAttributes: any, changedKey: string, nextAttrs: any) => { 4 | if (changedKey === 'fillOpacity') { 5 | graphicAttributes.fillOpacity = nextAttrs.fillOpacity ?? 1; 6 | return ['fillOpacity']; 7 | } 8 | 9 | return []; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/graph/attributes/index.ts: -------------------------------------------------------------------------------- 1 | export * from './common'; 2 | export * from './helpers'; 3 | export * from './line'; 4 | export * from './transform'; 5 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/graph/index.ts: -------------------------------------------------------------------------------- 1 | export * from './enums'; 2 | export { Element } from './element'; 3 | export { getLinePoints, getRulePoints } from './attributes/helpers'; 4 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/graph/util/env.ts: -------------------------------------------------------------------------------- 1 | import { vglobal } from '@visactor/vrender-core'; 2 | import type { IEnvironmentOptions } from '../../types'; 3 | 4 | export function configureEnvironment(options: IEnvironmentOptions) { 5 | if (options.mode) { 6 | vglobal.setEnv(options.mode, options.modeParams || {}); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/interactions/element-select-by-graphic-name.ts: -------------------------------------------------------------------------------- 1 | import type { InteractionEvent } from '../types'; 2 | import { ElementSelect } from './element-select'; 3 | 4 | export class ElementSelectByGraphicName extends ElementSelect { 5 | static type: string = 'element-select-by-graphic-name'; 6 | type: string = ElementSelectByGraphicName.type; 7 | 8 | start(element: InteractionEvent['element']) { 9 | const name = element.getGraphicItem()?.name; 10 | if (name) { 11 | this._marks.forEach(mark => { 12 | mark.elements.forEach(el => { 13 | if (el.getGraphicItem()?.name === name) { 14 | super.start(el); 15 | } 16 | }); 17 | }); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/theme/common/constants.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_PADDING = 5; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/theme/common/mark.ts: -------------------------------------------------------------------------------- 1 | import type { IMarkTheme } from '../../types'; 2 | 3 | export const defaultMarkTheme: IMarkTheme = { 4 | symbol: { 5 | shape: 'circle', 6 | size: 8 7 | }, 8 | text: { 9 | fontSize: 14, 10 | fill: '#000000' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/theme/default.ts: -------------------------------------------------------------------------------- 1 | import type { ITheme } from '../types'; 2 | import { defaultComponentTheme } from './common/component'; 3 | import { DEFAULT_PADDING } from './common/constants'; 4 | import { defaultMarkTheme } from './common/mark'; 5 | 6 | export const defaultTheme: ITheme = { 7 | name: 'default', 8 | padding: DEFAULT_PADDING, 9 | palette: { 10 | default: [ 11 | '#6690F2', 12 | '#70D6A3', 13 | '#B4E6E2', 14 | '#63B5FC', 15 | '#FF8F62', 16 | '#FFDC83', 17 | '#BCC5FD', 18 | '#A29BFE', 19 | '#63C4C7', 20 | '#F68484' 21 | ] 22 | }, 23 | marks: defaultMarkTheme, 24 | components: defaultComponentTheme 25 | }; 26 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/transforms/data/filter.ts: -------------------------------------------------------------------------------- 1 | import type { FilterTransformOption } from '../../types'; 2 | 3 | export const transform = (options: FilterTransformOption, data: any[], parameters?: any) => { 4 | return data.filter(entry => { 5 | return options.callback(entry, parameters); 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/transforms/data/range.ts: -------------------------------------------------------------------------------- 1 | import { range } from '@visactor/vutils'; 2 | import type { RangeTransformOptions } from '../../types'; 3 | 4 | export const transform = (options: RangeTransformOptions) => { 5 | const { start, stop, step = 1, as = 'data' } = options; 6 | 7 | return range(start, stop, step).map((val: number) => { 8 | return { [as]: val }; 9 | }); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/transforms/data/sort.ts: -------------------------------------------------------------------------------- 1 | import { compare } from '@visactor/vgrammar-util'; 2 | import { isFunction } from '@visactor/vutils'; 3 | import type { SortTransformOptions } from '../../types'; 4 | 5 | export const transform = (options: SortTransformOptions, upstreamData: any[]) => { 6 | const sort = options.sort; 7 | 8 | if (sort && upstreamData) { 9 | const sortFn = isFunction(sort) ? sort : compare(sort.field, sort.order); 10 | 11 | upstreamData.sort((a: any, b: any) => sortFn(a, b)); 12 | } 13 | 14 | return upstreamData; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/types/dataflow.ts: -------------------------------------------------------------------------------- 1 | import type { IGrammarBase } from './grammar'; 2 | 3 | export type IDataflowCallback = (df: IDataflow) => void; 4 | 5 | /** 6 | * Dataflow定义, 7 | */ 8 | export interface IDataflow { 9 | logger: any; 10 | add: (grammar: IGrammarBase) => boolean | undefined; 11 | remove: (grammar: IGrammarBase) => void; 12 | hasCommitted: () => boolean; 13 | commit: (grammar: IGrammarBase) => this; 14 | evaluate: () => boolean; 15 | runBefore: (callback?: IDataflowCallback) => void; 16 | runAfter: (callback?: IDataflowCallback) => void; 17 | } 18 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './animate'; 2 | export * from './base'; 3 | export * from './component'; 4 | export * from './coordinate'; 5 | export * from './data'; 6 | export * from './dataflow'; 7 | export * from './element'; 8 | export * from './event'; 9 | export * from './glyph'; 10 | export * from './grammar'; 11 | export * from './hooks'; 12 | export * from './layout'; 13 | export * from './mark'; 14 | export * from './morph'; 15 | export * from './projection'; 16 | export * from './renderer'; 17 | export * from './scale'; 18 | export * from './signal'; 19 | export * from './theme'; 20 | export * from './transform'; 21 | export * from './view'; 22 | export * from './plot'; 23 | export * from './interaction'; 24 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/types/layout.ts: -------------------------------------------------------------------------------- 1 | interface LayoutParams { 2 | role: 'container' | 'item'; 3 | } 4 | 5 | export type LayoutSpec = LayoutParams; 6 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/view/constants.ts: -------------------------------------------------------------------------------- 1 | export const EVENT_SOURCE_WINDOW = 'window'; 2 | export const EVENT_SOURCE_VIEW = 'view'; 3 | export const BROWSER = 'browser'; 4 | export const NO_TRAP = { trap: false }; 5 | 6 | export const SIGNAL_WIDTH = 'width'; 7 | export const SIGNAL_HEIGHT = 'height'; 8 | export const SIGNAL_VIEW_WIDTH = 'viewWidth'; 9 | export const SIGNAL_VIEW_HEIGHT = 'viewHeight'; 10 | export const SIGNAL_PADDING = 'padding'; 11 | export const SIGNAL_VIEW_BOX = 'viewBox'; 12 | export const SIGNAL_AUTOFIT = 'autoFit'; 13 | 14 | export const DEFAULT_HOVER_STATE = 'hover'; 15 | 16 | export const NAME_PREFIX = '@'; 17 | export const ID_PREFIX = '#'; 18 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/view/index.ts: -------------------------------------------------------------------------------- 1 | export { default as View } from './View'; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-core/src/view/view-animate-mixin.ts: -------------------------------------------------------------------------------- 1 | import { mixin } from '@visactor/vutils'; 2 | import View from './View'; 3 | import { ViewAnimate } from './animate'; 4 | import type { IViewAnimate } from '../types/animate'; 5 | import type { IView } from '../types'; 6 | 7 | class ViewAnimateMixin { 8 | animate: IViewAnimate; 9 | 10 | initAnimate(view: IView) { 11 | this.animate = new ViewAnimate(view); 12 | 13 | return this.animate; 14 | } 15 | } 16 | 17 | export const registerViewAnimateAPI = () => { 18 | mixin(View, ViewAnimateMixin); 19 | }; 20 | -------------------------------------------------------------------------------- /packages/vgrammar-core/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "outDir": "./es", 6 | "rootDir": "./src", 7 | "composite": true, 8 | "lib": ["DOM", "ESNext"], 9 | "ignoreDeprecations": "5.0" 10 | }, 11 | "ts-node": { 12 | "transpileOnly": true, 13 | "compilerOptions": { 14 | "module": "commonjs" 15 | } 16 | }, 17 | "references": [ 18 | { 19 | "path": "../vgrammar-util" 20 | }, 21 | { 22 | "path": "../vgrammar-coordinate" 23 | } 24 | ], 25 | "include": ["./src"] 26 | } 27 | -------------------------------------------------------------------------------- /packages/vgrammar-full/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-full/CHANGELOG.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar-full/CHANGELOG.json -------------------------------------------------------------------------------- /packages/vgrammar-full/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar-full/CHANGELOG.md -------------------------------------------------------------------------------- /packages/vgrammar-full/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es', 'umd'], 6 | name: 'VGrammar', 7 | umdOutputFilename: 'index', 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vgrammar-full/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 8 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/'), 9 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts'), 10 | '@visactor/vgrammar-projection': path.resolve(__dirname, '../vgrammar-projection/src/'), 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-full/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/README.md: -------------------------------------------------------------------------------- 1 | # @visactor/vGrammar-hierarchy 2 | 3 | ## Description 4 | 5 | Layout of hierarchical data 6 | 7 | ## Usage 8 | 9 | ```typescript 10 | import { xxx } from '@visactor/vGrammar-hierarchy'; 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": [".", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Hierarchy', 7 | external: ['@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils', '@visactor/vrender-core'], 8 | globals: { 9 | '@visactor/vrender-core': 'VRenderCore', 10 | '@visactor/vgrammar': 'VGrammar', 11 | '@visactor/vgrammar-util': 'VGrammar.Util', 12 | '@visactor/vutils': 'VUtils' 13 | }, 14 | umdOutputFilename: 'index' 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 9 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/index.ts'), 10 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/src/lcg.ts: -------------------------------------------------------------------------------- 1 | /* Adapted from vega by University of Washington Interactive Data Lab 2 | * https://vega.github.io/vega/ 3 | * Licensed under the BSD-3-Clause 4 | 5 | * url: https://github.com/vega/vega/blob/main/packages/vega-statistics/src/lcg.js 6 | * License: https://github.com/vega/vega/blob/main/LICENSE 7 | * @license 8 | */ 9 | 10 | // https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use 11 | const a = 1664525; 12 | const c = 1013904223; 13 | const m = 4294967296; // 2^32 14 | 15 | export function randomLCG(initS: number = 1) { 16 | let s = initS; 17 | return () => (s = (a * s + c) % m) / m; 18 | } 19 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-hierarchy/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "references": [ 12 | { 13 | "path": "../vgrammar-util" 14 | }, 15 | { 16 | "path": "../vgrammar-core" 17 | } 18 | ], 19 | "include": ["src"], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/CHANGELOG.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar-plot/CHANGELOG.json -------------------------------------------------------------------------------- /packages/vgrammar-plot/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar-plot/CHANGELOG.md -------------------------------------------------------------------------------- /packages/vgrammar-plot/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": [".", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/__tests__/util.test.ts: -------------------------------------------------------------------------------- 1 | import { mergeGrammarSpecs } from '../src/util'; 2 | 3 | test('mergeGrammarSpecs() of scales', () => { 4 | const a = [{ id: 'a' }, { id: 'b' }]; 5 | const b = [{ id: 'a' }, { id: 'b' }]; 6 | const c = [{ id: 'c' }]; 7 | 8 | expect(mergeGrammarSpecs(a, b).length).toBe(2); 9 | expect(mergeGrammarSpecs(a, c).length).toBe(3); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Plot', 7 | umdOutputFilename: 'index', 8 | globals: { 9 | '@visactor/vgrammar': 'VGrammar', 10 | '@visactor/vgrammar-util': 'VGrammar.Util', 11 | '@visactor/vutils': 'VUtils' 12 | }, 13 | external: ['@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils'] 14 | }; 15 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 8 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/'), 9 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts'), 10 | '@visactor/vgrammar-projection': path.resolve(__dirname, '../vgrammar-projection/src/'), 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/src/enums.ts: -------------------------------------------------------------------------------- 1 | export enum PlotMakType { 2 | area = 'area', 3 | cell = 'cell', 4 | image = 'image', 5 | interval = 'interval', 6 | line = 'line', 7 | path = 'path', 8 | polygon = 'polygon', 9 | rectX = 'rectX', 10 | rectY = 'rectY', 11 | rect = 'rect', 12 | ruleX = 'ruleX', 13 | ruleY = 'ruleY', 14 | rule = 'rule', 15 | symbol = 'symbol', 16 | text = 'text', 17 | 18 | tree = 'tree', 19 | circlePacking = 'circlePacking', 20 | sunburst = 'sunburst', 21 | treemap = 'treemap', 22 | sankey = 'sankey', 23 | wordcloud = 'wordcloud', 24 | wordcloudShape = 'wordcloudShape' 25 | } 26 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Plot } from './plot-all'; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/src/util.ts: -------------------------------------------------------------------------------- 1 | export const mergeGrammarSpecs = (newSpecs: T[], prevSpecs: T[]) => { 2 | return newSpecs.reduce((res, entry) => { 3 | if (entry.id && !res.some(prev => prev.id === entry.id)) { 4 | res.push(entry); 5 | } 6 | 7 | return res; 8 | }, prevSpecs); 9 | }; 10 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-plot/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "references": [ 12 | { 13 | "path": "../vgrammar-util" 14 | }, 15 | { 16 | "path": "../vgrammar-core" 17 | }, 18 | { 19 | "path": "../vgrammar-coordinate" 20 | } 21 | ], 22 | "include": ["src"], 23 | "exclude": [] 24 | } 25 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/__tests__/utils.ts: -------------------------------------------------------------------------------- 1 | export const emptyFunction = () => { 2 | return; 3 | }; 4 | 5 | export const getMockedView = () => { 6 | const grammars = { 7 | unrecord: emptyFunction, 8 | record: emptyFunction 9 | }; 10 | const lookup = (id: string) => { 11 | if (grammars[id]) { 12 | return grammars[id]; 13 | } 14 | return (grammars[id] = { id: () => id, targets: [], output: () => ({}) }); 15 | }; 16 | return { 17 | emit: emptyFunction, 18 | grammars: grammars, 19 | getGrammarById: lookup, 20 | getDataById: lookup, 21 | getScaleById: lookup, 22 | getCoordinateById: lookup, 23 | getMarkById: lookup, 24 | commit: emptyFunction 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Projection', 7 | umdOutputFilename: 'index', 8 | globals: { 9 | '@visactor/vgrammar': 'VGrammar', 10 | '@visactor/vgrammar-util': 'VGrammar.Util', 11 | '@visactor/vutils': 'VUtils' 12 | }, 13 | external: ['@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils'] 14 | }; 15 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | 'd3-geo': path.resolve(__dirname, './node_modules/d3-geo/dist/d3-geo.js'), 8 | 'd3-array': path.resolve(__dirname, './node_modules/d3-array/dist/d3-array.js'), 9 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 10 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/index.ts'), 11 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | export { projection, projectionProperties, getProjectionPath } from './projections'; 3 | import { Projection } from './projection'; 4 | import { transform as geoPathTransform } from './geo-path'; 5 | 6 | export const registerProjection = () => { 7 | Factory.registerGrammar('projection', Projection, 'projections'); 8 | }; 9 | 10 | export { Projection }; 11 | 12 | export const registerGeoTransforms = () => { 13 | Factory.registerTransform( 14 | 'geoPath', 15 | { 16 | transform: geoPathTransform, 17 | markPhase: 'beforeJoin' 18 | }, 19 | true 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-projection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "references": [ 12 | { 13 | "path": "../vgrammar-util" 14 | }, 15 | { 16 | "path": "../vgrammar-core" 17 | } 18 | ], 19 | "include": ["src"], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Sankey', 7 | globals: { 8 | '@visactor/vrender-core': 'VRenderCore', 9 | '@visactor/vgrammar': 'VGrammar', 10 | '@visactor/vgrammar-util': 'VGrammar.Util', 11 | '@visactor/vutils': 'VUtils' 12 | }, 13 | umdOutputFilename: 'index', 14 | external: ['@visactor/vrender-core', '@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils'] 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 9 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/index.ts'), 10 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/src/hierarchy.ts: -------------------------------------------------------------------------------- 1 | import { isNil } from '@visactor/vutils'; 2 | import type { HierarchyNodeDatum } from './interface'; 3 | 4 | export const calculateNodeValue = (subTree: HierarchyNodeDatum[]) => { 5 | let sum = 0; 6 | subTree.forEach((node, index) => { 7 | if (isNil(node.value)) { 8 | if (node.children?.length) { 9 | node.value = calculateNodeValue(node.children); 10 | } else { 11 | node.value = 0; 12 | } 13 | } 14 | 15 | sum += Math.abs(node.value); 16 | }); 17 | 18 | return sum; 19 | }; 20 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | import { transform } from './transform'; 3 | import { SankeyHighlight } from './sankey-highlight'; 4 | 5 | export { SankeyLayout } from './layout'; 6 | export const sankeyTransform = transform; 7 | 8 | export * from './interface'; 9 | export * from './format'; 10 | 11 | export const registerSankeyTransforms = () => { 12 | Factory.registerTransform( 13 | 'sankey', 14 | { 15 | transform, 16 | markPhase: 'beforeJoin' 17 | }, 18 | true 19 | ); 20 | }; 21 | 22 | export const registerSankeyHighlight = () => { 23 | Factory.registerInteraction(SankeyHighlight.type, SankeyHighlight); 24 | }; 25 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-sankey/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "references": [ 12 | { 13 | "path": "../vgrammar-util" 14 | }, 15 | { 16 | "path": "../vgrammar-core" 17 | } 18 | ], 19 | "include": ["src"], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar-util/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/accessors.test.ts: -------------------------------------------------------------------------------- 1 | import { identity, zero } from '../src'; 2 | 3 | test('accessor identity()', () => { 4 | const a = { a: 3 }; 5 | expect(identity(a)).toBe(a); 6 | }); 7 | 8 | test('accessor zero()', () => { 9 | const a = { a: 3 }; 10 | expect(zero(a)).toBe(0); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/getter.test.ts: -------------------------------------------------------------------------------- 1 | import { getter } from '../src'; 2 | 3 | test('getter(arr)', () => { 4 | expect(getter(['a'])({ a: 1 })).toEqual(1); 5 | expect(getter(['a', 'b'])({ a: { b: 1 } })).toEqual(1); 6 | expect(getter(['a', 'b'])({ a: { b: { c: 2 } } })).toEqual({ c: 2 }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/regression-linear.test.ts: -------------------------------------------------------------------------------- 1 | import { regressionLinear } from '../src'; 2 | 3 | test('regressionLinear()', function () { 4 | const arr = [ 5 | { 6 | x: 1, 7 | y: 2 8 | }, 9 | { 10 | x: 2, 11 | y: 4 12 | } 13 | ]; 14 | const res = regressionLinear(arr); 15 | expect(res.coef).toEqual([0, 2]); 16 | expect(res.predict(1)).toBeCloseTo(2); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/splitAccessPath.test.ts: -------------------------------------------------------------------------------- 1 | import { splitAccessPath } from '../src'; 2 | 3 | test('splitAccessPath()', function () { 4 | expect(splitAccessPath('')).toEqual([]); 5 | expect(splitAccessPath('a.b')).toEqual(['a', 'b']); 6 | expect(splitAccessPath('a[b]')).toEqual(['a', 'b']); 7 | expect(splitAccessPath('a."b"')).toEqual(['a', '"b"']); 8 | expect(splitAccessPath("a['b']")).toEqual(['a', 'b']); 9 | expect(splitAccessPath('a["b"]')).toEqual(['a', 'b']); 10 | expect(splitAccessPath('a["b"].c')).toEqual(['a', 'b', 'c']); 11 | 12 | expect(splitAccessPath('a.\\b')).toEqual(['a', 'b']); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/to-percent.test.ts: -------------------------------------------------------------------------------- 1 | import { toPercent } from '../src/toPercent'; 2 | 3 | test('percent string', function () { 4 | expect(toPercent('10%', 100)).toBe(10); 5 | expect(toPercent('200%', 100)).toBe(200); 6 | }); 7 | 8 | test('null / undefined', function () { 9 | expect((toPercent as any)(undefined, 100)).toBe(100); 10 | expect((toPercent as any)(null, 100)).toBe(100); 11 | }); 12 | 13 | test('percent value', function () { 14 | expect(toPercent(50, 100)).toBe(50); 15 | expect(toPercent(200, 100)).toBe(200); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": {}, 5 | "references": [] 6 | } 7 | -------------------------------------------------------------------------------- /packages/vgrammar-util/__tests__/view-box.test.ts: -------------------------------------------------------------------------------- 1 | import { parseViewBox } from '../src/view-box'; 2 | 3 | test('parseViewBox', function () { 4 | expect(parseViewBox({ width: 100, height: 100 })).toEqual({ 5 | x0: 0, 6 | y0: 0, 7 | x1: 100, 8 | y1: 100, 9 | width: 100, 10 | height: 100 11 | }); 12 | 13 | expect(parseViewBox({ x0: 10, y0: 10, x1: 100, y1: 100 })).toEqual({ 14 | x0: 10, 15 | y0: 10, 16 | x1: 100, 17 | y1: 100, 18 | width: 90, 19 | height: 90 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/vgrammar-util/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Util', 7 | umdOutputFilename: 'index' 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vgrammar-util/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig 6 | }; 7 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/accessors.ts: -------------------------------------------------------------------------------- 1 | /* Adapted from vega by University of Washington Interactive Data Lab 2 | * https://vega.github.io/vega/ 3 | * Licensed under the BSD-3-Clause 4 | 5 | * url: https://github.com/vega/vega/blob/main/packages/vega-util/src/accessors.js 6 | * License: https://github.com/vega/vega/blob/main/LICENSE 7 | * @license 8 | */ 9 | 10 | export const identity = (_: any) => _; 11 | 12 | export const zero = (_: any) => 0; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/direction.ts: -------------------------------------------------------------------------------- 1 | export function isHorizontal(direction: string) { 2 | return direction === 'horizontal'; 3 | } 4 | 5 | export function isVertical(direction: string) { 6 | return direction === 'vertical'; 7 | } 8 | 9 | export function isValidDirection(direction: string) { 10 | return direction === 'vertical' || direction === 'horizontal'; 11 | } 12 | 13 | export function isValidPosition(position: string) { 14 | return position === 'top' || position === 'bottom' || position === 'left' || position === 'right'; 15 | } 16 | 17 | export function isHorizontalPosition(position: string) { 18 | return position === 'top' || position === 'bottom'; 19 | } 20 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/error.ts: -------------------------------------------------------------------------------- 1 | /* Adapted from vega by University of Washington Interactive Data Lab 2 | * https://vega.github.io/vega/ 3 | * Licensed under the BSD-3-Clause 4 | 5 | * url: https://github.com/vega/vega/blob/main/packages/vega-util/src/error.js 6 | * License: https://github.com/vega/vega/blob/main/LICENSE 7 | * @license 8 | */ 9 | 10 | import { Logger } from '@visactor/vutils'; 11 | 12 | export const error = (message: string) => { 13 | const logger = Logger.getInstance(); 14 | 15 | logger.error(message); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/getter.ts: -------------------------------------------------------------------------------- 1 | import { get } from '@visactor/vutils'; 2 | 3 | export const getter = (path: string[]): any => { 4 | return (obj: any) => get(obj, path); 5 | }; 6 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/toPercent.ts: -------------------------------------------------------------------------------- 1 | import { isNil, isString } from '@visactor/vutils'; 2 | 3 | export const toPercent = (percent: string | number, total: number) => { 4 | if (isNil(percent)) { 5 | return total; 6 | } 7 | 8 | return isString(percent) ? (total * parseFloat(percent as string)) / 100 : percent; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './function'; 2 | export * from './wordcloud'; 3 | 4 | export type LayoutViewBox = { width: number; height: number } | { x0: number; x1: number; y0: number; y1: number }; 5 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/types/wordcloud.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * text mask of wordcloud 3 | */ 4 | export interface TextShapeMask { 5 | type: 'text'; 6 | text: string; 7 | hollow?: boolean; 8 | backgroundColor?: string; 9 | fill?: string; 10 | fontFamily?: string; 11 | fontWeight?: string | number; 12 | fontStyle?: string; 13 | fontVariant: string; 14 | } 15 | 16 | /** 17 | * text mask of wordcloud 18 | */ 19 | export interface GeometricMaskShape { 20 | type: 'geometric'; 21 | shape: string; 22 | hollow?: boolean; 23 | backgroundColor?: string; 24 | fill?: string; 25 | } 26 | 27 | export type CanvasMaskShape = TextShapeMask | GeometricMaskShape; 28 | -------------------------------------------------------------------------------- /packages/vgrammar-util/src/view-box.ts: -------------------------------------------------------------------------------- 1 | import type { LayoutViewBox } from './types'; 2 | 3 | export const parseViewBox = (config: LayoutViewBox) => { 4 | return 'width' in config 5 | ? { x0: 0, x1: config.width, y0: 0, y1: config.height, width: config.width, height: config.height } 6 | : { 7 | x0: Math.min(config.x0, config.x1), 8 | x1: Math.max(config.x0, config.x1), 9 | y0: Math.min(config.y0, config.y1), 10 | y1: Math.max(config.y0, config.y1), 11 | width: Math.abs(config.x1 - config.x0), 12 | height: Math.abs(config.y1 - config.y0) 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/vgrammar-util/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "outDir": "./es", 9 | "composite": true 10 | }, 11 | "include": ["src"], 12 | "exclude": [] 13 | } 14 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/__tests__/tranform.test.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | import { registerVennTransforms } from '../src'; 3 | import { initBrowserEnv } from '@visactor/vgrammar-core'; 4 | 5 | initBrowserEnv(); 6 | 7 | test('transform of wordcloud', () => { 8 | const tranform = Factory.getTransform('venn'); 9 | 10 | expect(tranform).toBeUndefined(); 11 | registerVennTransforms(); 12 | expect(Factory.getTransform('venn')).not.toBeUndefined(); 13 | expect(Factory.getTransform('vennMark')).not.toBeUndefined(); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Wordcloud', 7 | external: ['@visactor/vrender-core', '@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils'], 8 | globals: { 9 | '@visactor/vrender-core': 'VRenderCore', 10 | '@visactor/vgrammar': 'VGrammar', 11 | '@visactor/vgrammar-util': 'VGrammar.Util', 12 | '@visactor/vutils': 'VUtils' 13 | }, 14 | umdOutputFilename: 'index' 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 9 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/index.ts'), 10 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | 3 | import { transform, transformMark } from './venn'; 4 | 5 | export * from './interface'; 6 | export * from './animation'; 7 | 8 | export const vennTransform = transform; 9 | export const vennMarkTransform = transformMark; 10 | 11 | export const registerVennTransforms = () => { 12 | Factory.registerTransform( 13 | 'venn', 14 | { 15 | transform, 16 | markPhase: 'beforeJoin' 17 | }, 18 | true 19 | ); 20 | Factory.registerTransform( 21 | 'vennMark', 22 | { 23 | transform: transformMark, 24 | markPhase: 'beforeJoin' 25 | }, 26 | true 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './layout'; 2 | export * from './solution'; 3 | export * from './label'; 4 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/src/utils/layout/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constrained-mds-layout'; 2 | export * from './greedy-layout'; 3 | export * from './layout'; 4 | export * from './loss'; 5 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/src/utils/solution/index.ts: -------------------------------------------------------------------------------- 1 | export * from './common'; 2 | export * from './normalize-solution'; 3 | export * from './scale-solution'; 4 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-venn/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "include": ["src"], 12 | "references": [ 13 | { 14 | "path": "../vgrammar-util" 15 | }, 16 | { 17 | "path": "../vgrammar-core" 18 | } 19 | ], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.WordcloudShape', 7 | external: [ 8 | '@visactor/vrender-core', 9 | '@visactor/vgrammar', 10 | '@visactor/vgrammar-util', 11 | '@visactor/vutils', 12 | '@visactor/vscale' 13 | ], 14 | globals: { 15 | '@visactor/vrender-core': 'VRenderCore', 16 | '@visactor/vgrammar': 'VGrammar', 17 | '@visactor/vgrammar-util': 'VGrammar.Util', 18 | '@visactor/vutils': 'VUtils', 19 | '@visactor/vscale': 'VScale' 20 | }, 21 | umdOutputFilename: 'index' 22 | }; 23 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 9 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | 3 | import { transform } from './wordcloud-shape'; 4 | 5 | export { WORDCLOUD_SHAPE_HOOK_EVENT } from './util'; 6 | 7 | export const registerWordCloudShapeTransforms = () => { 8 | Factory.registerTransform('wordcloudShape', { transform, markPhase: 'beforeJoin' }, true); 9 | }; 10 | 11 | export const wordcloudShapeTransform = transform; 12 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud-shape/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "include": ["src"], 12 | "references": [ 13 | { 14 | "path": "../vgrammar-util" 15 | }, 16 | { 17 | "path": "../vgrammar-core" 18 | } 19 | ], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/__tests__/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/__tests__/tranform.test.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | import { registerWordCloudTransforms } from '../src'; 3 | import { initBrowserEnv } from '@visactor/vgrammar-core'; 4 | 5 | initBrowserEnv(); 6 | 7 | test('transform of wordcloud', () => { 8 | const tranform = Factory.getTransform('wordcloud'); 9 | 10 | expect(tranform).toBeUndefined(); 11 | registerWordCloudTransforms(); 12 | expect(Factory.getTransform('wordcloud')).not.toBeUndefined(); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/__tests__/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "include": ["./", "../src"], 4 | "compilerOptions": { 5 | "paths": { 6 | "@visactor/vgrammar-util": ["../../vgrammar-util/src"], 7 | "@visactor/vgrammar-coordinate": ["../../vgrammar-coordinate/src"], 8 | "@visactor/vgrammar-core": ["../../vgrammar-core/src"] 9 | } 10 | }, 11 | "references": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/__tests__/util.test.ts: -------------------------------------------------------------------------------- 1 | import { isSupported, getMinFontSizeOfEnv, randomHslColor, functor } from '../src/util'; 2 | import { initBrowserEnv } from '@visactor/vgrammar-core'; 3 | 4 | initBrowserEnv(); 5 | 6 | test('isSupported()', () => { 7 | expect(isSupported()).toBe(true); 8 | }); 9 | 10 | test('getMinFontSizeOfEnv()', () => { 11 | expect(getMinFontSizeOfEnv()).toBe(12); 12 | }); 13 | 14 | test('randomHslColor()', () => { 15 | expect(randomHslColor(0, 100).indexOf('hsl(')).toBe(0); 16 | }); 17 | 18 | test('functor()', () => { 19 | const a = () => 0; 20 | expect(functor(a)).toBe(a); 21 | expect(typeof functor('a')).toBe('function'); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es'], 6 | name: 'VGrammar.Wordcloud', 7 | external: ['@visactor/vrender-core', '@visactor/vgrammar', '@visactor/vgrammar-util', '@visactor/vutils'], 8 | globals: { 9 | '@visactor/vrender-core': 'VRenderCore', 10 | '@visactor/vgrammar': 'VGrammar', 11 | '@visactor/vgrammar-util': 'VGrammar.Util', 12 | '@visactor/vutils': 'VUtils' 13 | }, 14 | umdOutputFilename: 'index' 15 | }; 16 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | ...baseJestConfig.moduleNameMapper, 8 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 9 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/index.ts'), 10 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts') 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Factory } from '@visactor/vgrammar-core'; 2 | 3 | import { transform } from './wordcloud'; 4 | 5 | export const registerWordCloudTransforms = () => { 6 | Factory.registerTransform( 7 | 'wordcloud', 8 | { 9 | transform, 10 | markPhase: 'beforeJoin' 11 | }, 12 | true 13 | ); 14 | }; 15 | 16 | export const wordcloudTransform = transform; 17 | 18 | export { shapes } from '@visactor/vgrammar-util'; 19 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar-wordcloud/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "include": ["src"], 12 | "references": [ 13 | { 14 | "path": "../vgrammar-util" 15 | }, 16 | { 17 | "path": "../vgrammar-core" 18 | } 19 | ], 20 | "exclude": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/vgrammar/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname } 6 | // ignorePatterns: [], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/vgrammar/CHANGELOG.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar/CHANGELOG.json -------------------------------------------------------------------------------- /packages/vgrammar/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/packages/vgrammar/CHANGELOG.md -------------------------------------------------------------------------------- /packages/vgrammar/bundler.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {Partial} 3 | */ 4 | module.exports = { 5 | formats: ['cjs', 'es', 'umd'], 6 | name: 'VGrammar', 7 | umdOutputFilename: 'index', 8 | }; 9 | -------------------------------------------------------------------------------- /packages/vgrammar/jest.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const baseJestConfig = require('@internal/jest-config/jest.base'); 3 | 4 | module.exports = { 5 | ...baseJestConfig, 6 | moduleNameMapper: { 7 | '@visactor/vgrammar-util': path.resolve(__dirname, '../vgrammar-util/src/index.ts'), 8 | '@visactor/vgrammar-coordinate': path.resolve(__dirname, '../vgrammar-coordinate/src/'), 9 | '@visactor/vgrammar-core': path.resolve(__dirname, '../vgrammar-core/src/index.ts'), 10 | '@visactor/vgrammar-projection': path.resolve(__dirname, '../vgrammar-projection/src/'), 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/vgrammar/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./" 8 | }, 9 | "include": ["src", "__tests__"], 10 | "exclude": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/vgrammar/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["jest", "node"], 5 | "lib": ["DOM", "ESNext"], 6 | "baseUrl": ".", 7 | "rootDir": "./src", 8 | "composite": true, 9 | "outDir": "./es" 10 | }, 11 | "references": [ 12 | { 13 | "path": "../vgrammar-util" 14 | }, 15 | { 16 | "path": "../vgrammar-core" 17 | }, 18 | { 19 | "path": "../vgrammar-coordinate" 20 | } 21 | ], 22 | "include": ["src"], 23 | "exclude": [] 24 | } 25 | -------------------------------------------------------------------------------- /share/eslint-config/profile/lib.js: -------------------------------------------------------------------------------- 1 | var config = require('./common')('node'); 2 | module.exports = config; 3 | -------------------------------------------------------------------------------- /share/eslint-config/profile/react.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./common')('react'); 2 | -------------------------------------------------------------------------------- /share/jest-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/jest-config", 3 | "private": true, 4 | "version": "0.0.1", 5 | "dependencies": { 6 | "canvas": "^2.5.0", 7 | "jsdom": "~22.1.0", 8 | "@jest/globals": "~29.5.0", 9 | "jest-environment-jsdom": "~29.5.0" 10 | }, 11 | "devDependencies": { 12 | "canvas": "^2.5.0", 13 | "jest": "~29.5.0", 14 | "@types/jest": "~29.5.0", 15 | "typescript": "4.9.5" 16 | }, 17 | "peerDependencies": { 18 | "jest": "~29.5.0", 19 | "typescript": "4.3 - 6.x" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /share/ts-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@internal/ts-config", 3 | "private": true, 4 | "version": "0.0.1" 5 | } 6 | -------------------------------------------------------------------------------- /share/ts-config/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2016", 4 | "experimentalDecorators": true, 5 | "strict": true, 6 | "noImplicitAny": true, 7 | "removeComments": true, 8 | "preserveConstEnums": true, 9 | "sourceMap": false, 10 | "moduleResolution": "node", 11 | "module": "esnext", 12 | "esModuleInterop": true, 13 | "importHelpers": false, 14 | "isolatedModules": false, 15 | "noImplicitReturns": false, 16 | "noImplicitThis": true, 17 | "noUnusedParameters": false, 18 | "noUnusedLocals": false, 19 | "resolveJsonModule": true, 20 | "suppressImplicitAnyIndexErrors": true, 21 | "strictNullChecks": false, 22 | "skipLibCheck": true 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tools/bundler/.eslintrc.js: -------------------------------------------------------------------------------- 1 | require('@rushstack/eslint-patch/modern-module-resolution'); 2 | 3 | module.exports = { 4 | extends: ['@internal/eslint-config/profile/lib'], 5 | parserOptions: { tsconfigRootDir: __dirname }, 6 | ignorePatterns: ['bin', 'output', 'vitest.config.ts', 'fixtures'] 7 | }; 8 | -------------------------------------------------------------------------------- /tools/bundler/bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict'; 3 | 4 | require('../output/bootstrap'); 5 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/.gitignore: -------------------------------------------------------------------------------- 1 | es 2 | cjs 3 | dist 4 | umd -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@foo/qux", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "compile": "tsc --noEmit" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/foo/bar/index.ts: -------------------------------------------------------------------------------- 1 | import { isObject } from '@/utils'; 2 | 3 | export function bar(val: unknown) { 4 | return isObject(val); 5 | } 6 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/foo/bar/web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VisActor/VGrammar/a6642fb7f0a2cb2a97eead24423c8b574ca077e8/tools/bundler/fixtures/config/source/foo/bar/web.png -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/foo/index.ts: -------------------------------------------------------------------------------- 1 | export const Foo = 'Foo'; 2 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/global.d.ts: -------------------------------------------------------------------------------- 1 | declare const __VERSION__: string; 2 | declare const __DEV__: boolean; 3 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/index.ts: -------------------------------------------------------------------------------- 1 | import { isArray } from '@/utils'; 2 | 3 | export type Viking = { 4 | foo: string; 5 | }; 6 | 7 | export function bar(value: unknown) { 8 | if (isArray(value)) { 9 | return value.length; 10 | } 11 | if (__DEV__) { 12 | console.log('xxx'); 13 | } 14 | return 0; 15 | } 16 | 17 | export const version = __VERSION__; 18 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/source/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { Foo } from '@/foo'; 2 | 3 | export function isObject(value: unknown): value is Record { 4 | return Object.prototype.toString.call(value) === '[object Object]'; 5 | } 6 | 7 | export function isArray(value: unknown): value is Array { 8 | return Object.prototype.toString.call(value) === '[object Array]'; 9 | } 10 | 11 | export function isFunction(value: unknown): value is Function { 12 | return typeof value === 'function'; 13 | } 14 | 15 | export const Bar = Foo; 16 | -------------------------------------------------------------------------------- /tools/bundler/fixtures/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "rootDir": "./", 6 | "outDir": "output", 7 | "target": "ES2015", 8 | "module": "ESNext", 9 | "declaration": true, 10 | "sourceMap": false, 11 | "jsx": "react-jsx", 12 | "paths": { 13 | "@/*": ["source/*"] 14 | } 15 | }, 16 | "include": ["source"] 17 | } 18 | -------------------------------------------------------------------------------- /tools/bundler/src/global.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'gulp-clean' { 2 | const m = (opt?: { force: boolean }): NodeJS.ReadWriteStream => {}; 3 | export = m; 4 | } 5 | 6 | declare module 'rollup-plugin-sizes'; 7 | declare module 'rollup-plugin-bundle-size'; 8 | -------------------------------------------------------------------------------- /tools/bundler/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { Config } from './logic/config'; 2 | export type { RawPackageJson } from './logic/package'; 3 | 4 | export { loadPackageJson } from './logic/package'; 5 | export { loadConfigFile } from './logic/config'; 6 | 7 | export { clean } from './tasks/clean'; 8 | export { buildStyle } from './tasks/style'; 9 | -------------------------------------------------------------------------------- /tools/bundler/src/logic/debug.ts: -------------------------------------------------------------------------------- 1 | import createDebug from 'debug'; 2 | 3 | const debug = createDebug('Bundler'); 4 | 5 | export const DebugConfig = debug.extend('config'); 6 | export const DebugCompile = debug.extend('compile'); 7 | -------------------------------------------------------------------------------- /tools/bundler/src/tasks/clean.ts: -------------------------------------------------------------------------------- 1 | import gulp from 'gulp'; 2 | import gulpClean from 'gulp-clean'; 3 | 4 | export function clean(folders: string[], cwd?: string) { 5 | return new Promise(resolve => { 6 | gulp 7 | .src(folders, { 8 | cwd: cwd, 9 | read: false, 10 | allowEmpty: true 11 | }) 12 | .pipe(gulpClean({ force: true })) 13 | .on('finish', () => { 14 | resolve(undefined); 15 | }); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /tools/bundler/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@internal/ts-config/tsconfig.base.json", 3 | "ts-node": { 4 | "transpileOnly": true, 5 | "compilerOptions": { 6 | "declaration": true, 7 | "sourceMap": true 8 | } 9 | }, 10 | "compilerOptions": { 11 | "baseUrl": ".", 12 | "outDir": "output", 13 | "target": "ES2015", 14 | "module": "CommonJS", 15 | "declaration": true, 16 | "sourceMap": false 17 | }, 18 | "include": ["src"] 19 | } 20 | -------------------------------------------------------------------------------- /tools/bundler/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | include: ['src/**/*.{test,spec}.ts'] 6 | } 7 | }); 8 | --------------------------------------------------------------------------------