@antv/infographic 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/esm/constants/element.d.ts +11 -0
- package/esm/constants/element.js +1 -0
- package/esm/constants/index.d.ts +1 -0
- package/esm/constants/index.js +1 -0
- package/esm/designs/components/Btn.d.ts +7 -0
- package/esm/designs/components/Btn.js +25 -0
- package/esm/designs/components/BtnsGroup.d.ts +5 -0
- package/esm/designs/components/BtnsGroup.js +5 -0
- package/esm/designs/components/Gap.d.ts +13 -0
- package/esm/designs/components/Gap.js +9 -0
- package/esm/designs/components/Illus.d.ts +6 -0
- package/esm/designs/components/Illus.js +13 -0
- package/esm/designs/components/ItemDesc.d.ts +7 -0
- package/esm/designs/components/ItemDesc.js +19 -0
- package/esm/designs/components/ItemIcon.d.ts +10 -0
- package/esm/designs/components/ItemIcon.js +29 -0
- package/esm/designs/components/ItemLabel.d.ts +6 -0
- package/esm/designs/components/ItemLabel.js +17 -0
- package/esm/designs/components/ItemValue.d.ts +8 -0
- package/esm/designs/components/ItemValue.js +18 -0
- package/esm/designs/components/ItemsGroup.d.ts +5 -0
- package/esm/designs/components/ItemsGroup.js +5 -0
- package/esm/designs/components/Title.d.ts +11 -0
- package/esm/designs/components/Title.js +32 -0
- package/esm/designs/components/index.d.ts +10 -0
- package/esm/designs/components/index.js +10 -0
- package/esm/designs/decorations/index.d.ts +3 -0
- package/esm/designs/decorations/index.js +3 -0
- package/esm/designs/decorations/simple-arrow.d.ts +6 -0
- package/esm/designs/decorations/simple-arrow.js +23 -0
- package/esm/designs/decorations/text-3d.d.ts +82 -0
- package/esm/designs/decorations/text-3d.js +13 -0
- package/esm/designs/decorations/triangle.d.ts +6 -0
- package/esm/designs/decorations/triangle.js +15 -0
- package/esm/designs/defs/DropShadow.d.ts +12 -0
- package/esm/designs/defs/DropShadow.js +5 -0
- package/esm/designs/defs/LinearGradient.d.ts +8 -0
- package/esm/designs/defs/LinearGradient.js +11 -0
- package/esm/designs/defs/index.d.ts +2 -0
- package/esm/designs/defs/index.js +2 -0
- package/esm/designs/index.d.ts +6 -0
- package/esm/designs/index.js +5 -0
- package/esm/designs/items/BadgeCard.d.ts +11 -0
- package/esm/designs/items/BadgeCard.js +33 -0
- package/esm/designs/items/CandyCardLite.d.ts +8 -0
- package/esm/designs/items/CandyCardLite.js +13 -0
- package/esm/designs/items/CapsuleItem.d.ts +10 -0
- package/esm/designs/items/CapsuleItem.js +56 -0
- package/esm/designs/items/CircleNode.d.ts +8 -0
- package/esm/designs/items/CircleNode.js +33 -0
- package/esm/designs/items/CircularProgress.d.ts +9 -0
- package/esm/designs/items/CircularProgress.js +24 -0
- package/esm/designs/items/CompactCard.d.ts +10 -0
- package/esm/designs/items/CompactCard.js +24 -0
- package/esm/designs/items/DoneList.d.ts +10 -0
- package/esm/designs/items/DoneList.js +20 -0
- package/esm/designs/items/HorizontalIconArrow.d.ts +7 -0
- package/esm/designs/items/HorizontalIconArrow.js +67 -0
- package/esm/designs/items/HorizontalIconLine.d.ts +7 -0
- package/esm/designs/items/HorizontalIconLine.js +40 -0
- package/esm/designs/items/IconBadge.d.ts +10 -0
- package/esm/designs/items/IconBadge.js +20 -0
- package/esm/designs/items/IndexedCard.d.ts +20 -0
- package/esm/designs/items/IndexedCard.js +62 -0
- package/esm/designs/items/LCornerCard.d.ts +8 -0
- package/esm/designs/items/LCornerCard.js +40 -0
- package/esm/designs/items/LetterCard.d.ts +16 -0
- package/esm/designs/items/LetterCard.js +54 -0
- package/esm/designs/items/PillBadge.d.ts +10 -0
- package/esm/designs/items/PillBadge.js +43 -0
- package/esm/designs/items/PlainText.d.ts +9 -0
- package/esm/designs/items/PlainText.js +16 -0
- package/esm/designs/items/ProgressCard.d.ts +12 -0
- package/esm/designs/items/ProgressCard.js +48 -0
- package/esm/designs/items/QuarterCircular.d.ts +10 -0
- package/esm/designs/items/QuarterCircular.js +145 -0
- package/esm/designs/items/QuarterSimpleCard.d.ts +11 -0
- package/esm/designs/items/QuarterSimpleCard.js +117 -0
- package/esm/designs/items/RibbonCard.d.ts +11 -0
- package/esm/designs/items/RibbonCard.js +24 -0
- package/esm/designs/items/RoundedRectNode.d.ts +9 -0
- package/esm/designs/items/RoundedRectNode.js +24 -0
- package/esm/designs/items/SimpleHorizontalArrow.d.ts +9 -0
- package/esm/designs/items/SimpleHorizontalArrow.js +41 -0
- package/esm/designs/items/SimpleIllusItem.d.ts +10 -0
- package/esm/designs/items/SimpleIllusItem.js +21 -0
- package/esm/designs/items/SimpleItem.d.ts +13 -0
- package/esm/designs/items/SimpleItem.js +112 -0
- package/esm/designs/items/SimpleVerticalArrow.d.ts +9 -0
- package/esm/designs/items/SimpleVerticalArrow.js +37 -0
- package/esm/designs/items/UnderlineText.d.ts +8 -0
- package/esm/designs/items/UnderlineText.js +45 -0
- package/esm/designs/items/VerticalIconArrow.d.ts +9 -0
- package/esm/designs/items/VerticalIconArrow.js +60 -0
- package/esm/designs/items/index.d.ts +28 -0
- package/esm/designs/items/index.js +27 -0
- package/esm/designs/items/registry.d.ts +4 -0
- package/esm/designs/items/registry.js +10 -0
- package/esm/designs/items/types.d.ts +24 -0
- package/esm/designs/items/types.js +1 -0
- package/esm/designs/layouts/Align.d.ts +9 -0
- package/esm/designs/layouts/Align.js +79 -0
- package/esm/designs/layouts/Flex.d.ts +11 -0
- package/esm/designs/layouts/Flex.js +204 -0
- package/esm/designs/layouts/index.d.ts +2 -0
- package/esm/designs/layouts/index.js +2 -0
- package/esm/designs/structures/chart-column.d.ts +12 -0
- package/esm/designs/structures/chart-column.js +68 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/index.d.ts +5 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/index.js +4 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.d.ts +4 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +19 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.d.ts +4 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +19 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/types.d.ts +11 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/types.js +9 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/vs.d.ts +4 -0
- package/esm/designs/structures/compare-binary-horizontal/dividers/vs.js +14 -0
- package/esm/designs/structures/compare-binary-horizontal/index.d.ts +12 -0
- package/esm/designs/structures/compare-binary-horizontal/index.js +86 -0
- package/esm/designs/structures/compare-hierarchy-left-right.d.ts +18 -0
- package/esm/designs/structures/compare-hierarchy-left-right.js +140 -0
- package/esm/designs/structures/compare-hierarchy-row.d.ts +17 -0
- package/esm/designs/structures/compare-hierarchy-row.js +74 -0
- package/esm/designs/structures/hierarchy-tree.d.ts +41 -0
- package/esm/designs/structures/hierarchy-tree.js +296 -0
- package/esm/designs/structures/index.d.ts +32 -0
- package/esm/designs/structures/index.js +31 -0
- package/esm/designs/structures/list-column.d.ts +9 -0
- package/esm/designs/structures/list-column.js +34 -0
- package/esm/designs/structures/list-grid.d.ts +9 -0
- package/esm/designs/structures/list-grid.js +47 -0
- package/esm/designs/structures/list-pyramid.d.ts +8 -0
- package/esm/designs/structures/list-pyramid.js +59 -0
- package/esm/designs/structures/list-row.d.ts +8 -0
- package/esm/designs/structures/list-row.js +36 -0
- package/esm/designs/structures/list-sector.d.ts +11 -0
- package/esm/designs/structures/list-sector.js +147 -0
- package/esm/designs/structures/list-waterfall.d.ts +9 -0
- package/esm/designs/structures/list-waterfall.js +55 -0
- package/esm/designs/structures/quadrant.d.ts +14 -0
- package/esm/designs/structures/quadrant.js +96 -0
- package/esm/designs/structures/registry.d.ts +4 -0
- package/esm/designs/structures/registry.js +10 -0
- package/esm/designs/structures/relation-circle.d.ts +8 -0
- package/esm/designs/structures/relation-circle.js +77 -0
- package/esm/designs/structures/relation-network.d.ts +19 -0
- package/esm/designs/structures/relation-network.js +92 -0
- package/esm/designs/structures/sequence-ascending-stairs-3d.d.ts +7 -0
- package/esm/designs/structures/sequence-ascending-stairs-3d.js +63 -0
- package/esm/designs/structures/sequence-ascending-steps.d.ts +8 -0
- package/esm/designs/structures/sequence-ascending-steps.js +32 -0
- package/esm/designs/structures/sequence-circle-arrows.d.ts +9 -0
- package/esm/designs/structures/sequence-circle-arrows.js +198 -0
- package/esm/designs/structures/sequence-circular.d.ts +13 -0
- package/esm/designs/structures/sequence-circular.js +171 -0
- package/esm/designs/structures/sequence-color-snake-steps.d.ts +11 -0
- package/esm/designs/structures/sequence-color-snake-steps.js +90 -0
- package/esm/designs/structures/sequence-cylinders-3d.d.ts +15 -0
- package/esm/designs/structures/sequence-cylinders-3d.js +277 -0
- package/esm/designs/structures/sequence-filter-mesh.d.ts +7 -0
- package/esm/designs/structures/sequence-filter-mesh.js +217 -0
- package/esm/designs/structures/sequence-horizontal-zigzag.d.ts +8 -0
- package/esm/designs/structures/sequence-horizontal-zigzag.js +153 -0
- package/esm/designs/structures/sequence-mountain.d.ts +11 -0
- package/esm/designs/structures/sequence-mountain.js +281 -0
- package/esm/designs/structures/sequence-pyramid.d.ts +10 -0
- package/esm/designs/structures/sequence-pyramid.js +94 -0
- package/esm/designs/structures/sequence-roadmap-vertical.d.ts +9 -0
- package/esm/designs/structures/sequence-roadmap-vertical.js +151 -0
- package/esm/designs/structures/sequence-snake-steps.d.ts +9 -0
- package/esm/designs/structures/sequence-snake-steps.js +78 -0
- package/esm/designs/structures/sequence-steps.d.ts +7 -0
- package/esm/designs/structures/sequence-steps.js +47 -0
- package/esm/designs/structures/sequence-timeline.d.ts +8 -0
- package/esm/designs/structures/sequence-timeline.js +64 -0
- package/esm/designs/structures/sequence-zigzag-pucks-3d.d.ts +7 -0
- package/esm/designs/structures/sequence-zigzag-pucks-3d.js +70 -0
- package/esm/designs/structures/sequence-zigzag-steps.d.ts +9 -0
- package/esm/designs/structures/sequence-zigzag-steps.js +126 -0
- package/esm/designs/structures/types.d.ts +19 -0
- package/esm/designs/structures/types.js +1 -0
- package/esm/designs/title/index.d.ts +1 -0
- package/esm/designs/title/index.js +1 -0
- package/esm/designs/title/types.d.ts +4 -0
- package/esm/designs/title/types.js +1 -0
- package/esm/designs/types.d.ts +29 -0
- package/esm/designs/types.js +1 -0
- package/esm/designs/utils/color.d.ts +8 -0
- package/esm/designs/utils/color.js +26 -0
- package/esm/designs/utils/hierarchy-color.d.ts +61 -0
- package/esm/designs/utils/hierarchy-color.js +101 -0
- package/esm/designs/utils/index.d.ts +3 -0
- package/esm/designs/utils/index.js +3 -0
- package/esm/designs/utils/item.d.ts +14 -0
- package/esm/designs/utils/item.js +49 -0
- package/esm/index.d.ts +13 -0
- package/esm/index.js +9 -0
- package/esm/jsx-runtime.d.ts +1 -0
- package/esm/jsx-runtime.js +1 -0
- package/esm/options/index.d.ts +2 -0
- package/esm/options/index.js +1 -0
- package/esm/options/parser.d.ts +2 -0
- package/esm/options/parser.js +113 -0
- package/esm/options/types.d.ts +45 -0
- package/esm/options/types.js +1 -0
- package/esm/renderer/composites/background.d.ts +1 -0
- package/esm/renderer/composites/background.js +26 -0
- package/esm/renderer/composites/button.d.ts +1 -0
- package/esm/renderer/composites/button.js +68 -0
- package/esm/renderer/composites/icon.d.ts +6 -0
- package/esm/renderer/composites/icon.js +37 -0
- package/esm/renderer/composites/illus.d.ts +3 -0
- package/esm/renderer/composites/illus.js +79 -0
- package/esm/renderer/composites/index.d.ts +7 -0
- package/esm/renderer/composites/index.js +7 -0
- package/esm/renderer/composites/shape.d.ts +4 -0
- package/esm/renderer/composites/shape.js +45 -0
- package/esm/renderer/composites/svg.d.ts +2 -0
- package/esm/renderer/composites/svg.js +6 -0
- package/esm/renderer/composites/text.d.ts +6 -0
- package/esm/renderer/composites/text.js +102 -0
- package/esm/renderer/constants/data-url.d.ts +5 -0
- package/esm/renderer/constants/data-url.js +1 -0
- package/esm/renderer/constants/index.d.ts +2 -0
- package/esm/renderer/constants/index.js +2 -0
- package/esm/renderer/fonts/built-in.d.ts +2 -0
- package/esm/renderer/fonts/built-in.js +37 -0
- package/esm/renderer/fonts/index.d.ts +4 -0
- package/esm/renderer/fonts/index.js +6 -0
- package/esm/renderer/fonts/loader.d.ts +4 -0
- package/esm/renderer/fonts/loader.js +54 -0
- package/esm/renderer/fonts/registry.d.ts +24 -0
- package/esm/renderer/fonts/registry.js +45 -0
- package/esm/renderer/fonts/types.d.ts +9 -0
- package/esm/renderer/fonts/types.js +1 -0
- package/esm/renderer/fonts/utils.d.ts +4 -0
- package/esm/renderer/fonts/utils.js +35 -0
- package/esm/renderer/index.d.ts +4 -0
- package/esm/renderer/index.js +3 -0
- package/esm/renderer/palettes/built-in.d.ts +3 -0
- package/esm/renderer/palettes/built-in.js +81 -0
- package/esm/renderer/palettes/index.d.ts +5 -0
- package/esm/renderer/palettes/index.js +4 -0
- package/esm/renderer/palettes/registry.d.ts +3 -0
- package/esm/renderer/palettes/registry.js +7 -0
- package/esm/renderer/palettes/types.d.ts +1 -0
- package/esm/renderer/palettes/types.js +1 -0
- package/esm/renderer/palettes/utils.d.ts +2 -0
- package/esm/renderer/palettes/utils.js +14 -0
- package/esm/renderer/renderer.d.ts +11 -0
- package/esm/renderer/renderer.js +207 -0
- package/esm/renderer/stylize/gradient.d.ts +2 -0
- package/esm/renderer/stylize/gradient.js +102 -0
- package/esm/renderer/stylize/index.d.ts +3 -0
- package/esm/renderer/stylize/index.js +3 -0
- package/esm/renderer/stylize/pattern.d.ts +3 -0
- package/esm/renderer/stylize/pattern.js +57 -0
- package/esm/renderer/stylize/patterns/diamond.d.ts +2 -0
- package/esm/renderer/stylize/patterns/diamond.js +23 -0
- package/esm/renderer/stylize/patterns/dot.d.ts +2 -0
- package/esm/renderer/stylize/patterns/dot.js +31 -0
- package/esm/renderer/stylize/patterns/hex.d.ts +2 -0
- package/esm/renderer/stylize/patterns/hex.js +22 -0
- package/esm/renderer/stylize/patterns/index.d.ts +6 -0
- package/esm/renderer/stylize/patterns/index.js +6 -0
- package/esm/renderer/stylize/patterns/line.d.ts +2 -0
- package/esm/renderer/stylize/patterns/line.js +39 -0
- package/esm/renderer/stylize/patterns/mosaic.d.ts +2 -0
- package/esm/renderer/stylize/patterns/mosaic.js +36 -0
- package/esm/renderer/stylize/patterns/square.d.ts +2 -0
- package/esm/renderer/stylize/patterns/square.js +22 -0
- package/esm/renderer/stylize/rough.d.ts +2 -0
- package/esm/renderer/stylize/rough.js +108 -0
- package/esm/renderer/types/index.d.ts +3 -0
- package/esm/renderer/types/index.js +1 -0
- package/esm/renderer/types/renderer.d.ts +6 -0
- package/esm/renderer/types/renderer.js +1 -0
- package/esm/renderer/types/stylize.d.ts +42 -0
- package/esm/renderer/types/stylize.js +1 -0
- package/esm/renderer/types/text.d.ts +3 -0
- package/esm/renderer/types/text.js +1 -0
- package/esm/renderer/utils/attrs.d.ts +2 -0
- package/esm/renderer/utils/attrs.js +21 -0
- package/esm/renderer/utils/id.d.ts +1 -0
- package/esm/renderer/utils/id.js +3 -0
- package/esm/renderer/utils/index.d.ts +2 -0
- package/esm/renderer/utils/index.js +2 -0
- package/esm/resource/index.d.ts +5 -0
- package/esm/resource/index.js +4 -0
- package/esm/resource/loader.d.ts +6 -0
- package/esm/resource/loader.js +54 -0
- package/esm/resource/loaders/image.d.ts +1 -0
- package/esm/resource/loaders/image.js +70 -0
- package/esm/resource/loaders/index.d.ts +3 -0
- package/esm/resource/loaders/index.js +3 -0
- package/esm/resource/loaders/remote.d.ts +1 -0
- package/esm/resource/loaders/remote.js +35 -0
- package/esm/resource/loaders/svg.d.ts +1 -0
- package/esm/resource/loaders/svg.js +12 -0
- package/esm/resource/registry.d.ts +3 -0
- package/esm/resource/registry.js +7 -0
- package/esm/resource/types/font.d.ts +12 -0
- package/esm/resource/types/font.js +1 -0
- package/esm/resource/types/index.d.ts +1 -0
- package/esm/resource/types/index.js +1 -0
- package/esm/resource/types/resource.d.ts +7 -0
- package/esm/resource/types/resource.js +1 -0
- package/esm/resource/utils/data-uri.d.ts +2 -0
- package/esm/resource/utils/data-uri.js +22 -0
- package/esm/resource/utils/hash.d.ts +1 -0
- package/esm/resource/utils/hash.js +11 -0
- package/esm/resource/utils/index.d.ts +4 -0
- package/esm/resource/utils/index.js +4 -0
- package/esm/resource/utils/parser.d.ts +2 -0
- package/esm/resource/utils/parser.js +6 -0
- package/esm/resource/utils/ref.d.ts +3 -0
- package/esm/resource/utils/ref.js +14 -0
- package/esm/runtime/Infographic.d.ts +15 -0
- package/esm/runtime/Infographic.js +45 -0
- package/esm/runtime/index.d.ts +1 -0
- package/esm/runtime/index.js +1 -0
- package/esm/templates/built-in.d.ts +1 -0
- package/esm/templates/built-in.js +693 -0
- package/esm/templates/hierarchy-tree.d.ts +2 -0
- package/esm/templates/hierarchy-tree.js +65 -0
- package/esm/templates/index.d.ts +3 -0
- package/esm/templates/index.js +2 -0
- package/esm/templates/registry.d.ts +4 -0
- package/esm/templates/registry.js +10 -0
- package/esm/templates/types.d.ts +3 -0
- package/esm/templates/types.js +1 -0
- package/esm/themes/built-in.d.ts +1 -0
- package/esm/themes/built-in.js +9 -0
- package/esm/themes/generator.d.ts +2 -0
- package/esm/themes/generator.js +82 -0
- package/esm/themes/index.d.ts +4 -0
- package/esm/themes/index.js +3 -0
- package/esm/themes/registry.d.ts +4 -0
- package/esm/themes/registry.js +10 -0
- package/esm/themes/types.d.ts +60 -0
- package/esm/themes/types.js +1 -0
- package/esm/types/attrs.d.ts +53 -0
- package/esm/types/attrs.js +1 -0
- package/esm/types/data.d.ts +17 -0
- package/esm/types/data.js +1 -0
- package/esm/types/element.d.ts +8 -0
- package/esm/types/element.js +1 -0
- package/esm/types/index.d.ts +5 -0
- package/esm/types/index.js +1 -0
- package/esm/types/padding.d.ts +2 -0
- package/esm/types/padding.js +1 -0
- package/esm/types/resource.d.ts +6 -0
- package/esm/types/resource.js +1 -0
- package/esm/utils/color.d.ts +2 -0
- package/esm/utils/color.js +19 -0
- package/esm/utils/data.d.ts +5 -0
- package/esm/utils/data.js +16 -0
- package/esm/utils/get-types.d.ts +7 -0
- package/esm/utils/get-types.js +47 -0
- package/esm/utils/icon.d.ts +6 -0
- package/esm/utils/icon.js +34 -0
- package/esm/utils/index.d.ts +11 -0
- package/esm/utils/index.js +11 -0
- package/esm/utils/item.d.ts +30 -0
- package/esm/utils/item.js +45 -0
- package/esm/utils/join.d.ts +1 -0
- package/esm/utils/join.js +6 -0
- package/esm/utils/padding.d.ts +2 -0
- package/esm/utils/padding.js +20 -0
- package/esm/utils/recognizer.d.ts +24 -0
- package/esm/utils/recognizer.js +52 -0
- package/esm/utils/svg.d.ts +8 -0
- package/esm/utils/svg.js +73 -0
- package/esm/utils/text.d.ts +2 -0
- package/esm/utils/text.js +115 -0
- package/esm/utils/uuid.d.ts +1 -0
- package/esm/utils/uuid.js +10 -0
- package/lib/constants/element.d.ts +11 -0
- package/lib/constants/element.js +2 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +17 -0
- package/lib/designs/components/Btn.d.ts +7 -0
- package/lib/designs/components/Btn.js +30 -0
- package/lib/designs/components/BtnsGroup.d.ts +5 -0
- package/lib/designs/components/BtnsGroup.js +9 -0
- package/lib/designs/components/Gap.d.ts +13 -0
- package/lib/designs/components/Gap.js +13 -0
- package/lib/designs/components/Illus.d.ts +6 -0
- package/lib/designs/components/Illus.js +17 -0
- package/lib/designs/components/ItemDesc.d.ts +7 -0
- package/lib/designs/components/ItemDesc.js +23 -0
- package/lib/designs/components/ItemIcon.d.ts +10 -0
- package/lib/designs/components/ItemIcon.js +34 -0
- package/lib/designs/components/ItemLabel.d.ts +6 -0
- package/lib/designs/components/ItemLabel.js +21 -0
- package/lib/designs/components/ItemValue.d.ts +8 -0
- package/lib/designs/components/ItemValue.js +22 -0
- package/lib/designs/components/ItemsGroup.d.ts +5 -0
- package/lib/designs/components/ItemsGroup.js +9 -0
- package/lib/designs/components/Title.d.ts +11 -0
- package/lib/designs/components/Title.js +36 -0
- package/lib/designs/components/index.d.ts +10 -0
- package/lib/designs/components/index.js +26 -0
- package/lib/designs/decorations/index.d.ts +3 -0
- package/lib/designs/decorations/index.js +19 -0
- package/lib/designs/decorations/simple-arrow.d.ts +6 -0
- package/lib/designs/decorations/simple-arrow.js +27 -0
- package/lib/designs/decorations/text-3d.d.ts +82 -0
- package/lib/designs/decorations/text-3d.js +17 -0
- package/lib/designs/decorations/triangle.d.ts +6 -0
- package/lib/designs/decorations/triangle.js +19 -0
- package/lib/designs/defs/DropShadow.d.ts +12 -0
- package/lib/designs/defs/DropShadow.js +9 -0
- package/lib/designs/defs/LinearGradient.d.ts +8 -0
- package/lib/designs/defs/LinearGradient.js +15 -0
- package/lib/designs/defs/index.d.ts +2 -0
- package/lib/designs/defs/index.js +18 -0
- package/lib/designs/index.d.ts +6 -0
- package/lib/designs/index.js +21 -0
- package/lib/designs/items/BadgeCard.d.ts +11 -0
- package/lib/designs/items/BadgeCard.js +40 -0
- package/lib/designs/items/CandyCardLite.d.ts +8 -0
- package/lib/designs/items/CandyCardLite.js +17 -0
- package/lib/designs/items/CapsuleItem.d.ts +10 -0
- package/lib/designs/items/CapsuleItem.js +60 -0
- package/lib/designs/items/CircleNode.d.ts +8 -0
- package/lib/designs/items/CircleNode.js +40 -0
- package/lib/designs/items/CircularProgress.d.ts +9 -0
- package/lib/designs/items/CircularProgress.js +28 -0
- package/lib/designs/items/CompactCard.d.ts +10 -0
- package/lib/designs/items/CompactCard.js +28 -0
- package/lib/designs/items/DoneList.d.ts +10 -0
- package/lib/designs/items/DoneList.js +24 -0
- package/lib/designs/items/HorizontalIconArrow.d.ts +7 -0
- package/lib/designs/items/HorizontalIconArrow.js +71 -0
- package/lib/designs/items/HorizontalIconLine.d.ts +7 -0
- package/lib/designs/items/HorizontalIconLine.js +44 -0
- package/lib/designs/items/IconBadge.d.ts +10 -0
- package/lib/designs/items/IconBadge.js +27 -0
- package/lib/designs/items/IndexedCard.d.ts +20 -0
- package/lib/designs/items/IndexedCard.js +69 -0
- package/lib/designs/items/LCornerCard.d.ts +8 -0
- package/lib/designs/items/LCornerCard.js +44 -0
- package/lib/designs/items/LetterCard.d.ts +16 -0
- package/lib/designs/items/LetterCard.js +61 -0
- package/lib/designs/items/PillBadge.d.ts +10 -0
- package/lib/designs/items/PillBadge.js +47 -0
- package/lib/designs/items/PlainText.d.ts +9 -0
- package/lib/designs/items/PlainText.js +20 -0
- package/lib/designs/items/ProgressCard.d.ts +12 -0
- package/lib/designs/items/ProgressCard.js +55 -0
- package/lib/designs/items/QuarterCircular.d.ts +10 -0
- package/lib/designs/items/QuarterCircular.js +149 -0
- package/lib/designs/items/QuarterSimpleCard.d.ts +11 -0
- package/lib/designs/items/QuarterSimpleCard.js +121 -0
- package/lib/designs/items/RibbonCard.d.ts +11 -0
- package/lib/designs/items/RibbonCard.js +31 -0
- package/lib/designs/items/RoundedRectNode.d.ts +9 -0
- package/lib/designs/items/RoundedRectNode.js +28 -0
- package/lib/designs/items/SimpleHorizontalArrow.d.ts +9 -0
- package/lib/designs/items/SimpleHorizontalArrow.js +45 -0
- package/lib/designs/items/SimpleIllusItem.d.ts +10 -0
- package/lib/designs/items/SimpleIllusItem.js +25 -0
- package/lib/designs/items/SimpleItem.d.ts +13 -0
- package/lib/designs/items/SimpleItem.js +116 -0
- package/lib/designs/items/SimpleVerticalArrow.d.ts +9 -0
- package/lib/designs/items/SimpleVerticalArrow.js +41 -0
- package/lib/designs/items/UnderlineText.d.ts +8 -0
- package/lib/designs/items/UnderlineText.js +49 -0
- package/lib/designs/items/VerticalIconArrow.d.ts +9 -0
- package/lib/designs/items/VerticalIconArrow.js +64 -0
- package/lib/designs/items/index.d.ts +28 -0
- package/lib/designs/items/index.js +43 -0
- package/lib/designs/items/registry.d.ts +4 -0
- package/lib/designs/items/registry.js +15 -0
- package/lib/designs/items/types.d.ts +24 -0
- package/lib/designs/items/types.js +2 -0
- package/lib/designs/layouts/Align.d.ts +9 -0
- package/lib/designs/layouts/Align.js +82 -0
- package/lib/designs/layouts/Flex.d.ts +11 -0
- package/lib/designs/layouts/Flex.js +207 -0
- package/lib/designs/layouts/index.d.ts +2 -0
- package/lib/designs/layouts/index.js +18 -0
- package/lib/designs/structures/chart-column.d.ts +12 -0
- package/lib/designs/structures/chart-column.js +75 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/index.d.ts +5 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/index.js +23 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.d.ts +4 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.js +23 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.d.ts +4 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.js +23 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/types.d.ts +11 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/types.js +14 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/vs.d.ts +4 -0
- package/lib/designs/structures/compare-binary-horizontal/dividers/vs.js +21 -0
- package/lib/designs/structures/compare-binary-horizontal/index.d.ts +12 -0
- package/lib/designs/structures/compare-binary-horizontal/index.js +90 -0
- package/lib/designs/structures/compare-hierarchy-left-right.d.ts +18 -0
- package/lib/designs/structures/compare-hierarchy-left-right.js +144 -0
- package/lib/designs/structures/compare-hierarchy-row.d.ts +17 -0
- package/lib/designs/structures/compare-hierarchy-row.js +78 -0
- package/lib/designs/structures/hierarchy-tree.d.ts +41 -0
- package/lib/designs/structures/hierarchy-tree.js +333 -0
- package/lib/designs/structures/index.d.ts +32 -0
- package/lib/designs/structures/index.js +47 -0
- package/lib/designs/structures/list-column.d.ts +9 -0
- package/lib/designs/structures/list-column.js +38 -0
- package/lib/designs/structures/list-grid.d.ts +9 -0
- package/lib/designs/structures/list-grid.js +51 -0
- package/lib/designs/structures/list-pyramid.d.ts +8 -0
- package/lib/designs/structures/list-pyramid.js +63 -0
- package/lib/designs/structures/list-row.d.ts +8 -0
- package/lib/designs/structures/list-row.js +40 -0
- package/lib/designs/structures/list-sector.d.ts +11 -0
- package/lib/designs/structures/list-sector.js +151 -0
- package/lib/designs/structures/list-waterfall.d.ts +9 -0
- package/lib/designs/structures/list-waterfall.js +59 -0
- package/lib/designs/structures/quadrant.d.ts +14 -0
- package/lib/designs/structures/quadrant.js +100 -0
- package/lib/designs/structures/registry.d.ts +4 -0
- package/lib/designs/structures/registry.js +15 -0
- package/lib/designs/structures/relation-circle.d.ts +8 -0
- package/lib/designs/structures/relation-circle.js +81 -0
- package/lib/designs/structures/relation-network.d.ts +19 -0
- package/lib/designs/structures/relation-network.js +129 -0
- package/lib/designs/structures/sequence-ascending-stairs-3d.d.ts +7 -0
- package/lib/designs/structures/sequence-ascending-stairs-3d.js +67 -0
- package/lib/designs/structures/sequence-ascending-steps.d.ts +8 -0
- package/lib/designs/structures/sequence-ascending-steps.js +36 -0
- package/lib/designs/structures/sequence-circle-arrows.d.ts +9 -0
- package/lib/designs/structures/sequence-circle-arrows.js +235 -0
- package/lib/designs/structures/sequence-circular.d.ts +13 -0
- package/lib/designs/structures/sequence-circular.js +175 -0
- package/lib/designs/structures/sequence-color-snake-steps.d.ts +11 -0
- package/lib/designs/structures/sequence-color-snake-steps.js +94 -0
- package/lib/designs/structures/sequence-cylinders-3d.d.ts +15 -0
- package/lib/designs/structures/sequence-cylinders-3d.js +284 -0
- package/lib/designs/structures/sequence-filter-mesh.d.ts +7 -0
- package/lib/designs/structures/sequence-filter-mesh.js +221 -0
- package/lib/designs/structures/sequence-horizontal-zigzag.d.ts +8 -0
- package/lib/designs/structures/sequence-horizontal-zigzag.js +157 -0
- package/lib/designs/structures/sequence-mountain.d.ts +11 -0
- package/lib/designs/structures/sequence-mountain.js +288 -0
- package/lib/designs/structures/sequence-pyramid.d.ts +10 -0
- package/lib/designs/structures/sequence-pyramid.js +134 -0
- package/lib/designs/structures/sequence-roadmap-vertical.d.ts +9 -0
- package/lib/designs/structures/sequence-roadmap-vertical.js +155 -0
- package/lib/designs/structures/sequence-snake-steps.d.ts +9 -0
- package/lib/designs/structures/sequence-snake-steps.js +82 -0
- package/lib/designs/structures/sequence-steps.d.ts +7 -0
- package/lib/designs/structures/sequence-steps.js +51 -0
- package/lib/designs/structures/sequence-timeline.d.ts +8 -0
- package/lib/designs/structures/sequence-timeline.js +68 -0
- package/lib/designs/structures/sequence-zigzag-pucks-3d.d.ts +7 -0
- package/lib/designs/structures/sequence-zigzag-pucks-3d.js +74 -0
- package/lib/designs/structures/sequence-zigzag-steps.d.ts +9 -0
- package/lib/designs/structures/sequence-zigzag-steps.js +130 -0
- package/lib/designs/structures/types.d.ts +19 -0
- package/lib/designs/structures/types.js +2 -0
- package/lib/designs/title/index.d.ts +1 -0
- package/lib/designs/title/index.js +2 -0
- package/lib/designs/title/types.d.ts +4 -0
- package/lib/designs/title/types.js +2 -0
- package/lib/designs/types.d.ts +29 -0
- package/lib/designs/types.js +2 -0
- package/lib/designs/utils/color.d.ts +8 -0
- package/lib/designs/utils/color.js +32 -0
- package/lib/designs/utils/hierarchy-color.d.ts +61 -0
- package/lib/designs/utils/hierarchy-color.js +105 -0
- package/lib/designs/utils/index.d.ts +3 -0
- package/lib/designs/utils/index.js +19 -0
- package/lib/designs/utils/item.d.ts +14 -0
- package/lib/designs/utils/item.js +54 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +39 -0
- package/lib/jsx-runtime.d.ts +1 -0
- package/lib/jsx-runtime.js +17 -0
- package/lib/options/index.d.ts +2 -0
- package/lib/options/index.js +5 -0
- package/lib/options/parser.d.ts +2 -0
- package/lib/options/parser.js +116 -0
- package/lib/options/types.d.ts +45 -0
- package/lib/options/types.js +2 -0
- package/lib/renderer/composites/background.d.ts +1 -0
- package/lib/renderer/composites/background.js +29 -0
- package/lib/renderer/composites/button.d.ts +1 -0
- package/lib/renderer/composites/button.js +71 -0
- package/lib/renderer/composites/icon.d.ts +6 -0
- package/lib/renderer/composites/icon.js +41 -0
- package/lib/renderer/composites/illus.d.ts +3 -0
- package/lib/renderer/composites/illus.js +82 -0
- package/lib/renderer/composites/index.d.ts +7 -0
- package/lib/renderer/composites/index.js +22 -0
- package/lib/renderer/composites/shape.d.ts +4 -0
- package/lib/renderer/composites/shape.js +50 -0
- package/lib/renderer/composites/svg.d.ts +2 -0
- package/lib/renderer/composites/svg.js +9 -0
- package/lib/renderer/composites/text.d.ts +6 -0
- package/lib/renderer/composites/text.js +107 -0
- package/lib/renderer/constants/data-url.d.ts +5 -0
- package/lib/renderer/constants/data-url.js +2 -0
- package/lib/renderer/constants/index.d.ts +2 -0
- package/lib/renderer/constants/index.js +18 -0
- package/lib/renderer/fonts/built-in.d.ts +2 -0
- package/lib/renderer/fonts/built-in.js +40 -0
- package/lib/renderer/fonts/index.d.ts +4 -0
- package/lib/renderer/fonts/index.js +20 -0
- package/lib/renderer/fonts/loader.d.ts +4 -0
- package/lib/renderer/fonts/loader.js +60 -0
- package/lib/renderer/fonts/registry.d.ts +24 -0
- package/lib/renderer/fonts/registry.js +53 -0
- package/lib/renderer/fonts/types.d.ts +9 -0
- package/lib/renderer/fonts/types.js +2 -0
- package/lib/renderer/fonts/utils.d.ts +4 -0
- package/lib/renderer/fonts/utils.js +40 -0
- package/lib/renderer/index.d.ts +4 -0
- package/lib/renderer/index.js +21 -0
- package/lib/renderer/palettes/built-in.d.ts +3 -0
- package/lib/renderer/palettes/built-in.js +85 -0
- package/lib/renderer/palettes/index.d.ts +5 -0
- package/lib/renderer/palettes/index.js +9 -0
- package/lib/renderer/palettes/registry.d.ts +3 -0
- package/lib/renderer/palettes/registry.js +11 -0
- package/lib/renderer/palettes/types.d.ts +1 -0
- package/lib/renderer/palettes/types.js +2 -0
- package/lib/renderer/palettes/utils.d.ts +2 -0
- package/lib/renderer/palettes/utils.js +18 -0
- package/lib/renderer/renderer.d.ts +11 -0
- package/lib/renderer/renderer.js +211 -0
- package/lib/renderer/stylize/gradient.d.ts +2 -0
- package/lib/renderer/stylize/gradient.js +108 -0
- package/lib/renderer/stylize/index.d.ts +3 -0
- package/lib/renderer/stylize/index.js +9 -0
- package/lib/renderer/stylize/pattern.d.ts +3 -0
- package/lib/renderer/stylize/pattern.js +97 -0
- package/lib/renderer/stylize/patterns/diamond.d.ts +2 -0
- package/lib/renderer/stylize/patterns/diamond.js +27 -0
- package/lib/renderer/stylize/patterns/dot.d.ts +2 -0
- package/lib/renderer/stylize/patterns/dot.js +35 -0
- package/lib/renderer/stylize/patterns/hex.d.ts +2 -0
- package/lib/renderer/stylize/patterns/hex.js +26 -0
- package/lib/renderer/stylize/patterns/index.d.ts +6 -0
- package/lib/renderer/stylize/patterns/index.js +15 -0
- package/lib/renderer/stylize/patterns/line.d.ts +2 -0
- package/lib/renderer/stylize/patterns/line.js +43 -0
- package/lib/renderer/stylize/patterns/mosaic.d.ts +2 -0
- package/lib/renderer/stylize/patterns/mosaic.js +40 -0
- package/lib/renderer/stylize/patterns/square.d.ts +2 -0
- package/lib/renderer/stylize/patterns/square.js +26 -0
- package/lib/renderer/stylize/rough.d.ts +2 -0
- package/lib/renderer/stylize/rough.js +114 -0
- package/lib/renderer/types/index.d.ts +3 -0
- package/lib/renderer/types/index.js +2 -0
- package/lib/renderer/types/renderer.d.ts +6 -0
- package/lib/renderer/types/renderer.js +2 -0
- package/lib/renderer/types/stylize.d.ts +42 -0
- package/lib/renderer/types/stylize.js +2 -0
- package/lib/renderer/types/text.d.ts +3 -0
- package/lib/renderer/types/text.js +2 -0
- package/lib/renderer/utils/attrs.d.ts +2 -0
- package/lib/renderer/utils/attrs.js +24 -0
- package/lib/renderer/utils/id.d.ts +1 -0
- package/lib/renderer/utils/id.js +6 -0
- package/lib/renderer/utils/index.d.ts +2 -0
- package/lib/renderer/utils/index.js +18 -0
- package/lib/resource/index.d.ts +5 -0
- package/lib/resource/index.js +26 -0
- package/lib/resource/loader.d.ts +6 -0
- package/lib/resource/loader.js +57 -0
- package/lib/resource/loaders/image.d.ts +1 -0
- package/lib/resource/loaders/image.js +73 -0
- package/lib/resource/loaders/index.d.ts +3 -0
- package/lib/resource/loaders/index.js +19 -0
- package/lib/resource/loaders/remote.d.ts +1 -0
- package/lib/resource/loaders/remote.js +38 -0
- package/lib/resource/loaders/svg.d.ts +1 -0
- package/lib/resource/loaders/svg.js +15 -0
- package/lib/resource/registry.d.ts +3 -0
- package/lib/resource/registry.js +11 -0
- package/lib/resource/types/font.d.ts +12 -0
- package/lib/resource/types/font.js +2 -0
- package/lib/resource/types/index.d.ts +1 -0
- package/lib/resource/types/index.js +2 -0
- package/lib/resource/types/resource.d.ts +7 -0
- package/lib/resource/types/resource.js +2 -0
- package/lib/resource/utils/data-uri.d.ts +2 -0
- package/lib/resource/utils/data-uri.js +25 -0
- package/lib/resource/utils/hash.d.ts +1 -0
- package/lib/resource/utils/hash.js +14 -0
- package/lib/resource/utils/index.d.ts +4 -0
- package/lib/resource/utils/index.js +20 -0
- package/lib/resource/utils/parser.d.ts +2 -0
- package/lib/resource/utils/parser.js +9 -0
- package/lib/resource/utils/ref.d.ts +3 -0
- package/lib/resource/utils/ref.js +18 -0
- package/lib/runtime/Infographic.d.ts +15 -0
- package/lib/runtime/Infographic.js +49 -0
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.js +17 -0
- package/lib/templates/built-in.d.ts +1 -0
- package/lib/templates/built-in.js +695 -0
- package/lib/templates/hierarchy-tree.d.ts +2 -0
- package/lib/templates/hierarchy-tree.js +68 -0
- package/lib/templates/index.d.ts +3 -0
- package/lib/templates/index.js +18 -0
- package/lib/templates/registry.d.ts +4 -0
- package/lib/templates/registry.js +15 -0
- package/lib/templates/types.d.ts +3 -0
- package/lib/templates/types.js +2 -0
- package/lib/themes/built-in.d.ts +1 -0
- package/lib/themes/built-in.js +11 -0
- package/lib/themes/generator.d.ts +2 -0
- package/lib/themes/generator.js +86 -0
- package/lib/themes/index.d.ts +4 -0
- package/lib/themes/index.js +21 -0
- package/lib/themes/registry.d.ts +4 -0
- package/lib/themes/registry.js +15 -0
- package/lib/themes/types.d.ts +60 -0
- package/lib/themes/types.js +2 -0
- package/lib/types/attrs.d.ts +53 -0
- package/lib/types/attrs.js +2 -0
- package/lib/types/data.d.ts +17 -0
- package/lib/types/data.js +2 -0
- package/lib/types/element.d.ts +8 -0
- package/lib/types/element.js +2 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/index.js +2 -0
- package/lib/types/padding.d.ts +2 -0
- package/lib/types/padding.js +2 -0
- package/lib/types/resource.d.ts +6 -0
- package/lib/types/resource.js +2 -0
- package/lib/utils/color.d.ts +2 -0
- package/lib/utils/color.js +23 -0
- package/lib/utils/data.d.ts +5 -0
- package/lib/utils/data.js +22 -0
- package/lib/utils/get-types.d.ts +7 -0
- package/lib/utils/get-types.js +50 -0
- package/lib/utils/icon.d.ts +6 -0
- package/lib/utils/icon.js +40 -0
- package/lib/utils/index.d.ts +11 -0
- package/lib/utils/index.js +27 -0
- package/lib/utils/item.d.ts +30 -0
- package/lib/utils/item.js +53 -0
- package/lib/utils/join.d.ts +1 -0
- package/lib/utils/join.js +9 -0
- package/lib/utils/padding.d.ts +2 -0
- package/lib/utils/padding.js +23 -0
- package/lib/utils/recognizer.d.ts +24 -0
- package/lib/utils/recognizer.js +79 -0
- package/lib/utils/svg.d.ts +8 -0
- package/lib/utils/svg.js +83 -0
- package/lib/utils/text.d.ts +2 -0
- package/lib/utils/text.js +121 -0
- package/lib/utils/uuid.d.ts +1 -0
- package/lib/utils/uuid.js +13 -0
- package/package.json +69 -0
- package/src/constants/element.ts +11 -0
- package/src/constants/index.ts +1 -0
- package/src/designs/components/Btn.tsx +32 -0
- package/src/designs/components/BtnsGroup.tsx +9 -0
- package/src/designs/components/Gap.tsx +17 -0
- package/src/designs/components/Illus.tsx +21 -0
- package/src/designs/components/ItemDesc.tsx +37 -0
- package/src/designs/components/ItemIcon.tsx +53 -0
- package/src/designs/components/ItemLabel.tsx +29 -0
- package/src/designs/components/ItemValue.tsx +37 -0
- package/src/designs/components/ItemsGroup.tsx +9 -0
- package/src/designs/components/Title.tsx +77 -0
- package/src/designs/components/index.ts +10 -0
- package/src/designs/decorations/index.ts +3 -0
- package/src/designs/decorations/simple-arrow.tsx +57 -0
- package/src/designs/decorations/text-3d.tsx +158 -0
- package/src/designs/decorations/triangle.tsx +40 -0
- package/src/designs/defs/DropShadow.tsx +33 -0
- package/src/designs/defs/LinearGradient.tsx +31 -0
- package/src/designs/defs/index.ts +2 -0
- package/src/designs/index.ts +6 -0
- package/src/designs/items/BadgeCard.tsx +165 -0
- package/src/designs/items/CandyCardLite.tsx +88 -0
- package/src/designs/items/CapsuleItem.tsx +148 -0
- package/src/designs/items/CircleNode.tsx +107 -0
- package/src/designs/items/CircularProgress.tsx +106 -0
- package/src/designs/items/CompactCard.tsx +147 -0
- package/src/designs/items/DoneList.tsx +69 -0
- package/src/designs/items/HorizontalIconArrow.tsx +225 -0
- package/src/designs/items/HorizontalIconLine.tsx +152 -0
- package/src/designs/items/IconBadge.tsx +125 -0
- package/src/designs/items/IndexedCard.tsx +210 -0
- package/src/designs/items/LCornerCard.tsx +109 -0
- package/src/designs/items/LetterCard.tsx +187 -0
- package/src/designs/items/PillBadge.tsx +138 -0
- package/src/designs/items/PlainText.tsx +53 -0
- package/src/designs/items/ProgressCard.tsx +198 -0
- package/src/designs/items/QuarterCircular.tsx +284 -0
- package/src/designs/items/QuarterSimpleCard.tsx +210 -0
- package/src/designs/items/RibbonCard.tsx +151 -0
- package/src/designs/items/RoundedRectNode.tsx +79 -0
- package/src/designs/items/SimpleHorizontalArrow.tsx +150 -0
- package/src/designs/items/SimpleIllusItem.tsx +78 -0
- package/src/designs/items/SimpleItem.tsx +336 -0
- package/src/designs/items/SimpleVerticalArrow.tsx +147 -0
- package/src/designs/items/UnderlineText.tsx +126 -0
- package/src/designs/items/VerticalIconArrow.tsx +227 -0
- package/src/designs/items/index.ts +28 -0
- package/src/designs/items/prompt.md +891 -0
- package/src/designs/items/registry.ts +15 -0
- package/src/designs/items/types.ts +28 -0
- package/src/designs/layouts/Align.tsx +104 -0
- package/src/designs/layouts/Flex.tsx +274 -0
- package/src/designs/layouts/index.tsx +2 -0
- package/src/designs/structures/chart-column.tsx +186 -0
- package/src/designs/structures/compare-binary-horizontal/dividers/index.ts +5 -0
- package/src/designs/structures/compare-binary-horizontal/dividers/pros-cons-arrow.tsx +46 -0
- package/src/designs/structures/compare-binary-horizontal/dividers/pros-cons-fold.tsx +68 -0
- package/src/designs/structures/compare-binary-horizontal/dividers/types.ts +26 -0
- package/src/designs/structures/compare-binary-horizontal/dividers/vs.tsx +57 -0
- package/src/designs/structures/compare-binary-horizontal/index.tsx +271 -0
- package/src/designs/structures/compare-hierarchy-left-right.tsx +362 -0
- package/src/designs/structures/compare-hierarchy-row.tsx +220 -0
- package/src/designs/structures/hierarchy-tree.tsx +594 -0
- package/src/designs/structures/index.ts +32 -0
- package/src/designs/structures/list-column.tsx +89 -0
- package/src/designs/structures/list-grid.tsx +118 -0
- package/src/designs/structures/list-pyramid.tsx +132 -0
- package/src/designs/structures/list-row.tsx +90 -0
- package/src/designs/structures/list-sector.tsx +296 -0
- package/src/designs/structures/list-waterfall.tsx +140 -0
- package/src/designs/structures/prompt.md +996 -0
- package/src/designs/structures/quadrant.tsx +241 -0
- package/src/designs/structures/registry.ts +15 -0
- package/src/designs/structures/relation-circle.tsx +150 -0
- package/src/designs/structures/relation-network.tsx +191 -0
- package/src/designs/structures/sequence-ascending-stairs-3d.tsx +241 -0
- package/src/designs/structures/sequence-ascending-steps.tsx +81 -0
- package/src/designs/structures/sequence-circle-arrows.tsx +392 -0
- package/src/designs/structures/sequence-circular.tsx +368 -0
- package/src/designs/structures/sequence-color-snake-steps.tsx +223 -0
- package/src/designs/structures/sequence-cylinders-3d.tsx +804 -0
- package/src/designs/structures/sequence-filter-mesh.tsx +443 -0
- package/src/designs/structures/sequence-horizontal-zigzag.tsx +310 -0
- package/src/designs/structures/sequence-mountain.tsx +567 -0
- package/src/designs/structures/sequence-pyramid.tsx +222 -0
- package/src/designs/structures/sequence-roadmap-vertical.tsx +338 -0
- package/src/designs/structures/sequence-snake-steps.tsx +191 -0
- package/src/designs/structures/sequence-steps.tsx +122 -0
- package/src/designs/structures/sequence-timeline.tsx +189 -0
- package/src/designs/structures/sequence-zigzag-pucks-3d.tsx +261 -0
- package/src/designs/structures/sequence-zigzag-steps.tsx +280 -0
- package/src/designs/structures/types.ts +25 -0
- package/src/designs/title/index.ts +1 -0
- package/src/designs/title/types.ts +4 -0
- package/src/designs/types.ts +27 -0
- package/src/designs/utils/color.ts +53 -0
- package/src/designs/utils/hierarchy-color.ts +127 -0
- package/src/designs/utils/index.ts +3 -0
- package/src/designs/utils/item.ts +66 -0
- package/src/index.ts +13 -0
- package/src/jsx-runtime.ts +1 -0
- package/src/options/index.ts +2 -0
- package/src/options/parser.ts +163 -0
- package/src/options/types.ts +47 -0
- package/src/renderer/composites/background.ts +33 -0
- package/src/renderer/composites/button.ts +99 -0
- package/src/renderer/composites/icon.ts +61 -0
- package/src/renderer/composites/illus.ts +119 -0
- package/src/renderer/composites/index.ts +7 -0
- package/src/renderer/composites/shape.ts +80 -0
- package/src/renderer/composites/svg.ts +12 -0
- package/src/renderer/composites/text.ts +160 -0
- package/src/renderer/constants/data-url.ts +5 -0
- package/src/renderer/constants/index.ts +2 -0
- package/src/renderer/fonts/built-in.ts +41 -0
- package/src/renderer/fonts/index.ts +15 -0
- package/src/renderer/fonts/loader.ts +64 -0
- package/src/renderer/fonts/registry.ts +51 -0
- package/src/renderer/fonts/types.ts +20 -0
- package/src/renderer/fonts/utils.ts +39 -0
- package/src/renderer/index.ts +4 -0
- package/src/renderer/palettes/built-in.ts +86 -0
- package/src/renderer/palettes/index.ts +6 -0
- package/src/renderer/palettes/registry.ts +11 -0
- package/src/renderer/palettes/types.ts +4 -0
- package/src/renderer/palettes/utils.ts +21 -0
- package/src/renderer/renderer.ts +325 -0
- package/src/renderer/stylize/gradient.ts +131 -0
- package/src/renderer/stylize/index.ts +3 -0
- package/src/renderer/stylize/pattern.ts +82 -0
- package/src/renderer/stylize/patterns/diamond.ts +29 -0
- package/src/renderer/stylize/patterns/dot.ts +37 -0
- package/src/renderer/stylize/patterns/hex.ts +29 -0
- package/src/renderer/stylize/patterns/index.ts +6 -0
- package/src/renderer/stylize/patterns/line.ts +46 -0
- package/src/renderer/stylize/patterns/mosaic.ts +45 -0
- package/src/renderer/stylize/patterns/square.ts +29 -0
- package/src/renderer/stylize/rough.ts +149 -0
- package/src/renderer/types/index.ts +3 -0
- package/src/renderer/types/renderer.ts +7 -0
- package/src/renderer/types/stylize.ts +43 -0
- package/src/renderer/types/text.ts +3 -0
- package/src/renderer/utils/attrs.ts +27 -0
- package/src/renderer/utils/id.ts +3 -0
- package/src/renderer/utils/index.ts +2 -0
- package/src/resource/index.ts +5 -0
- package/src/resource/loader.ts +64 -0
- package/src/resource/loaders/image.ts +87 -0
- package/src/resource/loaders/index.ts +3 -0
- package/src/resource/loaders/remote.ts +40 -0
- package/src/resource/loaders/svg.ts +13 -0
- package/src/resource/registry.ts +11 -0
- package/src/resource/types/font.ts +23 -0
- package/src/resource/types/index.ts +1 -0
- package/src/resource/types/resource.ts +9 -0
- package/src/resource/utils/data-uri.ts +26 -0
- package/src/resource/utils/hash.ts +11 -0
- package/src/resource/utils/index.ts +4 -0
- package/src/resource/utils/parser.ts +9 -0
- package/src/resource/utils/ref.ts +15 -0
- package/src/runtime/Infographic.tsx +65 -0
- package/src/runtime/index.ts +1 -0
- package/src/templates/built-in.ts +696 -0
- package/src/templates/hierarchy-tree.ts +70 -0
- package/src/templates/index.ts +3 -0
- package/src/templates/registry.ts +15 -0
- package/src/templates/types.ts +11 -0
- package/src/themes/built-in.ts +10 -0
- package/src/themes/generator.ts +131 -0
- package/src/themes/index.ts +4 -0
- package/src/themes/registry.ts +15 -0
- package/src/themes/types.ts +66 -0
- package/src/types/attrs.ts +56 -0
- package/src/types/data.ts +19 -0
- package/src/types/element.ts +13 -0
- package/src/types/index.ts +5 -0
- package/src/types/padding.ts +3 -0
- package/src/types/resource.ts +8 -0
- package/src/utils/color.ts +21 -0
- package/src/utils/data.ts +21 -0
- package/src/utils/get-types.ts +67 -0
- package/src/utils/icon.ts +51 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/item.ts +56 -0
- package/src/utils/join.ts +6 -0
- package/src/utils/padding.ts +21 -0
- package/src/utils/recognizer.ts +70 -0
- package/src/utils/svg.ts +104 -0
- package/src/utils/text.ts +150 -0
- package/src/utils/uuid.ts +11 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
import { Defs, Ellipse, getElementBounds, Group, Path, } from '@antv/infographic-jsx';
|
|
3
|
+
import { BtnAdd, BtnRemove, BtnsGroup, ItemIcon, ItemsGroup, } from '../components';
|
|
4
|
+
import { FlexLayout } from '../layouts';
|
|
5
|
+
import { getColorPrimary, getPaletteColor, getThemeColors } from '../utils';
|
|
6
|
+
import { registerStructure } from './registry';
|
|
7
|
+
// W 型路径参数
|
|
8
|
+
const DX = 240;
|
|
9
|
+
const DY = 130;
|
|
10
|
+
const ITEM_TO_PATH_GAP = 105;
|
|
11
|
+
// W 型路径宽度
|
|
12
|
+
const W_PATH_W = 12;
|
|
13
|
+
// 光晕尺寸 (Ellipse W/H)
|
|
14
|
+
const GLOW_W = 120; // 椭圆宽度 (水平对角线)
|
|
15
|
+
const GLOW_H = 50; // 椭圆高度 (垂直对角线)
|
|
16
|
+
const GLOW_OPACITY = 0.6; // 控制光晕的透明度,实现颜色调淡
|
|
17
|
+
// 原始装饰性 Path 的 D 属性
|
|
18
|
+
const DECO_PATH_1 = 'M132.821 50.6599L87.6795 76.8925C78.0629 82.4807 62.4238 82.4807 52.7445 76.8925L7.30824 50.6599C2.43719 47.8482 0.00459679 44.1562 0.0152907 40.472L3.17695e-05 45.6925C-0.0101404 49.378 2.42245 53.0686 7.29298 55.8803L52.7289 82.1129C62.4094 87.7011 78.0485 87.7011 87.6652 82.1129L132.806 55.8803C137.583 53.1038 139.975 49.4705 139.986 45.832L140 40.6116C139.989 44.2501 137.598 47.8834 132.821 50.6599Z';
|
|
19
|
+
const DECO_PATH_2 = 'M132.707 30.4224C142.386 36.0119 142.437 45.0704 132.821 50.6599L87.6795 76.8925C78.0629 82.4807 62.4238 82.4807 52.7445 76.8925L7.30825 50.6599C-2.37126 45.0717 -2.42225 36.0132 7.19414 30.4237L52.335 4.19115C61.9517 -1.39705 77.5908 -1.39705 87.2713 4.19115L132.707 30.4224Z';
|
|
20
|
+
// 装饰元素的偏移量 - 改为正值
|
|
21
|
+
const DECO_OFFSET_X = 70 + W_PATH_W / 2;
|
|
22
|
+
const DECO_OFFSET_Y = 40 + W_PATH_W / 2;
|
|
23
|
+
// 滤镜定义
|
|
24
|
+
const GlowFilter = (_jsx("filter", { id: "sequence-zigzag-glow-filter", x: "-50%", y: "-50%", width: "200%", height: "200%", children: _jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "15", result: "blur" }) }));
|
|
25
|
+
export const SequenceZigzagSteps = (props) => {
|
|
26
|
+
const { Title, Item, data, options, dx = DX, dy = DY, iconSize = 30 } = props;
|
|
27
|
+
const { title, desc, items = [] } = data;
|
|
28
|
+
const titleContent = Title ? _jsx(Title, { title: title, desc: desc }) : null;
|
|
29
|
+
const colorPrimary = getColorPrimary(options);
|
|
30
|
+
if (items.length === 0) {
|
|
31
|
+
const btnAddElement = _jsx(BtnAdd, { indexes: [0], x: 0, y: 0 });
|
|
32
|
+
return (_jsxs(FlexLayout, { id: "infographic-container", flexDirection: "column", justifyContent: "center", alignItems: "center", children: [_jsx(Defs, { children: GlowFilter }), titleContent, _jsx(Group, { children: _jsx(BtnsGroup, { children: btnAddElement }) })] }));
|
|
33
|
+
}
|
|
34
|
+
const itemBounds = getElementBounds(_jsx(Item, { indexes: [0], data: data, datum: items[0] }));
|
|
35
|
+
const btnBounds = getElementBounds(_jsx(BtnAdd, { indexes: [0] }));
|
|
36
|
+
const btnElements = [];
|
|
37
|
+
const itemElements = [];
|
|
38
|
+
const pathElements = [];
|
|
39
|
+
const decoElements = [];
|
|
40
|
+
const iconElements = [];
|
|
41
|
+
let currentX = 0;
|
|
42
|
+
let currentY = 0;
|
|
43
|
+
let pathD = '';
|
|
44
|
+
let minPathY = Infinity;
|
|
45
|
+
let maxItemY = -Infinity;
|
|
46
|
+
let minDecoX = Infinity;
|
|
47
|
+
let minDecoY = Infinity;
|
|
48
|
+
const pathPoints = [];
|
|
49
|
+
// Pass 1: 计算路径点和装饰元素的边界
|
|
50
|
+
items.forEach((item, index) => {
|
|
51
|
+
const cx = currentX;
|
|
52
|
+
const cy = currentY;
|
|
53
|
+
pathPoints.push({ x: cx, y: cy });
|
|
54
|
+
minPathY = Math.min(minPathY, cy);
|
|
55
|
+
// 计算装饰元素的位置
|
|
56
|
+
const decoX = cx - DECO_OFFSET_X;
|
|
57
|
+
const decoY = cy - DECO_OFFSET_Y;
|
|
58
|
+
minDecoX = Math.min(minDecoX, decoX);
|
|
59
|
+
minDecoY = Math.min(minDecoY, decoY);
|
|
60
|
+
const isPeak = index % 2 === 0;
|
|
61
|
+
if (index < items.length - 1) {
|
|
62
|
+
currentX += dx;
|
|
63
|
+
currentY = isPeak ? currentY + dy : currentY - dy;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
// 计算偏移量以确保所有元素都在正坐标
|
|
67
|
+
const offsetX = Math.max(0, -minDecoX);
|
|
68
|
+
const offsetY = Math.max(0, -minDecoY);
|
|
69
|
+
currentX = 0;
|
|
70
|
+
currentY = 0;
|
|
71
|
+
// Pass 2: 放置元素,应用偏移量
|
|
72
|
+
items.forEach((item, index) => {
|
|
73
|
+
const indexes = [index];
|
|
74
|
+
const pathPoint = pathPoints[index];
|
|
75
|
+
const cx = pathPoint.x + offsetX;
|
|
76
|
+
const cy = pathPoint.y + offsetY;
|
|
77
|
+
const currentColor = getPaletteColor(options, indexes);
|
|
78
|
+
// 装饰元素 - 确保坐标为正值
|
|
79
|
+
const decoX = Math.max(0, cx - DECO_OFFSET_X);
|
|
80
|
+
const decoY = Math.max(0, cy - DECO_OFFSET_Y);
|
|
81
|
+
const glowX = 10;
|
|
82
|
+
const glowY = GLOW_H + 10;
|
|
83
|
+
const { colorPrimaryBg } = getThemeColors({
|
|
84
|
+
colorPrimary: currentColor,
|
|
85
|
+
});
|
|
86
|
+
decoElements.push(_jsxs(Group, { x: decoX, y: decoY, id: `deco-group-${index}`, width: 140, height: 110, children: [_jsx(Ellipse, { x: glowX, y: glowY, width: GLOW_W, height: GLOW_H, fill: currentColor || colorPrimary, filter: "url(#sequence-zigzag-glow-filter)", opacity: GLOW_OPACITY }), _jsx(Path, { d: DECO_PATH_1, fill: currentColor || colorPrimary }), _jsx(Path, { d: DECO_PATH_2, fill: '#fff' }), _jsx(Path, { d: DECO_PATH_2, fill: colorPrimaryBg || colorPrimaryBg })] }));
|
|
87
|
+
// Icon 元素
|
|
88
|
+
if (item.icon) {
|
|
89
|
+
const iconX = Math.max(0, cx - iconSize / 2 - W_PATH_W / 2);
|
|
90
|
+
const iconY = Math.max(0, cy - iconSize / 2 - W_PATH_W / 2);
|
|
91
|
+
iconElements.push(_jsx(ItemIcon, { x: iconX, y: iconY, size: iconSize, indexes: indexes, fill: currentColor }));
|
|
92
|
+
}
|
|
93
|
+
// Item 元素和按钮
|
|
94
|
+
const itemX = cx - itemBounds.width / 2 - W_PATH_W / 2;
|
|
95
|
+
const itemY = Math.max(0, cy + ITEM_TO_PATH_GAP - W_PATH_W / 2);
|
|
96
|
+
maxItemY = Math.max(maxItemY, itemY + itemBounds.height);
|
|
97
|
+
if (index === 0) {
|
|
98
|
+
pathD = `M ${cx} ${cy}`;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
pathD += ` L ${cx} ${cy}`;
|
|
102
|
+
}
|
|
103
|
+
itemElements.push(_jsx(Item, { indexes: indexes, datum: item, data: data, x: itemX, y: itemY }));
|
|
104
|
+
btnElements.push(_jsx(BtnRemove, { indexes: indexes, x: Math.max(0, itemX + itemBounds.width - btnBounds.width / 2), y: Math.max(0, itemY + itemBounds.height - btnBounds.height / 2) }));
|
|
105
|
+
if (index < items.length - 1) {
|
|
106
|
+
const nextPoint = pathPoints[index + 1];
|
|
107
|
+
const nextCx = nextPoint.x + offsetX;
|
|
108
|
+
const nextCy = nextPoint.y + offsetY;
|
|
109
|
+
const btnAddX = Math.max(0, cx + (nextCx - cx) / 2 - btnBounds.width / 2);
|
|
110
|
+
const btnAddY = Math.max(0, cy + (nextCy - cy) / 2 - btnBounds.height / 2);
|
|
111
|
+
btnElements.push(_jsx(BtnAdd, { indexes: [index + 1], x: btnAddX, y: btnAddY }));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
btnElements.push(_jsx(BtnAdd, { indexes: [items.length], x: Math.max(0, itemX + itemBounds.width + dx / 4), y: Math.max(0, itemY + itemBounds.height / 2 - btnBounds.height / 2) }));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (pathD) {
|
|
118
|
+
const finalX = (pathPoints[pathPoints.length - 1]?.x || 0) + offsetX;
|
|
119
|
+
pathElements.push(_jsx(Path, { d: pathD, stroke: "#f3f2f1", strokeWidth: W_PATH_W, fill: "none", width: finalX, height: maxItemY - Math.min(minPathY + offsetY, 0) }));
|
|
120
|
+
}
|
|
121
|
+
return (_jsxs(FlexLayout, { id: "infographic-container", flexDirection: "column", justifyContent: "center", alignItems: "center", gap: 30, children: [_jsx(Defs, { children: GlowFilter }), titleContent, _jsxs(Group, { x: 0, y: 0, children: [_jsx(Group, { children: [...pathElements, ...decoElements, ...iconElements] }), _jsx(ItemsGroup, { children: itemElements }), _jsx(BtnsGroup, { children: btnElements })] })] }));
|
|
122
|
+
};
|
|
123
|
+
registerStructure('sequence-zigzag-steps', {
|
|
124
|
+
component: SequenceZigzagSteps,
|
|
125
|
+
composites: ['title', 'item'],
|
|
126
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentType } from '@antv/infographic-jsx';
|
|
2
|
+
import type { ParsedInfographicOptions } from '../../options';
|
|
3
|
+
import type { Data } from '../../types';
|
|
4
|
+
import { TitleProps } from '../components';
|
|
5
|
+
import type { BaseItemProps } from '../items';
|
|
6
|
+
export interface BaseStructureProps {
|
|
7
|
+
Title?: ComponentType<Pick<TitleProps, 'title' | 'desc'>>;
|
|
8
|
+
Item: ComponentType<Omit<BaseItemProps, 'themeColors'> & Partial<Pick<BaseItemProps, 'themeColors'>>>;
|
|
9
|
+
Items: ComponentType<Omit<BaseItemProps, 'themeColors'>>[];
|
|
10
|
+
data: Data;
|
|
11
|
+
options: ParsedInfographicOptions;
|
|
12
|
+
}
|
|
13
|
+
export interface Structure {
|
|
14
|
+
component: ComponentType<BaseStructureProps>;
|
|
15
|
+
composites: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface StructureOptions {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComponentType } from '@antv/infographic-jsx';
|
|
2
|
+
import type { Item, ItemOptions } from './items';
|
|
3
|
+
import type { Structure, StructureOptions } from './structures';
|
|
4
|
+
import { TitleOptions } from './title';
|
|
5
|
+
export interface DesignOptions {
|
|
6
|
+
/** 结构 */
|
|
7
|
+
structure?: string | WithType<StructureOptions>;
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title?: string | WithType<TitleOptions>;
|
|
10
|
+
/** 数据项 */
|
|
11
|
+
item?: string | WithType<ItemOptions>;
|
|
12
|
+
/** 针对层级布局,不同层级使用不同 item */
|
|
13
|
+
items?: (string | WithType<ItemOptions>)[];
|
|
14
|
+
}
|
|
15
|
+
export interface ParsedDesignsOptions {
|
|
16
|
+
structure: WithProps<Structure>;
|
|
17
|
+
title: {
|
|
18
|
+
component: ComponentType<any> | null;
|
|
19
|
+
};
|
|
20
|
+
item: WithProps<Item>;
|
|
21
|
+
items: WithProps<Item>[];
|
|
22
|
+
}
|
|
23
|
+
type WithType<T> = T & {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
type WithProps<T> = T & {
|
|
27
|
+
props?: any;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ParsedInfographicOptions } from '../../options';
|
|
2
|
+
export declare function getColorPrimary(options: ParsedInfographicOptions): string;
|
|
3
|
+
export declare function getPaletteColors(options: ParsedInfographicOptions): string[];
|
|
4
|
+
export declare function getPaletteColor(options: ParsedInfographicOptions, indexes: number[]): string | undefined;
|
|
5
|
+
export declare function getThemeColors(colors: {
|
|
6
|
+
colorPrimary?: string;
|
|
7
|
+
colorBg?: string;
|
|
8
|
+
}, options?: ParsedInfographicOptions): import("../../themes").ThemeColors;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getPaletteColor as _getPaletteColor } from '../../renderer';
|
|
2
|
+
import { generateThemeColors } from '../../themes';
|
|
3
|
+
import { isDarkColor } from '../../utils';
|
|
4
|
+
const DEFAULT_COLOR = '#1890FF';
|
|
5
|
+
export function getColorPrimary(options) {
|
|
6
|
+
return options?.themeConfig?.colorPrimary || DEFAULT_COLOR;
|
|
7
|
+
}
|
|
8
|
+
export function getPaletteColors(options) {
|
|
9
|
+
const { themeConfig = {}, data } = options;
|
|
10
|
+
const { colorPrimary, palette } = themeConfig;
|
|
11
|
+
if (!palette || palette.length === 0) {
|
|
12
|
+
return Array(data?.items?.length || 1).fill(colorPrimary || DEFAULT_COLOR);
|
|
13
|
+
}
|
|
14
|
+
return data.items.map((_, i) => _getPaletteColor(palette, [i], data.items.length) || DEFAULT_COLOR);
|
|
15
|
+
}
|
|
16
|
+
export function getPaletteColor(options, indexes) {
|
|
17
|
+
return _getPaletteColor(options?.themeConfig?.palette, indexes, options.data?.items?.length);
|
|
18
|
+
}
|
|
19
|
+
export function getThemeColors(colors, options) {
|
|
20
|
+
const { colorBg = options?.themeConfig?.colorBg || 'white', colorPrimary = options ? getColorPrimary(options) : 'black', } = colors;
|
|
21
|
+
return generateThemeColors({
|
|
22
|
+
colorPrimary: colorPrimary,
|
|
23
|
+
isDarkMode: isDarkColor(colorBg),
|
|
24
|
+
colorBg: colorBg,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 层级结构着色模式类型
|
|
3
|
+
*/
|
|
4
|
+
export type HierarchyColorMode = 'level' | 'branch' | 'node' | 'node-flat';
|
|
5
|
+
/**
|
|
6
|
+
* 层级节点信息接口
|
|
7
|
+
*/
|
|
8
|
+
export interface HierarchyNode {
|
|
9
|
+
/** 节点深度(层级),从 0 开始 */
|
|
10
|
+
depth: number;
|
|
11
|
+
/** 节点原始索引路径,如 [0, 1, 2] 表示根节点的第2个子节点的第3个子节点 */
|
|
12
|
+
originalIndexes: number[];
|
|
13
|
+
/** 节点在树中的扁平化序号(可选),用于 node-flat 模式 */
|
|
14
|
+
flatIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 根据层级着色模式获取节点的颜色索引
|
|
18
|
+
*
|
|
19
|
+
* @param node - 层级节点信息
|
|
20
|
+
* @param mode - 着色模式
|
|
21
|
+
* @returns 用于获取调色板颜色的索引数组
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // 按层级着色
|
|
26
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2] }, 'level');
|
|
27
|
+
* // 返回 [2],表示使用第3个层级的颜色
|
|
28
|
+
*
|
|
29
|
+
* // 按分支着色
|
|
30
|
+
* const indexes = getHierarchyColorIndexes({ depth: 3, originalIndexes: [0, 1, 2, 0] }, 'branch');
|
|
31
|
+
* // 返回 [2],表示继承第2个二级分支的颜色
|
|
32
|
+
*
|
|
33
|
+
* // 按节点着色(层级路径)
|
|
34
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2] }, 'node');
|
|
35
|
+
* // 返回 [0, 1, 2],使用完整路径
|
|
36
|
+
*
|
|
37
|
+
* // 按节点着色(扁平序号)
|
|
38
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2], flatIndex: 5 }, 'node-flat');
|
|
39
|
+
* // 返回 [5],使用扁平化的序号
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function getHierarchyColorIndexes(node: HierarchyNode, mode: HierarchyColorMode): number[];
|
|
43
|
+
/**
|
|
44
|
+
* 从 d3 hierarchy 节点中提取层级节点信息
|
|
45
|
+
*
|
|
46
|
+
* @param d3Node - d3.hierarchy 生成的节点对象
|
|
47
|
+
* @returns 层级节点信息
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const root = d3.hierarchy(data);
|
|
52
|
+
* const nodes = root.descendants();
|
|
53
|
+
*
|
|
54
|
+
* nodes.forEach(node => {
|
|
55
|
+
* const hierarchyNode = extractHierarchyNode(node);
|
|
56
|
+
* const colorIndexes = getHierarchyColorIndexes(hierarchyNode, 'branch');
|
|
57
|
+
* const color = getPaletteColor(options, colorIndexes);
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function extractHierarchyNode(d3Node: any): HierarchyNode;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 根据层级着色模式获取节点的颜色索引
|
|
3
|
+
*
|
|
4
|
+
* @param node - 层级节点信息
|
|
5
|
+
* @param mode - 着色模式
|
|
6
|
+
* @returns 用于获取调色板颜色的索引数组
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // 按层级着色
|
|
11
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2] }, 'level');
|
|
12
|
+
* // 返回 [2],表示使用第3个层级的颜色
|
|
13
|
+
*
|
|
14
|
+
* // 按分支着色
|
|
15
|
+
* const indexes = getHierarchyColorIndexes({ depth: 3, originalIndexes: [0, 1, 2, 0] }, 'branch');
|
|
16
|
+
* // 返回 [2],表示继承第2个二级分支的颜色
|
|
17
|
+
*
|
|
18
|
+
* // 按节点着色(层级路径)
|
|
19
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2] }, 'node');
|
|
20
|
+
* // 返回 [0, 1, 2],使用完整路径
|
|
21
|
+
*
|
|
22
|
+
* // 按节点着色(扁平序号)
|
|
23
|
+
* const indexes = getHierarchyColorIndexes({ depth: 2, originalIndexes: [0, 1, 2], flatIndex: 5 }, 'node-flat');
|
|
24
|
+
* // 返回 [5],使用扁平化的序号
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function getHierarchyColorIndexes(node, mode) {
|
|
28
|
+
const { depth, originalIndexes, flatIndex } = node;
|
|
29
|
+
switch (mode) {
|
|
30
|
+
case 'level':
|
|
31
|
+
// 按层级着色:同一层级使用相同颜色
|
|
32
|
+
// 层级 0 → 调色板[0]
|
|
33
|
+
// 层级 1 → 调色板[1]
|
|
34
|
+
// 层级 2 → 调色板[2]
|
|
35
|
+
// ...
|
|
36
|
+
return [depth];
|
|
37
|
+
case 'branch':
|
|
38
|
+
// 按分支着色:
|
|
39
|
+
// - 根节点(层级0)使用调色板[0]
|
|
40
|
+
// - 二级节点(层级1)及其子树按分支使用不同颜色
|
|
41
|
+
// 第1个二级分支 → 调色板[1]
|
|
42
|
+
// 第2个二级分支 → 调色板[2]
|
|
43
|
+
// 第3个二级分支 → 调色板[3]
|
|
44
|
+
// ...
|
|
45
|
+
if (depth === 0) {
|
|
46
|
+
// 根节点固定使用颜色 0
|
|
47
|
+
return [0];
|
|
48
|
+
}
|
|
49
|
+
else if (depth === 1) {
|
|
50
|
+
// 二级节点使用其在根节点子节点中的索引 + 1
|
|
51
|
+
return [originalIndexes[1] + 1];
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// 更深层级的节点继承其二级祖先的颜色
|
|
55
|
+
// originalIndexes[1] 是二级祖先在根节点子节点中的索引
|
|
56
|
+
return [originalIndexes[1] + 1];
|
|
57
|
+
}
|
|
58
|
+
case 'node':
|
|
59
|
+
// 按节点着色:每个节点使用不同颜色
|
|
60
|
+
// 使用完整的节点索引路径作为颜色索引
|
|
61
|
+
// 这样可以确保每个节点获得独特的颜色
|
|
62
|
+
return originalIndexes;
|
|
63
|
+
case 'node-flat':
|
|
64
|
+
// 按节点扁平序号着色:使用树的遍历序号
|
|
65
|
+
// 如果提供了 flatIndex,直接使用
|
|
66
|
+
// 否则使用第一级索引作为后备方案
|
|
67
|
+
if (flatIndex !== undefined) {
|
|
68
|
+
return [flatIndex];
|
|
69
|
+
}
|
|
70
|
+
// 后备方案:如果没有提供 flatIndex,使用完整路径
|
|
71
|
+
console.warn('node-flat mode requires flatIndex in HierarchyNode, falling back to originalIndexes');
|
|
72
|
+
return originalIndexes;
|
|
73
|
+
default:
|
|
74
|
+
// 默认返回根节点颜色
|
|
75
|
+
return [0];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 从 d3 hierarchy 节点中提取层级节点信息
|
|
80
|
+
*
|
|
81
|
+
* @param d3Node - d3.hierarchy 生成的节点对象
|
|
82
|
+
* @returns 层级节点信息
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const root = d3.hierarchy(data);
|
|
87
|
+
* const nodes = root.descendants();
|
|
88
|
+
*
|
|
89
|
+
* nodes.forEach(node => {
|
|
90
|
+
* const hierarchyNode = extractHierarchyNode(node);
|
|
91
|
+
* const colorIndexes = getHierarchyColorIndexes(hierarchyNode, 'branch');
|
|
92
|
+
* const color = getPaletteColor(options, colorIndexes);
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export function extractHierarchyNode(d3Node) {
|
|
97
|
+
return {
|
|
98
|
+
depth: d3Node.depth,
|
|
99
|
+
originalIndexes: d3Node.data._originalIndex || [],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BaseItemProps } from '../items/types';
|
|
2
|
+
import { BaseStructureProps } from '../structures';
|
|
3
|
+
export declare function getItemId(indexes: number[], type: 'static' | 'shape' | 'def' | 'shapes-group', appendix?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* 从属性中拆分出组件属性和容器属性
|
|
6
|
+
* @param props
|
|
7
|
+
* @param extKeys
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getItemProps<T extends BaseItemProps>(props: T, extKeys?: string[]): readonly [T, Record<string, any>];
|
|
11
|
+
/**
|
|
12
|
+
* 针对层级结构,获取当前层级对应的组件
|
|
13
|
+
*/
|
|
14
|
+
export declare function getItemComponent(Items: BaseStructureProps['Items'], level?: number): import("@antv/infographic-jsx").ComponentType<Omit<BaseItemProps, "themeColors">>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getItemKeyFromIndexes } from '../../utils';
|
|
2
|
+
export function getItemId(indexes, type, appendix) {
|
|
3
|
+
return `item-${getItemKeyFromIndexes(indexes)}-${type}` + appendix
|
|
4
|
+
? `-${appendix}`
|
|
5
|
+
: '';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 从属性中拆分出组件属性和容器属性
|
|
9
|
+
* @param props
|
|
10
|
+
* @param extKeys
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export function getItemProps(props, extKeys = []) {
|
|
14
|
+
const restProps = { ...props };
|
|
15
|
+
const extProps = {};
|
|
16
|
+
const keys = [
|
|
17
|
+
'indexes',
|
|
18
|
+
'data',
|
|
19
|
+
'datum',
|
|
20
|
+
'positionH',
|
|
21
|
+
'positionV',
|
|
22
|
+
'themeColors',
|
|
23
|
+
'valueFormatter',
|
|
24
|
+
...extKeys,
|
|
25
|
+
];
|
|
26
|
+
keys.forEach((key) => {
|
|
27
|
+
if (key in restProps) {
|
|
28
|
+
extProps[key] = restProps[key];
|
|
29
|
+
delete restProps[key];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// keep x, y, width, height in rest
|
|
33
|
+
['x', 'y', 'width', 'height'].forEach((key) => {
|
|
34
|
+
if (key in props) {
|
|
35
|
+
restProps[key] = props[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return [extProps, restProps];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 针对层级结构,获取当前层级对应的组件
|
|
42
|
+
*/
|
|
43
|
+
export function getItemComponent(Items, level) {
|
|
44
|
+
if (Items.length === 0)
|
|
45
|
+
return () => null;
|
|
46
|
+
if (level === undefined)
|
|
47
|
+
return Items[0];
|
|
48
|
+
return Items[level] ?? Items[0];
|
|
49
|
+
}
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '@antv/infographic-jsx';
|
|
2
|
+
export * from './designs';
|
|
3
|
+
export { getItemId, getItemProps, getThemeColors } from './designs/utils';
|
|
4
|
+
export type { InfographicOptions, ParsedInfographicOptions } from './options';
|
|
5
|
+
export * from './renderer';
|
|
6
|
+
export { loadSVGResource, registerResourceLoader } from './resource';
|
|
7
|
+
export { Infographic } from './runtime';
|
|
8
|
+
export { getTemplate, getTemplates, registerTemplate } from './templates';
|
|
9
|
+
export type { ParsedTemplateOptions, TemplateOptions } from './templates';
|
|
10
|
+
export { getTheme, getThemes, registerTheme } from './themes';
|
|
11
|
+
export type { ThemeColors, ThemeConfig, ThemeSeed } from './themes';
|
|
12
|
+
export type * from './types';
|
|
13
|
+
export { parseSVG } from './utils';
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from '@antv/infographic-jsx';
|
|
2
|
+
export * from './designs';
|
|
3
|
+
export { getItemId, getItemProps, getThemeColors } from './designs/utils';
|
|
4
|
+
export * from './renderer';
|
|
5
|
+
export { loadSVGResource, registerResourceLoader } from './resource';
|
|
6
|
+
export { Infographic } from './runtime';
|
|
7
|
+
export { getTemplate, getTemplates, registerTemplate } from './templates';
|
|
8
|
+
export { getTheme, getThemes, registerTheme } from './themes';
|
|
9
|
+
export { parseSVG } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antv/infographic-jsx/jsx-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@antv/infographic-jsx/jsx-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { parseOptions } from './parser';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { getItem, getStructure, getTemplate, Title, } from '../designs';
|
|
2
|
+
import { getPaletteColor } from '../renderer';
|
|
3
|
+
import { generateThemeColors, getTheme } from '../themes';
|
|
4
|
+
import { getItemKeyFromIndexes, isDarkColor, parsePadding } from '../utils';
|
|
5
|
+
export function parseOptions(options) {
|
|
6
|
+
const { container = '#container', padding = 0, template, design, theme, themeConfig, ...restOptions } = options;
|
|
7
|
+
const parsedContainer = typeof container === 'string'
|
|
8
|
+
? document.querySelector(container) || document.createElement('div')
|
|
9
|
+
: container;
|
|
10
|
+
const templateOptions = template
|
|
11
|
+
? getTemplate(template) || {}
|
|
12
|
+
: {};
|
|
13
|
+
const { design: templateDesign, ...restTemplateOptions } = templateOptions;
|
|
14
|
+
return {
|
|
15
|
+
...restTemplateOptions,
|
|
16
|
+
...restOptions,
|
|
17
|
+
container: parsedContainer,
|
|
18
|
+
padding: parsePadding(padding),
|
|
19
|
+
template,
|
|
20
|
+
design: parseDesign({ ...templateDesign, ...design }, options),
|
|
21
|
+
theme,
|
|
22
|
+
themeConfig: parseTheme(theme, themeConfig),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function normalizeWithType(obj) {
|
|
26
|
+
if (typeof obj === 'string')
|
|
27
|
+
return { type: obj };
|
|
28
|
+
if (!('type' in obj))
|
|
29
|
+
throw new Error('Type is required');
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
function parseDesign(config, options) {
|
|
33
|
+
const { structure, title, item, items } = config || {};
|
|
34
|
+
const defaultItem = parseDesignItem(item || items?.[0], options);
|
|
35
|
+
return {
|
|
36
|
+
structure: parseDesignStructure(structure),
|
|
37
|
+
title: parseDesignTitle(title, options),
|
|
38
|
+
item: defaultItem,
|
|
39
|
+
items: !items
|
|
40
|
+
? [defaultItem]
|
|
41
|
+
: items.map((item) => parseDesignItem(item, options)),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function parseDesignStructure(config) {
|
|
45
|
+
if (!config)
|
|
46
|
+
throw new Error('Structure is required in design or template');
|
|
47
|
+
const { type, ...userProps } = normalizeWithType(config);
|
|
48
|
+
const structure = getStructure(type);
|
|
49
|
+
if (!structure)
|
|
50
|
+
throw new Error(`Structure ${type} not found`);
|
|
51
|
+
const { component } = structure;
|
|
52
|
+
return {
|
|
53
|
+
...structure,
|
|
54
|
+
component: (props) => component({ ...props, ...userProps }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function parseDesignTitle(config, options) {
|
|
58
|
+
if (!config)
|
|
59
|
+
return { component: null };
|
|
60
|
+
const { type, ...userProps } = normalizeWithType(config);
|
|
61
|
+
const { themeConfig } = options;
|
|
62
|
+
const background = themeConfig?.colorBg || '#fff';
|
|
63
|
+
const themeColors = generateColors(background, background);
|
|
64
|
+
// use default title for now
|
|
65
|
+
return {
|
|
66
|
+
component: (props) => Title({ ...props, themeColors, ...userProps }),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function parseDesignItem(config, options) {
|
|
70
|
+
if (!config)
|
|
71
|
+
throw new Error('Item is required in design or template');
|
|
72
|
+
const { type, ...userProps } = normalizeWithType(config);
|
|
73
|
+
const item = getItem(type);
|
|
74
|
+
if (!item)
|
|
75
|
+
throw new Error(`Item ${type} not found`);
|
|
76
|
+
const { component, options: itemOptions } = item;
|
|
77
|
+
return {
|
|
78
|
+
...item,
|
|
79
|
+
component: (props) => {
|
|
80
|
+
const { indexes } = props;
|
|
81
|
+
const { data, themeConfig } = options;
|
|
82
|
+
const background = themeConfig?.colorBg || '#fff';
|
|
83
|
+
const { themeColors = generateColors(getPaletteColor(themeConfig?.palette, indexes, data?.items?.length) ||
|
|
84
|
+
themeConfig?.colorPrimary ||
|
|
85
|
+
'#1677FF', background), ...restProps } = props;
|
|
86
|
+
return component({
|
|
87
|
+
themeColors,
|
|
88
|
+
...restProps,
|
|
89
|
+
...userProps,
|
|
90
|
+
id: `item-${getItemKeyFromIndexes(indexes)}`,
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
options: itemOptions,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function parseTheme(theme, themeConfig = {}) {
|
|
97
|
+
const base = theme ? getTheme(theme) || {} : {};
|
|
98
|
+
const parsedThemeConfig = { ...base, ...themeConfig };
|
|
99
|
+
if (!parsedThemeConfig.colorPrimary) {
|
|
100
|
+
parsedThemeConfig.colorPrimary = '#1677FF';
|
|
101
|
+
}
|
|
102
|
+
if (!parsedThemeConfig.palette) {
|
|
103
|
+
parsedThemeConfig.palette = [parsedThemeConfig.colorPrimary];
|
|
104
|
+
}
|
|
105
|
+
return parsedThemeConfig;
|
|
106
|
+
}
|
|
107
|
+
function generateColors(colorPrimary, background = '#fff') {
|
|
108
|
+
return generateThemeColors({
|
|
109
|
+
colorPrimary,
|
|
110
|
+
isDarkMode: isDarkColor(background),
|
|
111
|
+
colorBg: background,
|
|
112
|
+
});
|
|
113
|
+
}
|