@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,8 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import type { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface CandyCardLiteProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const CandyCardLite: ComponentType<CandyCardLiteProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
import { Group, Path } from '@antv/infographic-jsx';
|
|
3
|
+
import { ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
4
|
+
import { getItemId, getItemProps } from '../utils';
|
|
5
|
+
import { registerItem } from './registry';
|
|
6
|
+
export const CandyCardLite = (props) => {
|
|
7
|
+
const [{ indexes, datum, width = 280, height = 140, themeColors }, restProps,] = getItemProps(props, ['width', 'height']);
|
|
8
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx("rect", { x: 0, y: 0, width: width, height: height, rx: 18, ry: 18, fill: themeColors.colorPrimaryBg, stroke: themeColors.colorPrimary }), _jsx(Path, { x: width - 85, y: 0.5, width: 85, height: 65, id: getItemId(indexes, 'static', 'decoration'), d: "M0.496704 0H61.7558C74.0725 0 84.0571 9.99394 84.0571 22.3221V60.1302L78.4401 62.9458C64.9296 68.1198 49.0492 65.0802 38.3968 53.9843L10.7444 25.1801C5.41799 19.6306 2.15489 12.855 0.935998 5.80383L0.496704 0Z", fill: "white" }), _jsx(ItemLabel, { indexes: indexes, x: 20, y: 24, width: 200, alignHorizontal: "left", alignVertical: "center", fill: themeColors.colorText, children: datum.label }), _jsx(ItemDesc, { indexes: indexes, x: 20, y: 58, width: 220, height: 70, fill: themeColors.colorTextSecondary, alignHorizontal: "left", alignVertical: "top", children: datum.desc }), _jsx(ItemIcon, { indexes: indexes, x: width - 48, y: 12, width: 32, height: 32, fill: themeColors.colorPrimary })] }));
|
|
9
|
+
};
|
|
10
|
+
registerItem('candy-card-lite', {
|
|
11
|
+
component: CandyCardLite,
|
|
12
|
+
composites: ['icon', 'label', 'desc'],
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface CapsuleItemProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
iconPadding?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const CapsuleItem: ComponentType<CapsuleItemProps>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Defs, Ellipse, getElementBounds, Group, Rect, } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc, ItemIconCircle, ItemLabel } from '../components';
|
|
5
|
+
import { DropShadow } from '../defs';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const CapsuleItem = (props) => {
|
|
9
|
+
const [{ datum, indexes, width = 300, height = 80, gap = 12, positionH = 'normal', iconPadding = height / 10, themeColors, }, restProps,] = getItemProps(props, ['width', 'height', 'gap', 'iconPadding']);
|
|
10
|
+
// Capsule border radius and icon size (icon with some padding inside)
|
|
11
|
+
const borderRadius = height / 2;
|
|
12
|
+
const iconSize = height - iconPadding * 2; // Icon diameter with padding
|
|
13
|
+
// Calculate positions based on positionH and icon presence
|
|
14
|
+
const isFlipped = positionH === 'flipped';
|
|
15
|
+
const hasIcon = !!datum.icon;
|
|
16
|
+
// Calculate text area dimensions
|
|
17
|
+
const textWidth = hasIcon ? width - height - gap : width - gap * 2;
|
|
18
|
+
const textX = hasIcon ? (isFlipped ? gap : height) : gap;
|
|
19
|
+
const textAlign = hasIcon ? (isFlipped ? 'right' : 'left') : 'center';
|
|
20
|
+
const labelProps = {
|
|
21
|
+
indexes,
|
|
22
|
+
width: textWidth,
|
|
23
|
+
alignHorizontal: textAlign,
|
|
24
|
+
alignVertical: 'center',
|
|
25
|
+
fontSize: 16,
|
|
26
|
+
fontWeight: '600',
|
|
27
|
+
fill: themeColors.colorWhite,
|
|
28
|
+
};
|
|
29
|
+
// Get label bounds to calculate layout
|
|
30
|
+
const labelBounds = getElementBounds(_jsx(ItemLabel, { ...labelProps, children: datum.label }));
|
|
31
|
+
const descProps = {
|
|
32
|
+
indexes,
|
|
33
|
+
width: textWidth,
|
|
34
|
+
alignHorizontal: textAlign,
|
|
35
|
+
alignVertical: 'top',
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
lineNumber: 1,
|
|
38
|
+
fill: themeColors.colorWhite,
|
|
39
|
+
};
|
|
40
|
+
// Get desc bounds to calculate layout
|
|
41
|
+
const descBounds = getElementBounds(datum.desc ? _jsx(ItemDesc, { ...descProps, children: datum.desc }) : null);
|
|
42
|
+
// Calculate vertical positions for text elements
|
|
43
|
+
const textGap = 4;
|
|
44
|
+
const totalTextHeight = labelBounds.height + textGap + descBounds.height;
|
|
45
|
+
const textStartY = (height - totalTextHeight) / 2;
|
|
46
|
+
const labelY = textStartY;
|
|
47
|
+
const descY = labelY + labelBounds.height + textGap;
|
|
48
|
+
// Calculate icon position (centered in the circle area with padding)
|
|
49
|
+
const iconX = isFlipped ? width - height + iconPadding : iconPadding;
|
|
50
|
+
const iconY = iconPadding;
|
|
51
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Defs, { children: _jsx(DropShadow, {}) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimary, rx: borderRadius, ry: borderRadius }), datum.icon && (_jsxs(_Fragment, { children: [_jsx(Ellipse, { x: iconX, y: iconY, width: iconSize, height: iconSize, fillOpacity: 0.5, filter: "url(#drop-shadow)" }), _jsx(ItemIconCircle, { indexes: indexes, x: iconX, y: iconY, size: iconSize, fill: themeColors.colorBg, colorBg: themeColors.colorPrimary })] })), datum.label && (_jsx(ItemLabel, { x: textX, y: labelY, ...labelProps, children: datum.label })), datum.desc && (_jsx(ItemDesc, { x: textX, y: descY, ...descProps, children: datum.desc }))] }));
|
|
52
|
+
};
|
|
53
|
+
registerItem('capsule-item', {
|
|
54
|
+
component: CapsuleItem,
|
|
55
|
+
composites: ['icon', 'label', 'desc'],
|
|
56
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import type { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface CircleNodeProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const CircleNode: ComponentType<CircleNodeProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
import { Defs, Ellipse, Group } from '@antv/infographic-jsx';
|
|
3
|
+
import tinycolor from 'tinycolor2';
|
|
4
|
+
import { ItemLabel } from '../components';
|
|
5
|
+
import { getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const CircleNode = (props) => {
|
|
8
|
+
const [{ indexes, datum, themeColors, positionH = 'normal', width = 240, height = width, }, restProps,] = getItemProps(props, ['width', 'height']);
|
|
9
|
+
const size = Math.min(width, height);
|
|
10
|
+
const innerCircleSize = size * 0.7;
|
|
11
|
+
const innerCircleOffset = (size - innerCircleSize) / 2;
|
|
12
|
+
const labelSize = (innerCircleSize * Math.sqrt(2)) / 2;
|
|
13
|
+
const labelOffset = (size - labelSize) / 2;
|
|
14
|
+
const base = tinycolor(themeColors.colorPrimary);
|
|
15
|
+
const colorOuterStart = fadeWithWhite(base, 80, 0.2);
|
|
16
|
+
const colorOuterEnd = fadeWithWhite(base, 20, 0.8);
|
|
17
|
+
const colorInnerStart = fadeWithWhite(base, 75, 0.32);
|
|
18
|
+
const colorInnerEnd = fadeWithWhite(base, 45, 0.4);
|
|
19
|
+
const colorText = base.clone().darken(5).toRgbString();
|
|
20
|
+
const outerGradientId = `${themeColors.colorPrimary}-${positionH}-outer`;
|
|
21
|
+
const innerGradientId = `${themeColors.colorPrimary}-${positionH}-inner`;
|
|
22
|
+
const gradientDirection = positionH === 'flipped'
|
|
23
|
+
? { x1: '0%', y1: '0%', x2: '100%', y2: '0%' }
|
|
24
|
+
: { x1: '100%', y1: '0%', x2: '0%', y2: '0%' };
|
|
25
|
+
return (_jsxs(Group, { ...restProps, children: [_jsxs(Defs, { children: [_jsxs("linearGradient", { id: outerGradientId, ...gradientDirection, children: [_jsx("stop", { offset: "0%", stopColor: colorOuterStart }), _jsx("stop", { offset: "100%", stopColor: colorOuterEnd })] }), _jsxs("linearGradient", { id: innerGradientId, ...gradientDirection, children: [_jsx("stop", { offset: "0%", stopColor: colorInnerStart }), _jsx("stop", { offset: "100%", stopColor: colorInnerEnd })] })] }), _jsx(Ellipse, { width: size, height: size, fill: `url(#${outerGradientId})` }), _jsx(Ellipse, { x: innerCircleOffset, y: innerCircleOffset, width: innerCircleSize, height: innerCircleSize, fill: `url(#${innerGradientId})`, stroke: "#FFFFFF", strokeWidth: 1 }), _jsx(ItemLabel, { indexes: indexes, x: labelOffset, y: labelOffset, width: labelSize, height: labelSize, lineHeight: 1.1, alignHorizontal: "center", alignVertical: "center", fill: colorText, fontWeight: "500", children: datum.label })] }));
|
|
26
|
+
};
|
|
27
|
+
registerItem('circle-node', {
|
|
28
|
+
component: CircleNode,
|
|
29
|
+
composites: ['label'],
|
|
30
|
+
});
|
|
31
|
+
function fadeWithWhite(color, mixPct, alpha) {
|
|
32
|
+
return tinycolor.mix(color, '#ffffff', mixPct).setAlpha(alpha).toRgbString();
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface CircularProgressProps extends BaseItemProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const CircularProgress: ComponentType<CircularProgressProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Ellipse, Group } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemLabel, ItemValue } from '../components';
|
|
5
|
+
import { getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const CircularProgress = (props) => {
|
|
8
|
+
const [{ datum, indexes, size = 120, strokeWidth = 12, gap = 8, themeColors, valueFormatter = (value) => `${Math.round(value)}%`, }, restProps,] = getItemProps(props, ['size', 'strokeWidth', 'gap']);
|
|
9
|
+
const value = datum.value ?? 0;
|
|
10
|
+
const maxValue = 100;
|
|
11
|
+
const percentage = Math.min(Math.max(value / maxValue, 0), 1);
|
|
12
|
+
const radius = (size - strokeWidth) / 2;
|
|
13
|
+
const circumference = 2 * Math.PI * radius;
|
|
14
|
+
const strokeDasharray = circumference;
|
|
15
|
+
const strokeDashoffset = circumference * (1 - percentage);
|
|
16
|
+
const center = size / 2;
|
|
17
|
+
const start = strokeWidth / 2;
|
|
18
|
+
const d = size - strokeWidth;
|
|
19
|
+
return (_jsxs(Group, { ...restProps, width: size, height: size + gap + 20, children: [_jsx(Ellipse, { x: start, y: start, width: d, height: d, fill: "none", stroke: "#f0f0f0", strokeWidth: strokeWidth }), _jsx(Ellipse, { x: start, y: start, width: d, height: d, fill: "none", stroke: themeColors.colorPrimary, strokeWidth: strokeWidth, strokeLinecap: "round", strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset, transform: `rotate(-90 ${center} ${center})` }), _jsx(ItemValue, { indexes: indexes, x: strokeWidth, y: strokeWidth, width: d - strokeWidth, height: d - strokeWidth, fontSize: 24, fontWeight: "bold", fill: themeColors.colorPrimary, alignHorizontal: "center", alignVertical: "center", value: value, formatter: valueFormatter }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorTextSecondary, children: datum.label })] }));
|
|
20
|
+
};
|
|
21
|
+
registerItem('circular-progress', {
|
|
22
|
+
component: CircularProgress,
|
|
23
|
+
composites: ['label', 'value'],
|
|
24
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface CompactCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const CompactCard: ComponentType<CompactCardProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Defs, Group, Rect } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc, ItemIcon, ItemLabel, ItemValue } from '../components';
|
|
5
|
+
import { FlexLayout } from '../layouts';
|
|
6
|
+
import { getItemId, getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const CompactCard = (props) => {
|
|
9
|
+
const [{ datum, indexes, width = 200, height = 60, iconSize = 20, gap = 8, positionH = 'normal', themeColors, valueFormatter, }, restProps,] = getItemProps(props, ['width', 'height', 'iconSize', 'gap']);
|
|
10
|
+
const value = datum.value;
|
|
11
|
+
const hasValue = value !== undefined && value !== null;
|
|
12
|
+
const shadowId = getItemId(indexes, 'def', 'compact-shadow');
|
|
13
|
+
const iconX = positionH === 'flipped' ? width - gap - iconSize : gap;
|
|
14
|
+
const textStartX = positionH === 'flipped' ? gap : iconSize + 2 * gap;
|
|
15
|
+
const textWidth = width - iconSize - 3 * gap;
|
|
16
|
+
// 为 Label 和 Value 分配空间
|
|
17
|
+
const labelWidth = hasValue ? textWidth * 0.8 : textWidth;
|
|
18
|
+
const valueWidth = hasValue ? textWidth * 0.2 : 0;
|
|
19
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Defs, { children: _jsx("filter", { id: shadowId, children: _jsx("feDropShadow", { dx: "0", dy: "2", stdDeviation: "2", floodOpacity: "0.15" }) }) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorBgElevated, stroke: themeColors.colorBgElevated, strokeWidth: 1, rx: 6, ry: 6, filter: `url(#${shadowId})` }), _jsx(Rect, { x: positionH === 'flipped' ? width - 3 : 0, y: 0, width: 3, height: height, fill: themeColors.colorPrimary, rx: 1.5, ry: 1.5 }), _jsx(ItemIcon, { indexes: indexes, x: iconX, y: (height - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimary }), _jsxs(FlexLayout, { x: textStartX, y: gap, width: textWidth, height: height - gap * 2, flexDirection: "column", justifyContent: "center", alignItems: "flex-start", children: [_jsxs(FlexLayout, { width: textWidth, flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(ItemLabel, { indexes: indexes, width: labelWidth, alignHorizontal: "left", fontSize: 12, fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, width: valueWidth, alignHorizontal: "right", fontSize: 12, fontWeight: "bold", fill: themeColors.colorPrimary, value: value, formatter: valueFormatter }))] }), _jsx(ItemDesc, { indexes: indexes, width: textWidth, alignHorizontal: "left", alignVertical: "center", fontSize: 10, fill: themeColors.colorTextSecondary, lineNumber: 2, wordWrap: true, children: datum.desc })] })] }));
|
|
20
|
+
};
|
|
21
|
+
registerItem('compact-card', {
|
|
22
|
+
component: CompactCard,
|
|
23
|
+
composites: ['icon', 'label', 'value', 'desc'],
|
|
24
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface DoneListProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const DoneList: ComponentType<DoneListProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Group, Path } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc } from '../components';
|
|
5
|
+
import { getItemId, getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const DoneList = (props) => {
|
|
8
|
+
const [{ datum, indexes, width = 300, height = 30, iconSize = 30, gap = 5, positionH = 'normal', positionV = 'center', themeColors, }, restProps,] = getItemProps(props, ['width', 'height', 'iconSize', 'gap']);
|
|
9
|
+
const descWidth = width - iconSize - gap;
|
|
10
|
+
const shapeY = positionV === 'center'
|
|
11
|
+
? (height - iconSize) / 2
|
|
12
|
+
: positionV === 'flipped'
|
|
13
|
+
? height - iconSize
|
|
14
|
+
: 0;
|
|
15
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Path, { id: getItemId(indexes, 'shape', 'done-icon'), x: positionH === 'flipped' ? descWidth + gap : 0, y: shapeY, fill: themeColors.colorPrimary, width: iconSize, height: iconSize, d: "M14.7273 30C6.54538 30 0 22.9077 0 14.7269C0 6.54617 6.54538 0 14.7273 0C22.9092 0 30 6.54617 30 14.7269C30 22.9077 22.9092 30 14.7273 30ZM24.5454 10.9077C22.9092 9.27307 22.9092 9.27307 22.9092 9.27307C22.3638 8.72692 22.3638 8.7269 21.8181 8.7269C21.2727 8.7269 21.2727 8.72692 20.7273 9.27307C13.0908 16.9077 13.0908 16.9077 13.0908 16.9077C8.72731 12.5461 8.72731 12.5462 8.72731 12.5462C8.18193 12.5462 8.18193 12 7.63654 12L7.09077 12.5462C4.90923 14.1808 4.90923 14.1808 4.90923 14.1808C4.90923 14.7269 4.90923 14.7269 4.90923 15.2731C4.90923 15.8192 4.90923 15.8192 4.90923 16.3654C12 23.4539 12 23.4538 12 23.4538C12.5454 23.4538 12.5454 23.4538 13.0908 23.4538C13.6365 23.4538 13.6365 23.4538 14.1819 23.4538C24.5454 12.5461 24.5454 12.5462 24.5454 12.5462L25.0908 12C25.0908 11.4538 24.5454 10.9077 24.5454 10.9077Z" }), _jsx(ItemDesc, { indexes: indexes, x: positionH === 'flipped' ? 0 : iconSize + gap, fontSize: 16, width: descWidth, height: height, alignVertical: "center", wordWrap: false, children: datum.desc })] }));
|
|
16
|
+
};
|
|
17
|
+
registerItem('done-list', {
|
|
18
|
+
component: DoneList,
|
|
19
|
+
composites: ['desc'],
|
|
20
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface HorizontalIconArrowProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const HorizontalIconArrow: ComponentType<HorizontalIconArrowProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Ellipse, getElementBounds, Group, Path, Polygon, Text, } from '@antv/infographic-jsx';
|
|
4
|
+
import { Gap, ItemDesc, ItemIconCircle, ItemLabel } from '../components';
|
|
5
|
+
import { FlexLayout } from '../layouts';
|
|
6
|
+
import { AlignLayout } from '../layouts/Align';
|
|
7
|
+
import { getItemProps } from '../utils';
|
|
8
|
+
import { registerItem } from './registry';
|
|
9
|
+
export const HorizontalIconArrow = (props) => {
|
|
10
|
+
const [{ indexes, datum, width = 140, themeColors, positionV = 'normal' }, restProps,] = getItemProps(props, ['width']);
|
|
11
|
+
const isVNormal = positionV !== 'flipped';
|
|
12
|
+
const textAlignVertical = positionV === 'normal' ? 'bottom' : 'top';
|
|
13
|
+
const label = (_jsx(ItemLabel, { indexes: indexes, width: width, fill: themeColors.colorText, alignHorizontal: "center", alignVertical: textAlignVertical, fontSize: 14, children: datum.label }));
|
|
14
|
+
const desc = (_jsx(ItemDesc, { indexes: indexes, width: width, fill: themeColors.colorTextSecondary, alignHorizontal: "center", alignVertical: textAlignVertical, children: datum.desc }));
|
|
15
|
+
const icon = (_jsx(ItemIconCircle, { indexes: indexes, fill: themeColors.colorPrimary, colorBg: themeColors.colorWhite }));
|
|
16
|
+
const dotLine = (_jsx(DotLine, { width: 8, height: 30, fill: themeColors.colorPrimary, positionV: positionV }));
|
|
17
|
+
const dotLineGap = 5;
|
|
18
|
+
const iconGap = 25;
|
|
19
|
+
const arrowHeight = 30;
|
|
20
|
+
const labelBounds = getElementBounds(label);
|
|
21
|
+
const descBounds = getElementBounds(desc);
|
|
22
|
+
const iconBounds = getElementBounds(icon);
|
|
23
|
+
const dotLineBounds = getElementBounds(dotLine);
|
|
24
|
+
const fixedGap = labelBounds.height +
|
|
25
|
+
descBounds.height +
|
|
26
|
+
dotLineGap +
|
|
27
|
+
dotLineBounds.height -
|
|
28
|
+
iconBounds.height -
|
|
29
|
+
iconGap;
|
|
30
|
+
const totalHeight = iconBounds.height +
|
|
31
|
+
iconGap +
|
|
32
|
+
arrowHeight +
|
|
33
|
+
dotLineBounds.height +
|
|
34
|
+
dotLineGap +
|
|
35
|
+
labelBounds.height +
|
|
36
|
+
descBounds.height;
|
|
37
|
+
return (_jsx(Group, { width: width, height: totalHeight, ...restProps, children: _jsxs(FlexLayout, { flexDirection: "column", alignItems: "center", children: [isVNormal ? (_jsxs(_Fragment, { children: [desc, label, _jsx(Gap, { height: dotLineGap }), dotLine] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: fixedGap }), icon, _jsx(Gap, { height: iconGap })] })), _jsxs(AlignLayout, { horizontal: "center", vertical: "center", children: [_jsx(VerticalArrow, { width: width, height: arrowHeight, fill: themeColors.colorPrimary }), _jsx(Text, { width: width, height: arrowHeight, alignHorizontal: "center", alignVertical: "center", fill: themeColors.colorWhite, fontWeight: "bold", fontSize: 16, children: datum.time
|
|
38
|
+
? datum.time
|
|
39
|
+
: String(indexes[0] + 1)
|
|
40
|
+
.padStart(2, '0')
|
|
41
|
+
.slice(-2) })] }), !isVNormal ? (_jsxs(_Fragment, { children: [dotLine, _jsx(Gap, { height: dotLineGap }), label, desc] })) : (_jsxs(_Fragment, { children: [_jsx(Gap, { height: iconGap }), icon] }))] }) }));
|
|
42
|
+
};
|
|
43
|
+
const VerticalArrow = (props) => {
|
|
44
|
+
const { x = 0, y = 0, width = 100, height = 40, fill = '#1890FF', size = 10, } = props;
|
|
45
|
+
return (_jsx(Polygon, { width: width, height: height, points: [
|
|
46
|
+
{ x, y },
|
|
47
|
+
{ x: x + width - size, y },
|
|
48
|
+
{ x: x + width, y: y + height / 2 },
|
|
49
|
+
{ x: x + width - size, y: y + height },
|
|
50
|
+
{ x, y: y + height },
|
|
51
|
+
{ x: x + size, y: y + height / 2 },
|
|
52
|
+
], fill: fill }));
|
|
53
|
+
};
|
|
54
|
+
const DotLine = (props) => {
|
|
55
|
+
const { x = 0, y = 0, width = 10, height = 50, fill, positionV = 'top', } = props;
|
|
56
|
+
const r = width / 2;
|
|
57
|
+
const lineLength = height - r;
|
|
58
|
+
const strokeWidth = 2;
|
|
59
|
+
const lineX = r;
|
|
60
|
+
return (_jsxs(Group, { x: x, y: y, width: width, height: height, children: [_jsx(Ellipse, { width: width, height: width, fill: fill, y: positionV === 'top' ? 0 : lineLength - r }), _jsx(Path, { d: positionV === 'top'
|
|
61
|
+
? `M${lineX},${r} L${lineX},${r + lineLength}`
|
|
62
|
+
: `M${lineX},0 L${lineX},${lineLength - r}`, strokeWidth: strokeWidth, stroke: fill })] }));
|
|
63
|
+
};
|
|
64
|
+
registerItem('horizontal-icon-arrow', {
|
|
65
|
+
component: HorizontalIconArrow,
|
|
66
|
+
composites: ['icon', 'label', 'desc', 'time'],
|
|
67
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface HorizontalIconLineProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const HorizontalIconLine: ComponentType<HorizontalIconLineProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Ellipse, getElementBounds, Rect, Text, } from '@antv/infographic-jsx';
|
|
4
|
+
import { Gap, ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
5
|
+
import { AlignLayout, FlexLayout } from '../layouts';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const HorizontalIconLine = (props) => {
|
|
9
|
+
const [{ indexes, datum, width = 160, themeColors, positionH = 'center', positionV = 'normal', }, restProps,] = getItemProps(props, ['width']);
|
|
10
|
+
const textAlignHorizontal = positionH === 'normal'
|
|
11
|
+
? 'left'
|
|
12
|
+
: positionH === 'flipped'
|
|
13
|
+
? 'right'
|
|
14
|
+
: 'center';
|
|
15
|
+
const label = (_jsx(ItemLabel, { indexes: indexes, width: width, alignHorizontal: textAlignHorizontal, fill: themeColors.colorPrimary, children: datum.label }));
|
|
16
|
+
const labelBounds = getElementBounds(label);
|
|
17
|
+
const desc = datum.desc ? (_jsx(ItemDesc, { indexes: indexes, width: width, fill: themeColors.colorTextSecondary, alignHorizontal: textAlignHorizontal, alignVertical: positionV === 'flipped' ? 'top' : 'bottom', children: datum.desc })) : null;
|
|
18
|
+
const descBounds = getElementBounds(desc);
|
|
19
|
+
const iconSize = 45;
|
|
20
|
+
const icon = datum.icon ? (_jsxs(AlignLayout, { horizontal: "center", vertical: "center", children: [_jsx(Ellipse, { width: iconSize, height: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemIcon, { indexes: indexes, width: iconSize * 0.58, height: iconSize * 0.58, fill: themeColors.colorBg })] })) : null;
|
|
21
|
+
const iconBounds = getElementBounds(icon);
|
|
22
|
+
const time = datum.time ? (_jsx(Text, { width: width, height: 30, alignHorizontal: "center", alignVertical: "center", fill: themeColors.colorPrimary, fontSize: 18, fontWeight: "bold", children: datum.time })) : null;
|
|
23
|
+
const timeBounds = getElementBounds(time);
|
|
24
|
+
const lineHeight = 18;
|
|
25
|
+
const line = (_jsxs(AlignLayout, { horizontal: "center", width: width, height: lineHeight, children: [_jsx(Rect, { width: width, height: lineHeight, fill: themeColors.colorPrimary }), _jsx(Ellipse, { y: -3, width: lineHeight + 6, height: lineHeight + 6, fill: themeColors.colorBg, fillOpacity: 0.5 }), _jsx(Ellipse, { y: (lineHeight - 12) / 2, width: 12, height: 12, fill: "white" })] }));
|
|
26
|
+
const textSideHeight = labelBounds.height + descBounds.height;
|
|
27
|
+
const iconSideHeight = iconBounds.height + timeBounds.height + 5;
|
|
28
|
+
// 平衡line两侧高度,使 line 位于垂直居中位置
|
|
29
|
+
const heightDiff = Math.abs(iconSideHeight - textSideHeight);
|
|
30
|
+
const topBalance = iconSideHeight > textSideHeight ? heightDiff : 0;
|
|
31
|
+
const bottomBalance = textSideHeight > iconSideHeight ? heightDiff : 0;
|
|
32
|
+
if (positionV === 'flipped') {
|
|
33
|
+
return (_jsxs(FlexLayout, { ...restProps, flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: bottomBalance }), time, icon, _jsx(Gap, { height: 5 }), line, label, desc, _jsx(Gap, { height: topBalance })] }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsxs(FlexLayout, { ...restProps, flexDirection: "column", alignItems: "center", children: [_jsx(Gap, { height: topBalance }), label, desc, line, _jsx(Gap, { height: 5 }), icon, time, _jsx(Gap, { height: bottomBalance })] }));
|
|
36
|
+
};
|
|
37
|
+
registerItem('horizontal-icon-line', {
|
|
38
|
+
component: HorizontalIconLine,
|
|
39
|
+
composites: ['icon', 'label', 'desc'],
|
|
40
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface IconBadgeProps extends BaseItemProps {
|
|
5
|
+
size?: number;
|
|
6
|
+
iconSize?: number;
|
|
7
|
+
badgeSize?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const IconBadge: ComponentType<IconBadgeProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Defs, Ellipse, Group, Text, } from '@antv/infographic-jsx';
|
|
4
|
+
import tinycolor from 'tinycolor2';
|
|
5
|
+
import { ItemIcon, ItemLabel } from '../components';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const IconBadge = (props) => {
|
|
9
|
+
const [{ datum, indexes, size = 80, iconSize = 28, badgeSize = 24, gap = 8, themeColors, width = 84, height = 105, }, restProps,] = getItemProps(props, ['size', 'iconSize', 'badgeSize', 'gap']);
|
|
10
|
+
const value = datum.value ?? 0;
|
|
11
|
+
const gradientId = `${themeColors.colorPrimary}-icon`;
|
|
12
|
+
const badgeGradientId = '#ff6b6b-badge';
|
|
13
|
+
return (_jsxs(Group, { ...restProps, width: width, height: height, children: [_jsxs(Defs, { children: [_jsxs("radialGradient", { id: gradientId, cx: "50%", cy: "30%", r: "70%", children: [_jsx("stop", { offset: "0%", stopColor: tinycolor(themeColors.colorPrimary)
|
|
14
|
+
.lighten(30)
|
|
15
|
+
.toHexString() }), _jsx("stop", { offset: "100%", stopColor: themeColors.colorPrimary })] }), _jsxs("linearGradient", { id: badgeGradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: "#ff6b6b" }), _jsx("stop", { offset: "100%", stopColor: "#ee5a52" })] })] }), _jsx(Ellipse, { x: 0, y: 0, width: size, height: size, fill: `url(#${gradientId})` }), _jsx(ItemIcon, { indexes: indexes, x: (size - iconSize) / 2, y: (size - iconSize) / 2, size: iconSize, fill: themeColors.colorPrimaryText }), _jsx(Ellipse, { x: size - badgeSize + 4, y: 0, width: badgeSize, height: badgeSize, fill: `url(#${badgeGradientId})` }), _jsx(Text, { x: size - badgeSize / 2 + 4, y: badgeSize / 2, fontSize: 10, fontWeight: "bold", fill: themeColors.colorWhite, alignHorizontal: "center", alignVertical: "center", children: value > 99 ? '99+' : Math.round(value) }), _jsx(ItemLabel, { indexes: indexes, x: 0, y: size + gap, width: size, alignHorizontal: "center", fontSize: 12, fill: themeColors.colorText, children: datum.label })] }));
|
|
16
|
+
};
|
|
17
|
+
registerItem('icon-badge', {
|
|
18
|
+
component: IconBadge,
|
|
19
|
+
composites: ['icon', 'label'],
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface IndexedCardProps extends BaseItemProps {
|
|
5
|
+
/** 卡片宽度 */
|
|
6
|
+
width?: number;
|
|
7
|
+
/** 卡片圆角半径 */
|
|
8
|
+
borderRadius?: number;
|
|
9
|
+
/** 内部边距 */
|
|
10
|
+
padding?: number;
|
|
11
|
+
/** 标题分隔线高度 */
|
|
12
|
+
separatorHeight?: number;
|
|
13
|
+
/** 序号字体大小 */
|
|
14
|
+
indexFontSize?: number;
|
|
15
|
+
/** 标签字体大小 */
|
|
16
|
+
labelFontSize?: number;
|
|
17
|
+
/** 元素间距 */
|
|
18
|
+
gap?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const IndexedCard: ComponentType<IndexedCardProps>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { getElementBounds, Group } from '@antv/infographic-jsx';
|
|
4
|
+
// 根据需要选择性导入原子组件和类型
|
|
5
|
+
import { Rect, Text } from '@antv/infographic-jsx';
|
|
6
|
+
// 根据需要选择性导入封装组件
|
|
7
|
+
import { ItemDesc, ItemLabel } from '../components';
|
|
8
|
+
import tinycolor from 'tinycolor2';
|
|
9
|
+
import { getItemProps } from '../utils';
|
|
10
|
+
import { registerItem } from './registry';
|
|
11
|
+
// -----------------------------------------------------------------------------------
|
|
12
|
+
// 2. 组件实现
|
|
13
|
+
// -----------------------------------------------------------------------------------
|
|
14
|
+
export const IndexedCard = (props) => {
|
|
15
|
+
const [{ datum, indexes, width = 200, borderRadius = 12, padding = 16, separatorHeight = 2, indexFontSize = 20, labelFontSize = 16, gap = 8, themeColors, }, restProps,] = getItemProps(props, [
|
|
16
|
+
'width',
|
|
17
|
+
'height',
|
|
18
|
+
'borderRadius',
|
|
19
|
+
'padding',
|
|
20
|
+
'separatorHeight',
|
|
21
|
+
'indexFontSize',
|
|
22
|
+
'labelFontSize',
|
|
23
|
+
'gap',
|
|
24
|
+
]);
|
|
25
|
+
// 1. 数据处理
|
|
26
|
+
const indexNumber = indexes[0] + 1;
|
|
27
|
+
const indexStr = String(indexNumber).padStart(2, '0');
|
|
28
|
+
const showLabel = datum.label !== undefined;
|
|
29
|
+
const showDesc = datum.desc !== undefined;
|
|
30
|
+
// 2. 颜色计算
|
|
31
|
+
const separatorColor = tinycolor
|
|
32
|
+
.mix(themeColors.colorPrimary, themeColors.colorWhite, 40)
|
|
33
|
+
.toHexString();
|
|
34
|
+
const cardBgColor = themeColors.colorBgElevated || themeColors.colorWhite;
|
|
35
|
+
// 3. 布局计算优化
|
|
36
|
+
const contentWidth = width - 2 * padding;
|
|
37
|
+
// 3.1 序号元素尺寸计算
|
|
38
|
+
const indexBounds = getElementBounds(_jsx(Text, { fontSize: indexFontSize, fontWeight: "bold", children: indexStr }));
|
|
39
|
+
// 3.2 标签元素尺寸计算(考虑可用宽度)
|
|
40
|
+
const labelAvailableWidth = contentWidth - indexBounds.width - gap;
|
|
41
|
+
const labelBounds = showLabel
|
|
42
|
+
? getElementBounds(_jsx(ItemLabel, { indexes: indexes, width: labelAvailableWidth, fontSize: labelFontSize, fontWeight: "bold", x: indexFontSize, children: datum.label }))
|
|
43
|
+
: { width: 0, height: 0 };
|
|
44
|
+
// 3.3 描述元素尺寸计算
|
|
45
|
+
const descBounds = showDesc
|
|
46
|
+
? getElementBounds(_jsx(ItemDesc, { indexes: indexes, width: contentWidth, fontSize: 14, lineHeight: 1.5, wordWrap: true, children: datum.desc }))
|
|
47
|
+
: { width: 0, height: 0 };
|
|
48
|
+
// 3.4 动态内容高度计算
|
|
49
|
+
const titleRowHeight = Math.max(indexBounds.height, labelBounds.height);
|
|
50
|
+
const contentHeight = padding * 2 + // 上下内边距
|
|
51
|
+
titleRowHeight + // 标题行高度
|
|
52
|
+
(showLabel || showDesc ? gap : 0) + // 标题后间距
|
|
53
|
+
separatorHeight + // 分隔线高度
|
|
54
|
+
(showDesc ? gap : 0) + // 分隔线后间距
|
|
55
|
+
descBounds.height; // 描述高度
|
|
56
|
+
// 4. 组件结构
|
|
57
|
+
return (_jsxs(Group, { ...restProps, width: width, height: contentHeight, children: [_jsx(Rect, { x: 0, y: 0, width: width, height: contentHeight, rx: borderRadius, ry: borderRadius, fill: cardBgColor, stroke: tinycolor(cardBgColor).darken(5).toHexString(), strokeWidth: 0.5 }), _jsxs(Group, { x: padding, y: padding, children: [_jsxs(Group, { x: 0, y: 0, children: [_jsx(Text, { x: 0, y: 0, fontSize: indexFontSize, fontWeight: "bold", fill: themeColors.colorPrimary, alignVertical: "top", children: indexStr }), showLabel && (_jsx(ItemLabel, { indexes: indexes, x: indexFontSize + gap, y: 0, width: labelAvailableWidth, fontSize: labelFontSize, fontWeight: "bold", fill: themeColors.colorTextSecondary, alignVertical: "top", children: datum.label }))] }), _jsx(Rect, { x: 0, y: titleRowHeight + gap, width: contentWidth, height: separatorHeight, fill: separatorColor }), showDesc && (_jsx(ItemDesc, { indexes: indexes, x: 0, y: titleRowHeight + gap + separatorHeight + gap, width: contentWidth, fontSize: 14, lineHeight: 1.5, wordWrap: true, fill: themeColors.colorTextSecondary, children: datum.desc }))] })] }));
|
|
58
|
+
};
|
|
59
|
+
registerItem('indexed-card', {
|
|
60
|
+
component: IndexedCard,
|
|
61
|
+
composites: ['label', 'desc'],
|
|
62
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface LCornerCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
iconSize?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const LCornerCard: ComponentType<LCornerCardProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Group, Path, Polygon } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
5
|
+
import { getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const LCornerCard = (props) => {
|
|
8
|
+
const [{ indexes, datum, width = 140, iconSize = 24, themeColors }, restProps,] = getItemProps(props, ['width', 'iconSize']);
|
|
9
|
+
const { label, desc } = datum;
|
|
10
|
+
const lStroke = 8;
|
|
11
|
+
const arrowSize = 16;
|
|
12
|
+
const arrowGap = 12;
|
|
13
|
+
const descX = arrowSize + arrowGap;
|
|
14
|
+
const descWidth = width - descX;
|
|
15
|
+
const descHeight = 60;
|
|
16
|
+
const verticalLen = iconSize + 44;
|
|
17
|
+
const arrowX1 = arrowSize;
|
|
18
|
+
const arrowY1 = descHeight + arrowGap;
|
|
19
|
+
const arrowY2 = descHeight + arrowSize + arrowGap;
|
|
20
|
+
const arrowVertices = [
|
|
21
|
+
{ x: 0, y: arrowY2 },
|
|
22
|
+
{ x: arrowX1, y: arrowY1 },
|
|
23
|
+
{ x: arrowX1, y: arrowY2 },
|
|
24
|
+
];
|
|
25
|
+
const innerWidth = width - arrowX1 - arrowGap;
|
|
26
|
+
const lx1 = arrowX1 + arrowGap;
|
|
27
|
+
const lx2 = lx1 + innerWidth;
|
|
28
|
+
const ly1 = arrowY1 + lStroke / 2;
|
|
29
|
+
const ly2 = ly1 + verticalLen;
|
|
30
|
+
const d = `M ${lx1} ${ly2} L ${lx1} ${ly1} L ${lx2} ${ly1}`;
|
|
31
|
+
const halfStroke = lStroke / 2;
|
|
32
|
+
const x1 = lx1 + halfStroke;
|
|
33
|
+
const y1 = ly1 + halfStroke;
|
|
34
|
+
const gap = 8;
|
|
35
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(ItemDesc, { indexes: indexes, x: descX, width: descWidth, height: descHeight, fontSize: 12, alignHorizontal: "left", alignVertical: "bottom", fill: themeColors.colorTextSecondary, children: desc }), _jsx(Polygon, { points: arrowVertices, fill: themeColors.colorPrimary, opacity: 0.9, width: arrowSize, height: arrowSize }), _jsx(Path, { d: d, stroke: themeColors.colorPrimary, strokeWidth: lStroke, fill: "none" }), _jsx(ItemIcon, { indexes: indexes, x: x1 + innerWidth / 2 - iconSize / 2, y: y1 + gap, size: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemLabel, { indexes: indexes, x: x1, y: y1 + iconSize + gap * 2, width: innerWidth, fontSize: 14, fontWeight: "bold", alignHorizontal: "center", alignVertical: "center", fill: themeColors.colorText, children: label })] }));
|
|
36
|
+
};
|
|
37
|
+
registerItem('l-corner-card', {
|
|
38
|
+
component: LCornerCard,
|
|
39
|
+
composites: ['icon', 'label', 'desc'],
|
|
40
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface LetterCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
showStripe?: boolean;
|
|
8
|
+
showGradient?: boolean;
|
|
9
|
+
showBottomShade?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 字母卡片组件
|
|
13
|
+
* 用于显示大字母和标题
|
|
14
|
+
* 支持渐变背景、斜纹和底部阴影效果
|
|
15
|
+
*/
|
|
16
|
+
export declare const LetterCard: ComponentType<LetterCardProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Defs, Group, Rect } from '@antv/infographic-jsx';
|
|
4
|
+
import tinycolor from 'tinycolor2';
|
|
5
|
+
import { ItemLabel } from '../components';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
/**
|
|
9
|
+
* 字母卡片组件
|
|
10
|
+
* 用于显示大字母和标题
|
|
11
|
+
* 支持渐变背景、斜纹和底部阴影效果
|
|
12
|
+
*/
|
|
13
|
+
export const LetterCard = (props) => {
|
|
14
|
+
const [{ datum, indexes, width = 280, height = 160, showStripe = true, showGradient = true, showBottomShade = true, themeColors, }, restProps,] = getItemProps(props, [
|
|
15
|
+
'width',
|
|
16
|
+
'height',
|
|
17
|
+
'showStripe',
|
|
18
|
+
'showGradient',
|
|
19
|
+
'showBottomShade',
|
|
20
|
+
]);
|
|
21
|
+
const displayLetter = datum.label?.[0].toUpperCase();
|
|
22
|
+
const displayTitle = datum.label?.toUpperCase();
|
|
23
|
+
const baseColor = themeColors.colorPrimary;
|
|
24
|
+
const base = tinycolor(baseColor);
|
|
25
|
+
const stripeWidth = 4;
|
|
26
|
+
const gapWidth = 6;
|
|
27
|
+
const rotationDeg = 45;
|
|
28
|
+
const bottomShadeHeight = 40;
|
|
29
|
+
const gradientLighten = 12;
|
|
30
|
+
const gradientDarken = 4;
|
|
31
|
+
const gradStart = base.clone().darken(gradientDarken).toHexString();
|
|
32
|
+
const gradEnd = base.clone().lighten(gradientLighten).toHexString();
|
|
33
|
+
const lightStripe = 'rgba(255, 255, 255, 0)';
|
|
34
|
+
const darkStripe = 'rgba(0, 0, 0, 0.03)';
|
|
35
|
+
const uniqueId = `letter-card-${indexes.join('-')}`;
|
|
36
|
+
const gradientId = `${uniqueId}-gradient`;
|
|
37
|
+
const patternId = `${uniqueId}-pattern`;
|
|
38
|
+
const shadeId = `${uniqueId}-shade`;
|
|
39
|
+
const tile = stripeWidth + gapWidth;
|
|
40
|
+
const ratio = 1;
|
|
41
|
+
const letterFontSize = 96;
|
|
42
|
+
const letterHeight = letterFontSize * ratio;
|
|
43
|
+
const titleFontSize = 16;
|
|
44
|
+
const titleHeight = titleFontSize * ratio;
|
|
45
|
+
const textGap = height / 16;
|
|
46
|
+
const textTotalHeight = letterHeight + textGap + titleHeight;
|
|
47
|
+
const letterY = (height - textTotalHeight) / 2;
|
|
48
|
+
const titleY = letterY + letterHeight + textGap;
|
|
49
|
+
return (_jsxs(Group, { ...restProps, width: width, height: height, children: [_jsxs(Defs, { children: [showGradient && (_jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: gradStart }), _jsx("stop", { offset: "100%", stopColor: gradEnd })] })), showStripe && (_jsxs("pattern", { id: patternId, patternUnits: "userSpaceOnUse", width: tile, height: tile, patternTransform: `rotate(${rotationDeg})`, children: [_jsx("rect", { x: "0", y: "0", width: tile, height: tile, fill: lightStripe }), _jsx("rect", { x: "0", y: "0", width: stripeWidth, height: tile, fill: darkStripe })] })), showBottomShade && (_jsxs("linearGradient", { id: shadeId, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [_jsx("stop", { offset: "0%", stopColor: "rgba(0,0,0,0)" }), _jsx("stop", { offset: "100%", stopColor: "rgba(0,0,0,0.16)" })] }))] }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: showGradient ? `url(#${gradientId})` : baseColor, rx: 0, ry: 0 }), showStripe && (_jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: `url(#${patternId})`, rx: 0, ry: 0 })), showBottomShade && (_jsx(Rect, { x: 0, y: height - bottomShadeHeight, width: width, height: bottomShadeHeight, fill: `url(#${shadeId})`, rx: 0, ry: 0 })), displayLetter && (_jsx(ItemLabel, { indexes: indexes, x: 0, y: letterY, width: width, fontSize: letterFontSize, fontWeight: "bold", fill: "#FFFFFF", alignHorizontal: "center", alignVertical: "top", lineHeight: 1, children: displayLetter })), _jsx(ItemLabel, { indexes: indexes, x: 0, y: titleY, width: width, fontSize: titleFontSize, fontWeight: "bold", fill: "#FFFFFF", alignHorizontal: "center", alignVertical: "center", lineHeight: 1, children: displayTitle })] }));
|
|
50
|
+
};
|
|
51
|
+
registerItem('letter-card', {
|
|
52
|
+
component: LetterCard,
|
|
53
|
+
composites: ['label'],
|
|
54
|
+
});
|