@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,10 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface PillBadgeProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
pillWidth?: number;
|
|
7
|
+
pillHeight?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const PillBadge: ComponentType<PillBadgeProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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, ItemLabel } from '../components';
|
|
5
|
+
import { DropShadow, LinearGradient } from '../defs';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const PillBadge = (props) => {
|
|
9
|
+
const [{ datum, indexes, width = 300, pillWidth = 120, pillHeight = 36, gap = 16, positionH = 'normal', themeColors, }, restProps,] = getItemProps(props, ['width', 'pillWidth', 'pillHeight', 'gap']);
|
|
10
|
+
// Optimize: when no description, use pillWidth as component width
|
|
11
|
+
const hasDesc = !!datum.desc;
|
|
12
|
+
const componentWidth = hasDesc ? width : pillWidth;
|
|
13
|
+
// Calculate pill position based on alignment
|
|
14
|
+
const pillX = hasDesc
|
|
15
|
+
? positionH === 'center'
|
|
16
|
+
? (componentWidth - pillWidth) / 2
|
|
17
|
+
: positionH === 'flipped'
|
|
18
|
+
? componentWidth - pillWidth
|
|
19
|
+
: 0
|
|
20
|
+
: 0; // Always 0 when no description
|
|
21
|
+
const pillY = 0;
|
|
22
|
+
// Calculate content position (only needed when hasDesc is true)
|
|
23
|
+
const contentX = hasDesc
|
|
24
|
+
? positionH === 'center'
|
|
25
|
+
? 0
|
|
26
|
+
: positionH === 'flipped'
|
|
27
|
+
? 0
|
|
28
|
+
: 0
|
|
29
|
+
: 0;
|
|
30
|
+
const contentY = pillHeight + gap;
|
|
31
|
+
const contentWidth = componentWidth;
|
|
32
|
+
const dropShadowId = `drop-shadow-${themeColors.colorPrimary}`;
|
|
33
|
+
const linearGradientId = `linear-gradient-white-top-bottom`;
|
|
34
|
+
return (_jsxs(Group, { ...restProps, children: [_jsxs(Defs, { children: [_jsx(DropShadow, { id: dropShadowId, color: themeColors.colorPrimary }), _jsx(LinearGradient, { id: linearGradientId, startColor: "#fff", stopColor: "#ffffff33", direction: "top-bottom" })] }), _jsx(Rect, { x: pillX, y: pillY, width: pillWidth, height: pillHeight, fill: themeColors.colorPrimaryBg, stroke: themeColors.colorPrimary, rx: pillHeight / 2, ry: pillHeight / 2, filter: `url(#${dropShadowId})` }), _jsx(Rect, { x: pillX, y: pillY, width: pillWidth, height: pillHeight, fill: `url(#${linearGradientId})`, opacity: themeColors.isDarkMode ? 0.4 : 0.7, rx: pillHeight / 2, ry: pillHeight / 2 }), _jsx(ItemLabel, { indexes: indexes, x: pillX, y: pillY, width: pillWidth, height: pillHeight, alignHorizontal: "center", alignVertical: "center", fontSize: 14, fontWeight: "500", fill: themeColors.colorText, children: datum.label }), datum.desc && (_jsx(ItemDesc, { indexes: indexes, x: contentX, y: contentY, width: contentWidth, alignHorizontal: positionH === 'center'
|
|
35
|
+
? 'center'
|
|
36
|
+
: positionH === 'flipped'
|
|
37
|
+
? 'right'
|
|
38
|
+
: 'left', fontSize: 12, fill: themeColors.colorTextSecondary, lineNumber: 2, wordWrap: true, children: datum.desc }))] }));
|
|
39
|
+
};
|
|
40
|
+
registerItem('pill-badge', {
|
|
41
|
+
component: PillBadge,
|
|
42
|
+
composites: ['label', 'desc'],
|
|
43
|
+
});
|
|
@@ -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 LabelTextProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
formatter?: (text?: string) => string;
|
|
7
|
+
usePaletteColor?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const LabelText: ComponentType<LabelTextProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
import { ItemLabel } from '../components';
|
|
3
|
+
import { getItemProps } from '../utils';
|
|
4
|
+
import { registerItem } from './registry';
|
|
5
|
+
export const LabelText = (props) => {
|
|
6
|
+
const [{ indexes, datum, width = 120, themeColors, positionH = 'normal', formatter = (text) => text || '', usePaletteColor = false, }, restProps,] = getItemProps(props, ['width', 'formatter', 'usePaletteColor']);
|
|
7
|
+
return (_jsx(ItemLabel, { ...restProps, indexes: indexes, width: width, fill: usePaletteColor ? themeColors.colorPrimary : themeColors.colorText, fontSize: 14, fontWeight: "regular", alignHorizontal: positionH === 'flipped'
|
|
8
|
+
? 'right'
|
|
9
|
+
: positionH === 'center'
|
|
10
|
+
? 'center'
|
|
11
|
+
: 'left', alignVertical: "center", children: formatter(datum.label || datum.desc) }));
|
|
12
|
+
};
|
|
13
|
+
registerItem('plain-text', {
|
|
14
|
+
component: LabelText,
|
|
15
|
+
composites: ['label'],
|
|
16
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface ProgressCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
progressHeight?: number;
|
|
10
|
+
borderRadius?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const ProgressCard: ComponentType<ProgressCardProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Defs, getElementBounds, Group, Rect, } from '@antv/infographic-jsx';
|
|
4
|
+
import { scaleLinear } from 'd3';
|
|
5
|
+
import tinycolor from 'tinycolor2';
|
|
6
|
+
import { ItemDesc, ItemIcon, ItemLabel, ItemValue } from '../components';
|
|
7
|
+
import { getItemProps } from '../utils';
|
|
8
|
+
import { registerItem } from './registry';
|
|
9
|
+
export const ProgressCard = (props) => {
|
|
10
|
+
const [{ datum, data, indexes, width = 280, height = 120, iconSize = 32, gap = 12, progressHeight = 8, borderRadius = 12, positionH = 'normal', themeColors, valueFormatter = (v) => `${v}%`, }, restProps,] = getItemProps(props, [
|
|
11
|
+
'width',
|
|
12
|
+
'height',
|
|
13
|
+
'iconSize',
|
|
14
|
+
'gap',
|
|
15
|
+
'progressHeight',
|
|
16
|
+
'borderRadius',
|
|
17
|
+
]);
|
|
18
|
+
const value = datum.value;
|
|
19
|
+
const displayValue = value ?? 0;
|
|
20
|
+
const maxValue = Math.max(...data.items.map((item) => item.value ?? 0), 100);
|
|
21
|
+
const progressWidth = width - 2 * gap;
|
|
22
|
+
// 计算进度条的填充宽度
|
|
23
|
+
const progressScale = scaleLinear()
|
|
24
|
+
.domain([0, maxValue])
|
|
25
|
+
.range([0, progressWidth]);
|
|
26
|
+
const progressFillWidth = progressScale(displayValue);
|
|
27
|
+
// 生成唯一的渐变ID
|
|
28
|
+
const gradientId = `${themeColors.colorPrimary}-progress`;
|
|
29
|
+
const progressBgId = `${themeColors.colorPrimaryBg}-progress-bg`;
|
|
30
|
+
// 获取元素边界用于布局计算
|
|
31
|
+
const labelBounds = getElementBounds(_jsx(ItemLabel, { indexes: indexes }));
|
|
32
|
+
// 计算布局位置
|
|
33
|
+
const contentY = gap;
|
|
34
|
+
const iconX = positionH === 'flipped' ? width - gap - iconSize : gap;
|
|
35
|
+
const iconY = contentY;
|
|
36
|
+
const textStartX = positionH === 'flipped' ? gap : iconSize + 2 * gap;
|
|
37
|
+
const textWidth = width - iconSize - 3 * gap;
|
|
38
|
+
const textY = iconY;
|
|
39
|
+
const progressY = height - gap - progressHeight;
|
|
40
|
+
const hasValue = value !== undefined;
|
|
41
|
+
return (_jsxs(Group, { ...restProps, children: [_jsxs(Defs, { children: [_jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", stopColor: themeColors.colorPrimary }), _jsx("stop", { offset: "100%", stopColor: tinycolor
|
|
42
|
+
.mix(themeColors.colorPrimary, '#fff', 20)
|
|
43
|
+
.toHexString() })] }), _jsxs("linearGradient", { id: progressBgId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", stopColor: themeColors.colorPrimaryBg }), _jsx("stop", { offset: "100%", stopColor: themeColors.colorBg })] })] }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorBgElevated, stroke: themeColors.colorPrimaryBg, strokeWidth: 1, rx: borderRadius, ry: borderRadius }), _jsx(ItemIcon, { indexes: indexes, x: iconX, y: iconY, size: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemLabel, { indexes: indexes, x: textStartX, y: textY, width: textWidth, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', alignVertical: "top", fontSize: 16, fontWeight: "medium", fill: themeColors.colorText, children: datum.label }), hasValue && (_jsx(ItemValue, { indexes: indexes, x: textStartX, y: textY + labelBounds.height, width: textWidth, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', alignVertical: "top", lineHeight: 1, fontSize: 24, fontWeight: "bold", fill: themeColors.colorPrimary, value: displayValue, formatter: valueFormatter })), _jsx(ItemDesc, { indexes: indexes, x: textStartX, y: textY + labelBounds.height + (hasValue ? 27 : 4), width: textWidth, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', alignVertical: "top", fontSize: 11, fill: themeColors.colorTextSecondary, lineNumber: hasValue ? 2 : 3, wordWrap: true, children: datum.desc }), _jsx(Rect, { x: gap, y: progressY, width: progressWidth, height: progressHeight, fill: `url(#${progressBgId})`, rx: progressHeight / 2, ry: progressHeight / 2 }), _jsx(Rect, { x: gap, y: progressY, width: progressFillWidth, height: progressHeight, fill: `url(#${gradientId})`, rx: progressHeight / 2, ry: progressHeight / 2 })] }));
|
|
44
|
+
};
|
|
45
|
+
registerItem('progress-card', {
|
|
46
|
+
component: ProgressCard,
|
|
47
|
+
composites: ['icon', 'label', 'value', 'desc'],
|
|
48
|
+
});
|
|
@@ -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 QuarterCircularProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
circleRadius?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const QuarterCircular: ComponentType<QuarterCircularProps>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Ellipse, getElementBounds, Group, Path, Text, } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
5
|
+
import { getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const QuarterCircular = (props) => {
|
|
8
|
+
const [{ datum, indexes, width = 280, height = 120, iconSize = 30, circleRadius = 80, positionH = 'normal', positionV = 'normal', themeColors, }, restProps,] = getItemProps(props, ['width', 'height', 'iconSize', 'circleRadius']);
|
|
9
|
+
// 圆的质心
|
|
10
|
+
const CIRCLE_MASS = (4 * circleRadius) / (3 * Math.PI);
|
|
11
|
+
// 配置参数
|
|
12
|
+
const LINE_WIDTH = 2;
|
|
13
|
+
const DOT_RADIUS = 4;
|
|
14
|
+
const VALUE_SIZE = 28;
|
|
15
|
+
const CARD_Y = 20;
|
|
16
|
+
const CARD_CONTENT_Y = CARD_Y + 20;
|
|
17
|
+
const LABEL_Y = CARD_Y;
|
|
18
|
+
const DESC_Y_OFFSET = 8;
|
|
19
|
+
const DECORATION_VERTICAL_SPACING = 35;
|
|
20
|
+
const DECORATION_HORIZONTAL_SPACING = 40;
|
|
21
|
+
const DECORATION_END_SPACING = 30;
|
|
22
|
+
// 序号(使用 indexes 的第一个值 + 1)
|
|
23
|
+
const indexStr = String(indexes[0] + 1).padStart(2, '0');
|
|
24
|
+
// 根据 positionH 调整布局
|
|
25
|
+
const isFlipped = positionH === 'flipped';
|
|
26
|
+
const isCentered = positionH === 'center';
|
|
27
|
+
// 根据 positionV 调整布局
|
|
28
|
+
const isVFlipped = positionV === 'flipped';
|
|
29
|
+
// 计算装饰线的坐标
|
|
30
|
+
const getDecorationCoords = () => {
|
|
31
|
+
if (isFlipped) {
|
|
32
|
+
// 右对齐(镜像布局)
|
|
33
|
+
return {
|
|
34
|
+
diagonalStartX: width - DOT_RADIUS,
|
|
35
|
+
diagonalStartY: isVFlipped
|
|
36
|
+
? height - DECORATION_VERTICAL_SPACING
|
|
37
|
+
: DECORATION_VERTICAL_SPACING,
|
|
38
|
+
diagonalEndX: width - DECORATION_HORIZONTAL_SPACING,
|
|
39
|
+
diagonalEndY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
40
|
+
topLineStartX: width - DECORATION_HORIZONTAL_SPACING,
|
|
41
|
+
topLineEndX: CIRCLE_MASS,
|
|
42
|
+
topLineY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else if (isCentered) {
|
|
46
|
+
// 居中对齐
|
|
47
|
+
const totalContentWidth = width - circleRadius - DECORATION_HORIZONTAL_SPACING;
|
|
48
|
+
const centerOffset = (width - totalContentWidth) / 2;
|
|
49
|
+
return {
|
|
50
|
+
diagonalStartX: centerOffset + DOT_RADIUS,
|
|
51
|
+
diagonalStartY: isVFlipped
|
|
52
|
+
? height - DECORATION_VERTICAL_SPACING
|
|
53
|
+
: DECORATION_VERTICAL_SPACING,
|
|
54
|
+
diagonalEndX: centerOffset + DECORATION_HORIZONTAL_SPACING,
|
|
55
|
+
diagonalEndY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
56
|
+
topLineStartX: centerOffset + DECORATION_HORIZONTAL_SPACING,
|
|
57
|
+
topLineEndX: centerOffset + totalContentWidth - CIRCLE_MASS,
|
|
58
|
+
topLineY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// 默认左对齐
|
|
63
|
+
return {
|
|
64
|
+
diagonalStartX: DOT_RADIUS,
|
|
65
|
+
diagonalStartY: isVFlipped
|
|
66
|
+
? height - DECORATION_VERTICAL_SPACING
|
|
67
|
+
: DECORATION_VERTICAL_SPACING,
|
|
68
|
+
diagonalEndX: DECORATION_HORIZONTAL_SPACING,
|
|
69
|
+
diagonalEndY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
70
|
+
topLineStartX: DECORATION_HORIZONTAL_SPACING,
|
|
71
|
+
topLineEndX: width - CIRCLE_MASS,
|
|
72
|
+
topLineY: isVFlipped ? height - DOT_RADIUS : DOT_RADIUS,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// 计算内容区域的坐标
|
|
77
|
+
const getContentCoords = () => {
|
|
78
|
+
if (isFlipped) {
|
|
79
|
+
// 右对齐(镜像布局)
|
|
80
|
+
const contentX = circleRadius + 10;
|
|
81
|
+
const contentWidth = width - contentX - DECORATION_HORIZONTAL_SPACING;
|
|
82
|
+
return {
|
|
83
|
+
valueX: width - DECORATION_END_SPACING,
|
|
84
|
+
contentX,
|
|
85
|
+
contentWidth,
|
|
86
|
+
circleX: 0,
|
|
87
|
+
circleY: isVFlipped ? 0 : height,
|
|
88
|
+
iconX: CIRCLE_MASS - iconSize / 2,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
else if (isCentered) {
|
|
92
|
+
// 居中对齐
|
|
93
|
+
const totalContentWidth = width - circleRadius - DECORATION_HORIZONTAL_SPACING;
|
|
94
|
+
const centerOffset = (width - totalContentWidth) / 2;
|
|
95
|
+
return {
|
|
96
|
+
valueX: centerOffset,
|
|
97
|
+
contentX: centerOffset + DECORATION_HORIZONTAL_SPACING,
|
|
98
|
+
contentWidth: totalContentWidth - circleRadius - 10,
|
|
99
|
+
circleX: centerOffset + totalContentWidth,
|
|
100
|
+
circleY: isVFlipped ? 0 : height,
|
|
101
|
+
iconX: centerOffset + totalContentWidth - CIRCLE_MASS - iconSize / 2,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// 默认左对齐
|
|
106
|
+
return {
|
|
107
|
+
valueX: 0,
|
|
108
|
+
contentX: DECORATION_HORIZONTAL_SPACING,
|
|
109
|
+
contentWidth: width - DECORATION_HORIZONTAL_SPACING - circleRadius - 10,
|
|
110
|
+
circleX: width,
|
|
111
|
+
circleY: isVFlipped ? 0 : height,
|
|
112
|
+
iconX: width - CIRCLE_MASS - iconSize / 2,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
// 获取坐标值
|
|
117
|
+
const decorationCoords = getDecorationCoords();
|
|
118
|
+
const contentCoords = getContentCoords();
|
|
119
|
+
// 计算图标Y坐标
|
|
120
|
+
const iconY = isVFlipped
|
|
121
|
+
? CIRCLE_MASS - iconSize / 2
|
|
122
|
+
: height - CIRCLE_MASS - iconSize / 2;
|
|
123
|
+
// 获取文本尺寸
|
|
124
|
+
const labelBounds = getElementBounds(_jsx(ItemLabel, { indexes: indexes, width: contentCoords.contentWidth, children: datum.label }));
|
|
125
|
+
const descY = LABEL_Y + labelBounds.height + DESC_Y_OFFSET;
|
|
126
|
+
// 生成1/4圆路径
|
|
127
|
+
const getQuarterCirclePath = () => {
|
|
128
|
+
const { circleX, circleY } = contentCoords;
|
|
129
|
+
if (isFlipped) {
|
|
130
|
+
return isVFlipped
|
|
131
|
+
? `M ${circleX} ${circleY} L ${circleX} ${circleY + circleRadius} A ${circleRadius} ${circleRadius} 0 0 0 ${circleX + circleRadius} ${circleY} Z`
|
|
132
|
+
: `M ${circleX} ${circleY} L ${circleX} ${circleY - circleRadius} A ${circleRadius} ${circleRadius} 0 0 1 ${circleX + circleRadius} ${circleY} Z`;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return isVFlipped
|
|
136
|
+
? `M ${circleX} ${circleY} L ${circleX} ${circleY + circleRadius} A ${circleRadius} ${circleRadius} 0 0 1 ${circleX - circleRadius} ${circleY} Z`
|
|
137
|
+
: `M ${circleX} ${circleY} L ${circleX} ${circleY - circleRadius} A ${circleRadius} ${circleRadius} 0 0 0 ${circleX - circleRadius} ${circleY} Z`;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return (_jsxs(Group, { ...restProps, width: width, height: height, children: [_jsxs(Group, { children: [_jsx(Path, { d: `M ${decorationCoords.diagonalStartX} ${decorationCoords.diagonalStartY} L ${decorationCoords.diagonalEndX} ${decorationCoords.diagonalEndY}`, stroke: themeColors.colorPrimary, strokeWidth: LINE_WIDTH, fill: "none" }), _jsx(Path, { d: `M ${decorationCoords.topLineStartX} ${decorationCoords.topLineY} L ${decorationCoords.topLineEndX} ${decorationCoords.topLineY}`, stroke: themeColors.colorPrimary, strokeWidth: LINE_WIDTH, fill: "none" }), _jsx(Ellipse, { x: decorationCoords.diagonalStartX - DOT_RADIUS, y: decorationCoords.diagonalStartY - DOT_RADIUS, width: DOT_RADIUS * 2, height: DOT_RADIUS * 2, fill: themeColors.colorPrimary }), _jsx(Ellipse, { x: decorationCoords.topLineEndX - DOT_RADIUS, y: decorationCoords.topLineY - DOT_RADIUS, width: DOT_RADIUS * 2, height: DOT_RADIUS * 2, fill: themeColors.colorPrimary })] }), _jsxs(Group, { children: [_jsx(Text, { x: contentCoords.valueX, y: CARD_CONTENT_Y, fontSize: VALUE_SIZE, fontWeight: "bold", fill: themeColors.colorPrimary, width: 40, children: indexStr }), _jsx(Path, { d: getQuarterCirclePath(), fill: themeColors.colorPrimary }), datum.icon && (_jsx(ItemIcon, { indexes: indexes, x: contentCoords.iconX, y: iconY, size: iconSize, fill: themeColors.colorWhite })), datum.label && (_jsx(ItemLabel, { indexes: indexes, x: contentCoords.contentX, y: LABEL_Y, width: contentCoords.contentWidth, fontWeight: "bold", fill: themeColors.colorText, children: datum.label })), datum.desc && (_jsx(ItemDesc, { indexes: indexes, x: contentCoords.contentX, y: descY, width: contentCoords.contentWidth, fill: themeColors.colorTextSecondary, children: datum.desc }))] })] }));
|
|
141
|
+
};
|
|
142
|
+
registerItem('quarter-circular', {
|
|
143
|
+
component: QuarterCircular,
|
|
144
|
+
composites: ['icon', 'label', 'desc'],
|
|
145
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface QuarterSimpleCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
padding?: number;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const QuarterSimpleCard: ComponentType<QuarterSimpleCardProps>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { Group, Path, getElementBounds, } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
5
|
+
import { getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const QuarterSimpleCard = (props) => {
|
|
8
|
+
const [{ datum, indexes, width = 150, height = 150, iconSize = 30, padding = 20, borderRadius = 16, positionH = 'center', positionV = 'center', themeColors, }, restProps,] = getItemProps(props, [
|
|
9
|
+
'width',
|
|
10
|
+
'height',
|
|
11
|
+
'iconSize',
|
|
12
|
+
'padding',
|
|
13
|
+
'borderRadius',
|
|
14
|
+
]);
|
|
15
|
+
// 计算内容区域
|
|
16
|
+
const contentWidth = width - padding * 2;
|
|
17
|
+
const contentX = padding;
|
|
18
|
+
const contentY = padding;
|
|
19
|
+
// 图标位置
|
|
20
|
+
const iconX = positionH === 'flipped'
|
|
21
|
+
? width - padding - iconSize
|
|
22
|
+
: positionH === 'center'
|
|
23
|
+
? (width - iconSize) / 2
|
|
24
|
+
: contentX;
|
|
25
|
+
const iconY = contentY;
|
|
26
|
+
// 标签位置(图标下方)
|
|
27
|
+
const labelY = iconY + iconSize + 8;
|
|
28
|
+
const labelBounds = getElementBounds(_jsx(ItemLabel, { indexes: indexes, width: contentWidth, children: datum.label }));
|
|
29
|
+
const labelX = positionH === 'flipped'
|
|
30
|
+
? width - padding - contentWidth
|
|
31
|
+
: positionH === 'center'
|
|
32
|
+
? padding
|
|
33
|
+
: contentX;
|
|
34
|
+
// 描述位置(标签下方)
|
|
35
|
+
const descY = labelY + labelBounds.height + 4;
|
|
36
|
+
const descX = labelX;
|
|
37
|
+
// 根据 positionH 和 positionV 决定直角位置
|
|
38
|
+
const r = borderRadius;
|
|
39
|
+
let cardPath = '';
|
|
40
|
+
if (positionH === 'center' && positionV === 'center') {
|
|
41
|
+
// 四个角都为圆角
|
|
42
|
+
cardPath = `
|
|
43
|
+
M ${r} 0
|
|
44
|
+
L ${width - r} 0
|
|
45
|
+
Q ${width} 0 ${width} ${r}
|
|
46
|
+
L ${width} ${height - r}
|
|
47
|
+
Q ${width} ${height} ${width - r} ${height}
|
|
48
|
+
L ${r} ${height}
|
|
49
|
+
Q 0 ${height} 0 ${height - r}
|
|
50
|
+
L 0 ${r}
|
|
51
|
+
Q 0 0 ${r} 0
|
|
52
|
+
Z
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
else if (positionH === 'flipped' && positionV === 'flipped') {
|
|
56
|
+
// 直角在左下角
|
|
57
|
+
cardPath = `
|
|
58
|
+
M ${r} 0
|
|
59
|
+
L ${width - r} 0
|
|
60
|
+
Q ${width} 0 ${width} ${r}
|
|
61
|
+
L ${width} ${height - r}
|
|
62
|
+
Q ${width} ${height} ${width - r} ${height}
|
|
63
|
+
L ${r} ${height}
|
|
64
|
+
Q 0 ${height} 0 ${height - r}
|
|
65
|
+
L 0 0
|
|
66
|
+
L ${r} 0
|
|
67
|
+
Z
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
else if (positionH === 'normal' && positionV === 'flipped') {
|
|
71
|
+
// 右上角为直角,其它角为圆角
|
|
72
|
+
cardPath = `
|
|
73
|
+
M 0 0
|
|
74
|
+
L ${width} 0
|
|
75
|
+
L ${width} ${height - r}
|
|
76
|
+
Q ${width} ${height} ${width - r} ${height}
|
|
77
|
+
L ${r} ${height}
|
|
78
|
+
Q 0 ${height} 0 ${height - r}
|
|
79
|
+
L 0 ${r}
|
|
80
|
+
Q 0 0 ${r} 0
|
|
81
|
+
Z
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
else if (positionH === 'flipped') {
|
|
85
|
+
// 直角在左上角
|
|
86
|
+
cardPath = `
|
|
87
|
+
M ${r} 0
|
|
88
|
+
L ${width - r} 0
|
|
89
|
+
Q ${width} 0 ${width} ${r}
|
|
90
|
+
L ${width} ${height - r}
|
|
91
|
+
Q ${width} ${height} ${width - r} ${height}
|
|
92
|
+
L 0 ${height}
|
|
93
|
+
L 0 ${r}
|
|
94
|
+
Q 0 0 ${r} 0
|
|
95
|
+
Z
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// 默认逻辑:直角在右下角
|
|
100
|
+
cardPath = `
|
|
101
|
+
M ${r} 0
|
|
102
|
+
L ${width - r} 0
|
|
103
|
+
Q ${width} 0 ${width} ${r}
|
|
104
|
+
L ${width} ${height}
|
|
105
|
+
L ${r} ${height}
|
|
106
|
+
Q 0 ${height} 0 ${height - r}
|
|
107
|
+
L 0 ${r}
|
|
108
|
+
Q 0 0 ${r} 0
|
|
109
|
+
Z
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Path, { d: cardPath, x: 0, y: 0, width: width, height: height, fill: themeColors.colorPrimary }), _jsx(ItemIcon, { indexes: indexes, x: iconX, y: iconY, size: iconSize, fill: themeColors.colorBg }), _jsx(ItemLabel, { indexes: indexes, x: labelX, y: labelY, width: contentWidth, fontSize: 14, fontWeight: "bold", fill: themeColors.colorBg, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', children: datum.label }), datum.desc && (_jsx(ItemDesc, { indexes: indexes, x: descX, y: descY, width: contentWidth, fontSize: 11, wordWrap: true, fill: themeColors.colorBg, alignHorizontal: positionH === 'flipped' ? 'right' : 'left', children: datum.desc }))] }));
|
|
113
|
+
};
|
|
114
|
+
registerItem('quarter-simple-card', {
|
|
115
|
+
component: QuarterSimpleCard,
|
|
116
|
+
composites: ['icon', 'label', 'desc'],
|
|
117
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface RibbonCardProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
gap?: number;
|
|
9
|
+
ribbonHeight?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const RibbonCard: ComponentType<RibbonCardProps>;
|
|
@@ -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, Path, Rect } from '@antv/infographic-jsx';
|
|
4
|
+
import tinycolor from 'tinycolor2';
|
|
5
|
+
import { ItemDesc, ItemIcon, ItemLabel } from '../components';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const RibbonCard = (props) => {
|
|
9
|
+
const [{ datum, indexes, width = 240, height = 140, iconSize = 28, gap = 12, ribbonHeight = 32, themeColors, }, restProps,] = getItemProps(props, [
|
|
10
|
+
'width',
|
|
11
|
+
'height',
|
|
12
|
+
'iconSize',
|
|
13
|
+
'gap',
|
|
14
|
+
'ribbonHeight',
|
|
15
|
+
]);
|
|
16
|
+
const gradientId = `${themeColors.colorPrimary}-ribbon`;
|
|
17
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Defs, { children: _jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", stopColor: themeColors.colorPrimary }), _jsx("stop", { offset: "100%", stopColor: tinycolor(themeColors.colorPrimary)
|
|
18
|
+
.darken(15)
|
|
19
|
+
.toHexString() })] }) }), _jsx(Rect, { x: 0, y: 0, width: width, height: height, fill: themeColors.colorBgElevated, stroke: themeColors.colorPrimaryBg, strokeWidth: 1, rx: 8, ry: 8 }), _jsx(Rect, { x: 0, y: 0, width: width, height: ribbonHeight, fill: `url(#${gradientId})`, rx: 8, ry: 8 }), _jsx(Rect, { x: 0, y: 8, width: width, height: ribbonHeight - 8, fill: `url(#${gradientId})` }), _jsx(Path, { x: width - 20, y: ribbonHeight, width: 20, height: 8, fill: tinycolor(themeColors.colorPrimary).darken(25).toHexString(), d: "M0,0 L20,0 L15,8 L5,8 Z" }), _jsx(ItemIcon, { indexes: indexes, x: gap, y: ribbonHeight + gap, size: iconSize, fill: themeColors.colorPrimary }), _jsx(ItemLabel, { indexes: indexes, x: iconSize + 2 * gap, y: ribbonHeight + gap, width: width - iconSize - 3 * gap, height: iconSize, alignHorizontal: "left", alignVertical: "center", lineHeight: 1, fontWeight: "bold", fill: themeColors.colorText, children: datum.label }), _jsx(ItemDesc, { indexes: indexes, x: gap, y: ribbonHeight + iconSize + gap + 5, width: width - 2 * gap, alignHorizontal: "left", fill: themeColors.colorTextSecondary, lineNumber: 3, wordWrap: true, children: datum.desc }), _jsx(ItemIcon, { indexes: indexes, x: width - gap - 8, y: gap / 2, size: 16, fill: themeColors.colorWhite })] }));
|
|
20
|
+
};
|
|
21
|
+
registerItem('ribbon-card', {
|
|
22
|
+
component: RibbonCard,
|
|
23
|
+
composites: ['icon', 'label', 'desc'],
|
|
24
|
+
});
|
|
@@ -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 RoundedRectNodeProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
padding?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const RoundedRectNode: ComponentType<RoundedRectNodeProps>;
|
|
@@ -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 { Group, Rect } from '@antv/infographic-jsx';
|
|
4
|
+
import { ItemLabel } from '../components';
|
|
5
|
+
import { getItemId, getItemProps } from '../utils';
|
|
6
|
+
import { registerItem } from './registry';
|
|
7
|
+
export const RoundedRectNode = (props) => {
|
|
8
|
+
const [{ indexes, datum, themeColors, width = 300, height = 40, padding = 4, positionH = 'normal', }, restProps,] = getItemProps(props, ['width', 'height', 'borderRadius', 'padding']);
|
|
9
|
+
const borderRadius = height / 2;
|
|
10
|
+
// Calculate text positioning
|
|
11
|
+
const textX = borderRadius;
|
|
12
|
+
const textY = padding;
|
|
13
|
+
const textWidth = width - borderRadius * 2;
|
|
14
|
+
const textHeight = height - padding * 2;
|
|
15
|
+
return (_jsxs(Group, { ...restProps, children: [_jsx(Rect, { id: getItemId(indexes, 'shape', 'rect'), width: width, height: height, rx: borderRadius, ry: borderRadius, fill: themeColors.colorPrimaryBg, stroke: themeColors.colorPrimary, strokeWidth: 1, opacity: 0.8 }), _jsx(ItemLabel, { indexes: indexes, x: textX, y: textY, width: textWidth, height: textHeight, alignHorizontal: positionH === 'flipped'
|
|
16
|
+
? 'right'
|
|
17
|
+
: positionH === 'center'
|
|
18
|
+
? 'center'
|
|
19
|
+
: 'left', alignVertical: "center", fontSize: 14, fontWeight: "500", fill: themeColors.colorText, children: datum.label })] }));
|
|
20
|
+
};
|
|
21
|
+
registerItem('rounded-rect-node', {
|
|
22
|
+
component: RoundedRectNode,
|
|
23
|
+
composites: ['label'],
|
|
24
|
+
});
|
|
@@ -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 SimpleHorizontalArrowProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
/** 翻转方向 */
|
|
7
|
+
flipped?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const SimpleHorizontalArrow: ComponentType<SimpleHorizontalArrowProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { getElementBounds, Group, Polygon, Text, } from '@antv/infographic-jsx';
|
|
4
|
+
import { Gap, ItemDesc, 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 SimpleHorizontalArrow = (props) => {
|
|
10
|
+
const [{ indexes, datum, width = 140, themeColors, positionV = 'normal' }, restProps,] = getItemProps(props, ['width']);
|
|
11
|
+
const isVNormal = positionV !== 'flipped';
|
|
12
|
+
const textAlignVertical = isVNormal ? '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 arrowHeight = 30;
|
|
16
|
+
const labelGap = 10;
|
|
17
|
+
const labelBounds = getElementBounds(label);
|
|
18
|
+
const descBounds = getElementBounds(desc);
|
|
19
|
+
const textHeight = labelBounds.height + descBounds.height;
|
|
20
|
+
const totalHeight = textHeight + labelGap + arrowHeight + labelGap + textHeight;
|
|
21
|
+
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: labelGap })] })) : (_jsx(_Fragment, { children: _jsx(Gap, { height: textHeight + labelGap }) })), _jsxs(AlignLayout, { horizontal: "center", vertical: "center", children: [_jsx(HorizontalArrow, { 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
|
|
22
|
+
? datum.time
|
|
23
|
+
: String(indexes[0] + 1)
|
|
24
|
+
.padStart(2, '0')
|
|
25
|
+
.slice(-2) })] }), !isVNormal ? (_jsxs(_Fragment, { children: [_jsx(Gap, { height: labelGap }), label, desc] })) : (_jsx(_Fragment, { children: _jsx(Gap, { height: textHeight + labelGap }) }))] }) }));
|
|
26
|
+
};
|
|
27
|
+
const HorizontalArrow = (props) => {
|
|
28
|
+
const { x = 0, y = 0, width = 100, height = 40, fill = '#1890FF', size = 10, } = props;
|
|
29
|
+
return (_jsx(Polygon, { width: width, height: height, points: [
|
|
30
|
+
{ x, y },
|
|
31
|
+
{ x: x + width - size, y },
|
|
32
|
+
{ x: x + width, y: y + height / 2 },
|
|
33
|
+
{ x: x + width - size, y: y + height },
|
|
34
|
+
{ x, y: y + height },
|
|
35
|
+
{ x: x + size, y: y + height / 2 },
|
|
36
|
+
], fill: fill }));
|
|
37
|
+
};
|
|
38
|
+
registerItem('simple-horizontal-arrow', {
|
|
39
|
+
component: SimpleHorizontalArrow,
|
|
40
|
+
composites: ['label', 'desc', 'time'],
|
|
41
|
+
});
|
|
@@ -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 SimpleIllusItemProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
illusSize?: number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
usePaletteColor?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const SimpleIllusItem: ComponentType<SimpleIllusItemProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@antv/infographic-jsx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
3
|
+
import { getElementBounds } from '@antv/infographic-jsx';
|
|
4
|
+
import { Illus, ItemDesc, ItemLabel } from '../components';
|
|
5
|
+
import { FlexLayout } from '../layouts';
|
|
6
|
+
import { getItemProps } from '../utils';
|
|
7
|
+
import { registerItem } from './registry';
|
|
8
|
+
export const SimpleIllusItem = (props) => {
|
|
9
|
+
const [{ indexes, datum, width = 180, illusSize = width, gap = 8, themeColors, usePaletteColor = false, }, restProps,] = getItemProps(props, ['width', 'illusSize', 'gap', 'usePaletteColor']);
|
|
10
|
+
const { label, desc } = datum;
|
|
11
|
+
const labelColor = usePaletteColor
|
|
12
|
+
? themeColors.colorPrimary
|
|
13
|
+
: themeColors.colorText;
|
|
14
|
+
const labelContent = (_jsx(ItemLabel, { indexes: indexes, width: width, alignHorizontal: "center", alignVertical: "center", fill: labelColor, children: label }));
|
|
15
|
+
const labelBounds = getElementBounds(labelContent);
|
|
16
|
+
return (_jsxs(FlexLayout, { ...restProps, width: width, height: illusSize + gap + labelBounds.height + gap + 48, flexDirection: "column", alignItems: "center", justifyContent: "center", gap: gap, children: [_jsx(Illus, { indexes: indexes, width: illusSize, height: illusSize }), labelContent, _jsx(ItemDesc, { indexes: indexes, width: width, alignHorizontal: "center", alignVertical: "top", fill: themeColors.colorTextSecondary, lineNumber: 3, children: desc })] }));
|
|
17
|
+
};
|
|
18
|
+
registerItem('simple-illus', {
|
|
19
|
+
component: SimpleIllusItem,
|
|
20
|
+
composites: ['illus', 'label', 'desc'],
|
|
21
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsxImportSource @antv/infographic-jsx */
|
|
2
|
+
import { ComponentType } from '@antv/infographic-jsx';
|
|
3
|
+
import type { BaseItemProps } from './types';
|
|
4
|
+
export interface SimpleItemProps extends BaseItemProps {
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
iconSize?: number;
|
|
10
|
+
iconType?: 'default' | 'circle';
|
|
11
|
+
usePaletteColor?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const SimpleItem: ComponentType<SimpleItemProps>;
|