@visactor/vrender-core 0.22.0 → 0.22.2

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.
Files changed (134) hide show
  1. package/cjs/canvas/contributions/base-canvas.d.ts +1 -0
  2. package/cjs/canvas/contributions/base-canvas.js +3 -0
  3. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  4. package/cjs/common/custom-path2d.js +8 -6
  5. package/cjs/common/custom-path2d.js.map +1 -1
  6. package/cjs/graphic/config.js +7 -3
  7. package/cjs/graphic/config.js.map +1 -1
  8. package/cjs/graphic/graphic.d.ts +8 -3
  9. package/cjs/graphic/graphic.js +52 -10
  10. package/cjs/graphic/graphic.js.map +1 -1
  11. package/cjs/graphic/group.d.ts +1 -0
  12. package/cjs/graphic/group.js +5 -0
  13. package/cjs/graphic/group.js.map +1 -1
  14. package/cjs/graphic/image.d.ts +3 -2
  15. package/cjs/graphic/image.js +23 -13
  16. package/cjs/graphic/image.js.map +1 -1
  17. package/cjs/graphic/richtext/line.js +11 -1
  18. package/cjs/graphic/richtext/line.js.map +1 -1
  19. package/cjs/graphic/richtext/paragraph.d.ts +8 -1
  20. package/cjs/graphic/richtext/paragraph.js +5 -16
  21. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  22. package/cjs/graphic/richtext.js +11 -7
  23. package/cjs/graphic/richtext.js.map +1 -1
  24. package/cjs/graphic/symbol.d.ts +1 -1
  25. package/cjs/graphic/symbol.js +20 -37
  26. package/cjs/graphic/symbol.js.map +1 -1
  27. package/cjs/graphic/text.d.ts +1 -0
  28. package/cjs/graphic/text.js +3 -0
  29. package/cjs/graphic/text.js.map +1 -1
  30. package/cjs/interface/graphic/arc.js.map +1 -1
  31. package/cjs/interface/graphic/area.js.map +1 -1
  32. package/cjs/interface/graphic/circle.js.map +1 -1
  33. package/cjs/interface/graphic/group.d.ts +1 -0
  34. package/cjs/interface/graphic/group.js.map +1 -1
  35. package/cjs/interface/graphic/image.d.ts +2 -0
  36. package/cjs/interface/graphic/image.js.map +1 -1
  37. package/cjs/interface/graphic/line.js.map +1 -1
  38. package/cjs/interface/graphic/polygon.js.map +1 -1
  39. package/cjs/interface/graphic/rect.js.map +1 -1
  40. package/cjs/interface/graphic/richText.d.ts +4 -0
  41. package/cjs/interface/graphic/richText.js.map +1 -1
  42. package/cjs/interface/graphic/symbol.d.ts +1 -0
  43. package/cjs/interface/graphic/symbol.js.map +1 -1
  44. package/cjs/interface/graphic/text.js.map +1 -1
  45. package/cjs/interface/graphic.d.ts +5 -0
  46. package/cjs/interface/graphic.js.map +1 -1
  47. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.d.ts +1 -0
  48. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +9 -3
  49. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  50. package/cjs/plugins/builtin-plugin/edit-module.js +3 -2
  51. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  52. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +6 -3
  53. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +49 -31
  54. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  55. package/cjs/render/contributions/render/base-render.js +5 -2
  56. package/cjs/render/contributions/render/base-render.js.map +1 -1
  57. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +14 -0
  58. package/cjs/render/contributions/render/contributions/base-contribution-render.js +36 -1
  59. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  60. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +2 -1
  61. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +20 -3
  62. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  63. package/cjs/render/contributions/render/group-render.js +26 -4
  64. package/cjs/render/contributions/render/group-render.js.map +1 -1
  65. package/cjs/render/contributions/render/image-render.js +5 -3
  66. package/cjs/render/contributions/render/image-render.js.map +1 -1
  67. package/dist/index.es.js +4946 -4648
  68. package/es/canvas/contributions/base-canvas.d.ts +1 -0
  69. package/es/canvas/contributions/base-canvas.js +3 -0
  70. package/es/canvas/contributions/base-canvas.js.map +1 -1
  71. package/es/common/custom-path2d.js +8 -6
  72. package/es/common/custom-path2d.js.map +1 -1
  73. package/es/graphic/config.js +7 -3
  74. package/es/graphic/config.js.map +1 -1
  75. package/es/graphic/graphic.d.ts +8 -3
  76. package/es/graphic/graphic.js +58 -12
  77. package/es/graphic/graphic.js.map +1 -1
  78. package/es/graphic/group.d.ts +1 -0
  79. package/es/graphic/group.js +5 -0
  80. package/es/graphic/group.js.map +1 -1
  81. package/es/graphic/image.d.ts +3 -2
  82. package/es/graphic/image.js +23 -13
  83. package/es/graphic/image.js.map +1 -1
  84. package/es/graphic/richtext/line.js +11 -1
  85. package/es/graphic/richtext/line.js.map +1 -1
  86. package/es/graphic/richtext/paragraph.d.ts +8 -1
  87. package/es/graphic/richtext/paragraph.js +5 -16
  88. package/es/graphic/richtext/paragraph.js.map +1 -1
  89. package/es/graphic/richtext.js +11 -7
  90. package/es/graphic/richtext.js.map +1 -1
  91. package/es/graphic/symbol.d.ts +1 -1
  92. package/es/graphic/symbol.js +19 -42
  93. package/es/graphic/symbol.js.map +1 -1
  94. package/es/graphic/text.d.ts +1 -0
  95. package/es/graphic/text.js +3 -0
  96. package/es/graphic/text.js.map +1 -1
  97. package/es/interface/graphic/arc.js.map +1 -1
  98. package/es/interface/graphic/area.js.map +1 -1
  99. package/es/interface/graphic/circle.js.map +1 -1
  100. package/es/interface/graphic/group.d.ts +1 -0
  101. package/es/interface/graphic/group.js.map +1 -1
  102. package/es/interface/graphic/image.d.ts +2 -0
  103. package/es/interface/graphic/image.js.map +1 -1
  104. package/es/interface/graphic/line.js.map +1 -1
  105. package/es/interface/graphic/polygon.js.map +1 -1
  106. package/es/interface/graphic/rect.js.map +1 -1
  107. package/es/interface/graphic/richText.d.ts +4 -0
  108. package/es/interface/graphic/richText.js.map +1 -1
  109. package/es/interface/graphic/symbol.d.ts +1 -0
  110. package/es/interface/graphic/symbol.js.map +1 -1
  111. package/es/interface/graphic/text.js.map +1 -1
  112. package/es/interface/graphic.d.ts +5 -0
  113. package/es/interface/graphic.js.map +1 -1
  114. package/es/plugins/builtin-plugin/auto-refresh-plugin.d.ts +1 -0
  115. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +9 -3
  116. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -1
  117. package/es/plugins/builtin-plugin/edit-module.js +3 -2
  118. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  119. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +6 -3
  120. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +49 -31
  121. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  122. package/es/render/contributions/render/base-render.js +5 -1
  123. package/es/render/contributions/render/base-render.js.map +1 -1
  124. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +14 -0
  125. package/es/render/contributions/render/contributions/base-contribution-render.js +31 -0
  126. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  127. package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +2 -1
  128. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +22 -2
  129. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  130. package/es/render/contributions/render/group-render.js +27 -3
  131. package/es/render/contributions/render/group-render.js.map +1 -1
  132. package/es/render/contributions/render/image-render.js +4 -3
  133. package/es/render/contributions/render/image-render.js.map +1 -1
  134. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,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mB;QAC9D,OAAO,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IACS,aAAa,CAAC,GAAW,EAAE,CAAC,GAAG,mBAAmB;QAC1D,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;;AAroBM,wBAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AA8nBK,qBAAgB,GAAG;IACxB,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEK,qBAAgB,GAAG;IACxB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAGJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"text.js","sourcesContent":["import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n 'maxWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n /**\n * 获取font字符串\n */\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n\n get clipedWidth(): number | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n\n /**\n * 支持单行文本,横排纵排均支持\n * TODO 支持多行文本\n */\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return false;\n }\n const { text } = this.attribute;\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n\n get multilineLayout(): LayoutType | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n /**\n * 是否是多行文本\n */\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n /**\n * 图元属性合法,且文字不为空或者null/undefined\n * @returns\n */\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n this.updateMultilineAABBBounds([text]);\n const layoutData = this.cache.layoutData;\n if (layoutData && layoutData.lines && layoutData.lines.length) {\n const line = layoutData.lines[0];\n this.cache.clipedText = line.str;\n this.cache.clipedWidth = line.width;\n }\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n guessLineHeightBuf(fontSize: number) {\n return fontSize ? fontSize * 0.1 : 0;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n wrap = textTheme.wrap,\n measureMode = textTheme.measureMode,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition,\n ignoreBuf = textTheme.ignoreBuf,\n keepCenterInLine = textTheme.keepCenterInLine\n } = attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(attribute, textTheme, buf);\n\n if (whiteSpace === 'normal' || wrap) {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n {\n lineWidth: maxLineWidth,\n suffixPosition,\n measureMode,\n keepCenterInLine\n }\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n measureMode = textTheme.measureMode,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp,\n keepCenterInLine = textTheme.keepCenterInLine\n } = this.attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(this.attribute, textTheme, buf);\n\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };\n const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure as any);\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = textMeasure.clipText(\n str,\n textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = textMeasure.clipTextWithSuffix(\n lines[i],\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = textMeasure.measureTextWidth(text, textOptions);\n lineWidth = Math.max(lineWidth, width);\n const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);\n linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * lineHeight;\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any, linesLayout);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight = this.getLineHeight(attribute, textTheme, 0);\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n // /**\n // * 是否是简单文字\n // * 单行,横排\n // * @returns\n // */\n // protected isSinglelineAndHorizontal(): boolean {\n // return !this.isMultiLine && this.attribute.direction !== 'vertical';\n // }\n\n protected getMaxWidth(theme: ITextGraphicAttribute): number {\n // 传入了maxLineWidth就优先使用,否则使用maxWidth\n const attribute = this.attribute;\n return attribute.maxLineWidth ?? attribute.maxWidth ?? theme.maxWidth;\n }\n\n protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number) {\n return (\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf\n );\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAErE,MAAM,mBAAmB,GAAG;IAC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,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;;AA3oBM,wBAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AAooBK,qBAAgB,GAAG;IACxB,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEK,qBAAgB,GAAG;IACxB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAGJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"text.js","sourcesContent":["import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n 'maxWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n /**\n * 获取font字符串\n */\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n\n get clipedWidth(): number | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n\n /**\n * 支持单行文本,横排纵排均支持\n * TODO 支持多行文本\n */\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return false;\n }\n const { text } = this.attribute;\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n\n get multilineLayout(): LayoutType | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n /**\n * 是否是多行文本\n */\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n /**\n * 图元属性合法,且文字不为空或者null/undefined\n * @returns\n */\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n this.updateMultilineAABBBounds([text]);\n const layoutData = this.cache.layoutData;\n if (layoutData && layoutData.lines && layoutData.lines.length) {\n const line = layoutData.lines[0];\n this.cache.clipedText = line.str;\n this.cache.clipedWidth = line.width;\n }\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n guessLineHeightBuf(fontSize: number) {\n return fontSize ? fontSize * 0.1 : 0;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n wrap = textTheme.wrap,\n measureMode = textTheme.measureMode,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition,\n ignoreBuf = textTheme.ignoreBuf,\n keepCenterInLine = textTheme.keepCenterInLine\n } = attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(attribute, textTheme, buf);\n\n if (whiteSpace === 'normal' || wrap) {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n {\n lineWidth: maxLineWidth,\n suffixPosition,\n measureMode,\n keepCenterInLine\n }\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n measureMode = textTheme.measureMode,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp,\n keepCenterInLine = textTheme.keepCenterInLine\n } = this.attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(this.attribute, textTheme, buf);\n\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };\n const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure as any);\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = textMeasure.clipText(\n str,\n textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = textMeasure.clipTextWithSuffix(\n lines[i],\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = textMeasure.measureTextWidth(text, textOptions);\n lineWidth = Math.max(lineWidth, width);\n const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);\n linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * lineHeight;\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any, linesLayout);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight = this.getLineHeight(attribute, textTheme, 0);\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n // /**\n // * 是否是简单文字\n // * 单行,横排\n // * @returns\n // */\n // protected isSinglelineAndHorizontal(): boolean {\n // return !this.isMultiLine && this.attribute.direction !== 'vertical';\n // }\n\n protected getMaxWidth(theme: ITextGraphicAttribute): number {\n // 传入了maxLineWidth就优先使用,否则使用maxWidth\n const attribute = this.attribute;\n return attribute.maxLineWidth ?? attribute.maxWidth ?? theme.maxWidth;\n }\n\n protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number) {\n return (\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf\n );\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any) {\n if (key === 'text') {\n nextAttributes.text = nextStepVal;\n }\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/arc.ts"],"names":[],"mappings":"","file":"arc.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\n/**\n * 扇区属性\n */\nexport type IArcAttribute = {\n /** 内半径 */\n innerRadius: number;\n /** 外半径 */\n outerRadius: number;\n /* 内边距 */\n innerPadding: number;\n /* 外边距 */\n outerPadding: number;\n /**\n * 起始角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n startAngle: number;\n /**\n * 终止角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n endAngle: number;\n /**\n * 用于指定扇形区块的内外圆角半径,支持设置固定数值 或者 相对于扇形区块的半径差(| outerRadius - innerRadius |)的百分比值\n * 支持分别配置从外到内顺时针方向四个角的圆角半径,百分比值为相对于内外扇形的半径差。\n * 其中\n *\n * cornerRadius: 10:表示内圆角半径和外圆角半径都是 10px。\n * cornerRadius: '20%':表示内圆角半径和外圆角半径都是扇形区块半径的 20%。\n * cornerRadius: [10, 20]:表示为环形图时,外圆角半径是 10px、内圆角半径是 20px。\n * cornerRadius: ['20%', '50%']:表示为环形图时,外圆角半径是内外圆半径差的 20%、内圆角半径是内外圆半径差的 50%。\n * cornerRadius: [5, 10, 15, 20]:表示外圆角半径分别为 5px 和 10px,内圆角半径分别为 15px 和 20px。\n *\n * 也支持如下形式的配置:\n * cornerRadius: [5, '10%', '20%', 10]\n * TODO: 暂不支持\n */\n cornerRadius: number | string | Array<number | string>;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle: number;\n padRadius: number;\n\n /**\n * 对应了线段的 lineCap 属性,lineCap 表示的是线段末端如何绘制\n * cap: true 表示在弧线的起始位置都增加一个角度,角度是 | outerRadius - innerRadius | / outerRadius\n */\n cap: boolean | [boolean, boolean];\n /**\n * 当cap = true 并且 使用了渐变填充的时候,自动实现conical渐变,也就是环形的渐变\n */\n forceShowCap: boolean;\n};\n/**\n * 内部缓存,用于存储一些内部变量\n */\nexport type IArcCache = {\n /** 解析后的圆角配置 */\n cornerRadius?: [number, number, number, number];\n startAngle?: number;\n endAngle?: number;\n};\n\nexport type IArcGraphicAttribute = Partial<IGraphicAttribute> & Partial<IArcAttribute>;\n\nexport interface IArc extends IGraphic<IArcGraphicAttribute> {\n cache?: ICustomPath2D;\n\n getParsedCornerRadius: () => number | number[];\n getParsedAngle: () => { startAngle: number; endAngle: number; sc?: number; ec?: number };\n getParsePadAngle: (\n startAngle: number,\n endAngle: number\n ) => {\n outerStartAngle: number;\n outerEndAngle: number;\n innerStartAngle: number;\n innerEndAngle: number;\n\n outerDeltaAngle: number;\n innerDeltaAngle: number;\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/arc.ts"],"names":[],"mappings":"","file":"arc.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\n/**\n * 扇区属性\n */\nexport type IArcAttribute = {\n /**\n * 内半径\n */\n innerRadius: number;\n /**\n * 外半径\n */\n outerRadius: number;\n /**\n * 内边距\n */\n innerPadding: number;\n /**\n * 外边距\n */\n outerPadding: number;\n /**\n * 起始角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n startAngle: number;\n /**\n * 终止角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n endAngle: number;\n /**\n * 用于指定扇形区块的内外圆角半径,支持设置固定数值 或者 相对于扇形区块的半径差(| outerRadius - innerRadius |)的百分比值\n * 支持分别配置从外到内顺时针方向四个角的圆角半径,百分比值为相对于内外扇形的半径差。\n * 其中\n *\n * cornerRadius: 10:表示内圆角半径和外圆角半径都是 10px。\n * cornerRadius: '20%':表示内圆角半径和外圆角半径都是扇形区块半径的 20%。\n * cornerRadius: [10, 20]:表示为环形图时,外圆角半径是 10px、内圆角半径是 20px。\n * cornerRadius: ['20%', '50%']:表示为环形图时,外圆角半径是内外圆半径差的 20%、内圆角半径是内外圆半径差的 50%。\n * cornerRadius: [5, 10, 15, 20]:表示外圆角半径分别为 5px 和 10px,内圆角半径分别为 15px 和 20px。\n *\n * 也支持如下形式的配置:\n * cornerRadius: [5, '10%', '20%', 10]\n * TODO: 暂不支持\n */\n cornerRadius: number | string | Array<number | string>;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle: number;\n /**\n * 间隙半径\n */\n padRadius: number;\n\n /**\n * 对应了线段的 lineCap 属性,lineCap 表示的是线段末端如何绘制\n * cap: true 表示在弧线的起始位置都增加一个角度,角度是 | outerRadius - innerRadius | / outerRadius\n */\n cap: boolean | [boolean, boolean];\n /**\n * 当cap = true 并且 使用了渐变填充的时候,自动实现conical渐变,也就是环形的渐变\n */\n forceShowCap: boolean;\n};\n/**\n * 内部缓存,用于存储一些内部变量\n */\nexport type IArcCache = {\n /** 解析后的圆角配置 */\n cornerRadius?: [number, number, number, number];\n startAngle?: number;\n endAngle?: number;\n};\n\nexport type IArcGraphicAttribute = Partial<IGraphicAttribute> & Partial<IArcAttribute>;\n\nexport interface IArc extends IGraphic<IArcGraphicAttribute> {\n cache?: ICustomPath2D;\n\n getParsedCornerRadius: () => number | number[];\n getParsedAngle: () => { startAngle: number; endAngle: number; sc?: number; ec?: number };\n getParsePadAngle: (\n startAngle: number,\n endAngle: number\n ) => {\n outerStartAngle: number;\n outerEndAngle: number;\n innerStartAngle: number;\n innerEndAngle: number;\n\n outerDeltaAngle: number;\n innerDeltaAngle: number;\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/area.ts"],"names":[],"mappings":"","file":"area.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { ISegPath2D } from '../curve';\nimport type { IConnectedStyle, IGraphic, IGraphicAttribute } from '../graphic';\nimport type { ICurveType } from '../common';\n\nexport type IAreaAttribute = {\n segments: IAreaSegment[]; // 分段设置point和样式\n points: IPointLike[];\n curveType: ICurveType;\n clipRange: number;\n closePath: boolean;\n curveTension: number;\n};\n\nexport type IAreaCacheItem = {\n top: ISegPath2D;\n bottom: ISegPath2D;\n};\n\nexport type IAreaGraphicAttribute = Partial<IGraphicAttribute> & Partial<IAreaAttribute> & Partial<IConnectedStyle>;\n\nexport interface IArea extends IGraphic<IAreaGraphicAttribute> {\n cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'fill' | 'fillOpacity' | 'background' | 'texture' | 'textureColor' | 'textureSize' | 'texturePadding'\n>;\n\nexport interface IAreaSegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/area.ts"],"names":[],"mappings":"","file":"area.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { ISegPath2D } from '../curve';\nimport type { IConnectedStyle, IGraphic, IGraphicAttribute } from '../graphic';\nimport type { ICurveType } from '../common';\n\nexport type IAreaAttribute = {\n /**\n * 分段设置point和样式\n */\n segments: IAreaSegment[];\n /**\n * 所有的点坐标\n */\n points: IPointLike[];\n /**\n * 曲线的类型,默认为linear\n */\n curveType: ICurveType;\n /**\n * 线段的裁切比例/显示长度占总长度的比例\n */\n clipRange: number;\n /**\n * 是否是闭合曲线\n */\n closePath: boolean;\n /**\n * 曲线类型为catmullRom时,对应的张力参数\n */\n curveTension: number;\n};\n\nexport type IAreaCacheItem = {\n top: ISegPath2D;\n bottom: ISegPath2D;\n};\n\nexport type IAreaGraphicAttribute = Partial<IGraphicAttribute> & Partial<IAreaAttribute> & Partial<IConnectedStyle>;\n\nexport interface IArea extends IGraphic<IAreaGraphicAttribute> {\n cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'fill' | 'fillOpacity' | 'background' | 'texture' | 'textureColor' | 'textureSize' | 'texturePadding'\n>;\n\nexport interface IAreaSegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/circle.ts"],"names":[],"mappings":"","file":"circle.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type ICircleAttribute = {\n radius: number;\n startAngle: number;\n endAngle: number;\n};\n\nexport type ICircleGraphicAttribute = Partial<IGraphicAttribute> & Partial<ICircleAttribute>;\n\nexport type ICircle = IGraphic<ICircleGraphicAttribute>;\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/circle.ts"],"names":[],"mappings":"","file":"circle.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type ICircleAttribute = {\n /**\n * 半径\n */\n radius: number;\n /**\n * 起始角度,单位为弧度\n */\n startAngle: number;\n /**\n * 终止角度,单位为弧度\n */\n endAngle: number;\n};\n\nexport type ICircleGraphicAttribute = Partial<IGraphicAttribute> & Partial<ICircleAttribute>;\n\nexport type ICircle = IGraphic<ICircleGraphicAttribute>;\n"]}
@@ -17,6 +17,7 @@ export type IGroupAttribute = {
17
17
  alignItems?: 'flex-start' | 'flex-end' | 'center';
18
18
  alignContent?: 'flex-start' | 'center' | 'space-between' | 'space-around';
19
19
  baseOpacity?: number;
20
+ drawMode?: 0 | 1 | 2;
20
21
  };
21
22
  export type IGroupGraphicAttribute = Partial<IGraphicAttribute> & Partial<IGroupAttribute>;
22
23
  export interface IGroup extends IGraphic<IGroupGraphicAttribute> {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/group.ts"],"names":[],"mappings":"","file":"group.js","sourcesContent":["import type { ITheme, IThemeSpec } from './theme';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { INode } from '../node-tree';\nimport type { GraphicAttributeMap } from './creator';\n\nexport type IGroupAttribute = {\n path: IGraphic[];\n width: number;\n height: number;\n cornerRadius: number | number[];\n cornerType: 'round' | 'bevel';\n clip: boolean;\n visibleAll: boolean;\n display?: 'relative' | 'inner-block' | 'flex';\n flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n flexWrap?: 'nowrap' | 'wrap';\n justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';\n alignItems?: 'flex-start' | 'flex-end' | 'center';\n alignContent?: 'flex-start' | 'center' | 'space-between' | 'space-around';\n // 基准的透明度,用于控制group下面整体图元的透明度\n baseOpacity?: number;\n};\n\nexport type IGroupGraphicAttribute = Partial<IGraphicAttribute> & Partial<IGroupAttribute>;\n\nexport interface IGroup extends IGraphic<IGroupGraphicAttribute> {\n childrenPickable?: boolean; // 子元素是否可以被pick\n\n theme?: ITheme;\n\n createTheme: () => void;\n hideAll: () => void;\n showAll: () => void;\n\n setTheme: (t: IThemeSpec) => void;\n\n incrementalAppendChild: (node: INode, highPerformance?: boolean) => INode | null;\n incrementalClearChild: () => void;\n\n createOrUpdateChild: <T extends keyof GraphicAttributeMap>(\n graphicName: string,\n attributes: GraphicAttributeMap[T],\n graphicType: T\n ) => INode;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/group.ts"],"names":[],"mappings":"","file":"group.js","sourcesContent":["import type { ITheme, IThemeSpec } from './theme';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { INode } from '../node-tree';\nimport type { GraphicAttributeMap } from './creator';\n\nexport type IGroupAttribute = {\n /**\n * 路径,用于绘制路径图形或者设置裁剪图形\n */\n path: IGraphic[];\n /**\n * 宽度\n */\n width: number;\n /**\n * 高度\n */\n height: number;\n /**\n * 圆角半径\n */\n cornerRadius: number | number[];\n /**\n * 圆角类型,\n * 'round' - 圆弧\n * 'bevel' - 斜角\n */\n cornerType: 'round' | 'bevel';\n /**\n * 是否剪裁\n */\n clip: boolean;\n /**\n * 所有的子节点是否可见\n */\n visibleAll: boolean;\n /**\n * 布局方式\n */\n display?: 'relative' | 'inner-block' | 'flex';\n /**\n * flex布局的方向\n */\n flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n /**\n * flex布局的换行\n */\n flexWrap?: 'nowrap' | 'wrap';\n /**\n * flex布局中,子元素在主轴上的对齐方式\n */\n justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';\n /**\n * flex布局中,子元素在交叉轴上的对齐方式\n */\n alignItems?: 'flex-start' | 'flex-end' | 'center';\n /**\n * flex布局中,多行内容的垂直对齐方式\n */\n alignContent?: 'flex-start' | 'center' | 'space-between' | 'space-around';\n /**\n * 基准的透明度,用于控制group下面整体图元的透明度\n */\n baseOpacity?: number;\n /**\n * 绘制模式\n * 0 - 直接绘制\n * 1 - 绘制到新Canvas上,再绘制回来,需要绘制背景,然后绘制group\n * 2 - 绘制到新Canvas上,再绘制回来,不需要绘制背景,只需要绘制group\n */\n drawMode?: 0 | 1 | 2;\n};\n\nexport type IGroupGraphicAttribute = Partial<IGraphicAttribute> & Partial<IGroupAttribute>;\n\nexport interface IGroup extends IGraphic<IGroupGraphicAttribute> {\n childrenPickable?: boolean; // 子元素是否可以被pick\n\n theme?: ITheme;\n\n createTheme: () => void;\n hideAll: () => void;\n showAll: () => void;\n\n setTheme: (t: IThemeSpec) => void;\n\n incrementalAppendChild: (node: INode, highPerformance?: boolean) => INode | null;\n incrementalClearChild: () => void;\n\n createOrUpdateChild: <T extends keyof GraphicAttributeMap>(\n graphicName: string,\n attributes: GraphicAttributeMap[T],\n graphicType: T\n ) => INode;\n}\n"]}
@@ -3,6 +3,8 @@ export type IRepeatType = 'no-repeat' | 'repeat';
3
3
  export type IImageAttribute = {
4
4
  width: number;
5
5
  height: number;
6
+ maxWidth?: number;
7
+ maxHeight?: number;
6
8
  repeatX: IRepeatType;
7
9
  repeatY: IRepeatType;
8
10
  image: string | HTMLImageElement | HTMLCanvasElement;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/image.ts"],"names":[],"mappings":"","file":"image.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IRepeatType = 'no-repeat' | 'repeat';\n\nexport type IImageAttribute = {\n width: number;\n height: number;\n repeatX: IRepeatType;\n repeatY: IRepeatType;\n image: string | HTMLImageElement | HTMLCanvasElement;\n cornerRadius: number | number[];\n cornerType: 'round' | 'bevel';\n};\n\nexport type IImageGraphicAttribute = Partial<IGraphicAttribute> & Partial<IImageAttribute>;\n\nexport interface IImage extends IGraphic<IImageGraphicAttribute> {\n successCallback?: () => void;\n failCallback?: () => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/image.ts"],"names":[],"mappings":"","file":"image.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IRepeatType = 'no-repeat' | 'repeat';\n\nexport type IImageAttribute = {\n /**\n * 宽度\n */\n width: number;\n /**\n * 高度\n */\n height: number;\n /**\n * 最大宽度\n */\n maxWidth?: number;\n /**\n * 最大高度\n */\n maxHeight?: number;\n /**\n * x方向的重复方式\n */\n repeatX: IRepeatType;\n /**\n * y方向的重复方式\n */\n repeatY: IRepeatType;\n /**\n * 图像url或者内容\n */\n image: string | HTMLImageElement | HTMLCanvasElement;\n /**\n * 圆角半径\n */\n cornerRadius: number | number[];\n /**\n * 圆角类型,\n * 'round' - 圆弧\n * 'bevel' - 斜角\n */\n cornerType: 'round' | 'bevel';\n};\n\nexport type IImageGraphicAttribute = Partial<IGraphicAttribute> & Partial<IImageAttribute>;\n\nexport interface IImage extends IGraphic<IImageGraphicAttribute> {\n successCallback?: () => void;\n failCallback?: () => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/line.ts"],"names":[],"mappings":"","file":"line.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic, IConnectedStyle } from '../graphic';\nimport type { ICurveType } from '../common';\nimport type { ISegPath2D } from '../curve';\n\n// 依据x纬度做clipRange\n// 依据y纬度做clipRange\n// 依据线段自动匹配纬度做clipRange\n// 依据线长纬度做clipRange\nexport type IClipRangeByDimensionType = 'x' | 'y' | 'auto' | 'default';\n\nexport type ILineAttribute = {\n segments: ISegment[]; // 分段设置point和样式\n points: IPointLike[]; // segments points 二选一\n curveType: ICurveType;\n clipRange: number;\n clipRangeByDimension: IClipRangeByDimensionType;\n closePath: boolean; // 是否封闭路径\n curveTension: number;\n};\n\nexport type ILineGraphicAttribute = Partial<IGraphicAttribute> & Partial<ILineAttribute> & Partial<IConnectedStyle>;\n\nexport interface ILine extends IGraphic<ILineGraphicAttribute> {\n cache?: ISegPath2D | ISegPath2D[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'stroke' | 'strokeOpacity' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'lineWidth' | 'miterLimit'\n>;\n\nexport interface ISegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n simplify?: boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/line.ts"],"names":[],"mappings":"","file":"line.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic, IConnectedStyle } from '../graphic';\nimport type { ICurveType } from '../common';\nimport type { ISegPath2D } from '../curve';\n\n// 依据x纬度做clipRange\n// 依据y纬度做clipRange\n// 依据线段自动匹配纬度做clipRange\n// 依据线长纬度做clipRange\nexport type IClipRangeByDimensionType = 'x' | 'y' | 'auto' | 'default';\n\nexport type ILineAttribute = {\n /**\n * 分段设置point和样式\n */\n segments: ISegment[];\n /**\n * 所有点的坐标,segments 和 points 不能同时生效\n */\n points: IPointLike[];\n /**\n * 曲线的类型,默认为linear\n */\n curveType: ICurveType;\n /**\n * 线段的裁切比例/显示长度占总长度的比例\n */\n clipRange: number;\n /**\n * 裁剪的维度\n */\n clipRangeByDimension: IClipRangeByDimensionType;\n /**\n * 是否封闭路径\n */\n closePath: boolean;\n /**\n * 曲线类型为catmullRom时,对应的张力参数\n */\n curveTension: number;\n};\n\nexport type ILineGraphicAttribute = Partial<IGraphicAttribute> & Partial<ILineAttribute> & Partial<IConnectedStyle>;\n\nexport interface ILine extends IGraphic<ILineGraphicAttribute> {\n cache?: ISegPath2D | ISegPath2D[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'stroke' | 'strokeOpacity' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'lineWidth' | 'miterLimit'\n>;\n\nexport interface ISegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n simplify?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/polygon.ts"],"names":[],"mappings":"","file":"polygon.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IPolygonAttribute = {\n // ? 不需要x2/y2\n points: IPointLike[];\n cornerRadius?: number | number[];\n closePath?: boolean;\n};\n\nexport type IPolygonGraphicAttribute = Partial<IGraphicAttribute> & Partial<IPolygonAttribute>;\n\nexport type IPolygon = IGraphic<IPolygonGraphicAttribute>;\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/polygon.ts"],"names":[],"mappings":"","file":"polygon.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport type IPolygonAttribute = {\n /**\n * 多边形的顶点坐标\n */\n points: IPointLike[];\n /**\n * 圆角半径\n */\n cornerRadius?: number | number[];\n /**\n * 是否闭合多边形\n */\n closePath?: boolean;\n};\n\nexport type IPolygonGraphicAttribute = Partial<IGraphicAttribute> & Partial<IPolygonAttribute>;\n\nexport type IPolygon = IGraphic<IPolygonGraphicAttribute>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/rect.ts"],"names":[],"mappings":"","file":"rect.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\nexport type IRectAttribute = {\n width: number;\n height: number;\n x1: number;\n y1: number;\n cornerRadius: number | number[];\n cornerType: 'round' | 'bevel';\n};\n\nexport type IRectGraphicAttribute = Partial<IGraphicAttribute> & Partial<IRectAttribute>;\n\nexport interface IRect extends IGraphic<IRectGraphicAttribute> {\n cache?: ICustomPath2D;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/rect.ts"],"names":[],"mappings":"","file":"rect.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\nexport type IRectAttribute = {\n width: number;\n height: number;\n x1: number;\n y1: number;\n /**\n * 圆角半径\n */\n cornerRadius: number | number[];\n /**\n * 圆角类型,\n * 'round' - 圆弧\n * 'bevel' - 斜角\n */\n cornerType: 'round' | 'bevel';\n};\n\nexport type IRectGraphicAttribute = Partial<IGraphicAttribute> & Partial<IRectAttribute>;\n\nexport interface IRect extends IGraphic<IRectGraphicAttribute> {\n cache?: ICustomPath2D;\n}\n"]}
@@ -14,6 +14,10 @@ export type IRichTextEditOptionsType = {
14
14
  stopPropagation?: boolean;
15
15
  };
16
16
  export type IRichTextAttribute = {
17
+ upgradeAttrs: {
18
+ lineHeight: true;
19
+ multiBreakLine: true;
20
+ } | null;
17
21
  width: number;
18
22
  height: number;
19
23
  editable: boolean;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/richText.ts"],"names":[],"mappings":"","file":"richText.js","sourcesContent":["import type { IColor } from '../color';\nimport type { IContext2d } from '../context';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { IImage, IImageGraphicAttribute } from './image';\nimport type { ITextGraphicAttribute } from './text';\n\nexport type IRichTextEditOptionsType = {\n placeholder?: string;\n placeholderColor?: string;\n placeholderFontSize?: number;\n placeholderFontFamily?: string;\n // 是否将placeholder同步到textConfig中\n syncPlaceholderToTextConfig?: boolean;\n // 即使是空文本,是否也保持高度\n keepHeightWhileEmpty?: boolean;\n // 是否在输入的时候展示包围框,不传默认是false,可以传入颜色\n boundsStrokeWhenInput?: string;\n stopPropagation?: boolean;\n};\n\nexport type IRichTextAttribute = {\n /**\n * 富文本的总宽度\n */\n width: number;\n /**\n * 富文本的总高度\n */\n height: number;\n /**\n * 是否可编辑\n */\n editable: boolean;\n /**\n * 测量ascent和descent的模式,预览的时候actual比较合适,而如果需要编辑的话,font比较合适\n */\n ascentDescentMode?: 'actual' | 'font';\n /**\n * 富文本的编辑配置\n */\n editOptions: IRichTextEditOptionsType | null;\n /**\n * 文本超长的时候是否显示省略字符串\n * 1. boolean类型,true 表示将截断后的省略字符串设置为..., false 表示不显示省略字符串\n * 2. string类型,表示显示省略字符串,并将省略字符串设置为指定的值\n */\n ellipsis: boolean | string;\n /**\n * 文字换行类型\n */\n wordBreak: RichTextWordBreak;\n /**\n * 文字垂直方向\n */\n verticalDirection: RichTextVerticalDirection;\n /**\n * 富文本的最大高度,超过这个高度根据ellipsis的配置展示省略字符串或者直接截断\n */\n maxHeight: number;\n /**\n * 富文本的最大宽度,超过这个宽度根据ellipsis的配置展示省略字符串或者直接截断\n */\n maxWidth: number;\n /**\n * 文字对齐方式\n */\n textAlign: RichTextGlobalAlignType;\n /**\n * 文字基线\n */\n textBaseline: RichTextGlobalBaselineType;\n /**\n * 富文本的布局方向\n */\n layoutDirection: RichTextLayoutDirectionType;\n /**\n * 富文本的内容配置\n */\n textConfig: IRichTextCharacter[];\n /**\n * 不自动换行,仅当用户设置了换行符的时候才换行\n */\n disableAutoWrapLine: boolean;\n /**\n * 是否强制单行显示\n */\n singleLine: boolean;\n};\n\nexport type IRichTextGraphicAttribute = Partial<IGraphicAttribute & ITextGraphicAttribute> &\n Partial<IRichTextAttribute>;\n\nexport type RichTextWordBreak = 'break-word' | 'break-all';\nexport type RichTextVerticalDirection = 'top' | 'middle' | 'bottom';\nexport type RichTextGlobalAlignType = 'left' | 'right' | 'center';\nexport type RichTextGlobalBaselineType = 'top' | 'middle' | 'bottom';\nexport type RichTextLayoutDirectionType = 'horizontal' | 'vertical';\nexport type RichTextFontStyle = 'normal' | 'italic' | 'oblique';\nexport type RichTextTextDecoration = 'none' | 'underline' | 'line-through';\n// export type RichTextTextAlign = 'left' | 'right' | 'center';\nexport type RichTextScript = 'normal' | 'sub' | 'super';\n\nexport type IRichTextBasicCharacter = {\n /**\n * 行高\n */\n lineHeight?: number | string;\n /**\n * 文字对齐方式\n * left, right, center\n */\n textAlign?: CanvasTextAlign;\n /**\n * 文字基线\n */\n textBaseline?: CanvasTextBaseline;\n /**\n * 文字方向\n */\n direction?: RichTextLayoutDirectionType;\n};\n\n/**\n * 富文本段落为文本类型时候的配置\n */\nexport type IRichTextParagraphCharacter = IRichTextBasicCharacter & {\n /**\n * 文本内容\n */\n text: string | number;\n /**\n * 富文本片段的字体大小\n */\n fontSize?: number;\n /**\n * 富文本片段的字体类型\n */\n fontFamily?: string;\n /**\n * 富文本片段的文字颜色\n */\n fill?: IColor | boolean;\n /**\n * 富文本片段的文字描边颜色\n */\n stroke?: IColor | boolean;\n /**\n * 富文本片段的文字字重\n */\n fontWeight?: string;\n /**\n * 富文本片段的文字描边宽度\n */\n lineWidth?: number;\n // lineHeight?: number;\n /**\n * 富文本片段的文字斜体设置,支持以下属性\n * normal, italic, oblique\n */\n fontStyle?: RichTextFontStyle;\n /**\n * 富文本片段的文字中划线设置,支持以下属性\n * none, underline, line-through\n */\n textDecoration?: RichTextTextDecoration;\n // textAlign?: RichTextTextAlign; // left, right, center\n script?: RichTextScript; // normal, sub, super\n /**\n * 富文本片段的文字下划线设置,是否显示下划线\n */\n underline?: boolean;\n /**\n * 富文本片段的文字中划线设置,是否显示中划线\n */\n lineThrough?: boolean;\n /**\n * 富文本片段的透明度\n */\n opacity?: number;\n /**\n * 富文本片段的文字填充透明度\n */\n fillOpacity?: number;\n /**\n * 富文本片段的文字描边透明度\n */\n strokeOpacity?: number;\n // 仅支持纯色背景\n background?: string;\n // 背景透明度\n backgroundOpacity?: number;\n // direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextImageCharacter = IRichTextBasicCharacter & {\n /**\n * 设置图片的内容,\n * 支持三种格式:\n * 1. 图片的url\n * 2. 图片的Image对象\n * 3. 图片的Canvas对象\n */\n image: string | HTMLImageElement | HTMLCanvasElement;\n /**\n * 图片的宽度\n */\n width: number;\n /**\n * 图片的高度\n */\n height: number;\n\n // hover相关属性\n // backgroundShow?: boolean; // 是否显示background\n /**\n * 背景的展示模式,支持以下属性\n * always: 一直显示\n * hover: 鼠标hover时显示\n */\n backgroundShowMode?: 'always' | 'hover';\n /**\n * 背景矩形填充颜色\n */\n backgroundFill?: boolean | IColor;\n /**\n * 背景矩形填充透明度\n */\n backgroundFillOpacity?: number;\n /**\n * 背景矩形边框颜色\n */\n backgroundStroke?: boolean | IColor;\n /**\n * 背景矩形边框透明度\n */\n backgroundStrokeOpacity?: number;\n /**\n * 背景矩形圆角\n */\n backgroundRadius?: number;\n // background size 同时控制了该icon的响应范围\n /**\n * 背景矩形的宽度\n */\n backgroundWidth?: number;\n /**\n * 背景矩形的高度\n */\n backgroundHeight?: number;\n\n /**\n * 唯一标识符\n */\n id?: string;\n\n // lineHeight?: number;\n // textAlign?: RichTextTextAlign; // left, right, center\n // direction?: RichTextLayoutDirectionType;\n /**\n * 图片与相邻节点的间距\n */\n margin?: number | number[];\n\n funcType?: string;\n hoverImage?: string | HTMLImageElement | HTMLCanvasElement;\n};\n/**\n * 富文本的字符类型\n */\nexport type IRichTextCharacter = IRichTextParagraphCharacter | IRichTextImageCharacter;\n\nexport type IRichTextIconGraphicAttribute = IImageGraphicAttribute & {\n /**\n * 唯一id\n */\n id?: string;\n /**\n * 背景的展示模式,支持以下属性\n * always: 一直显示\n * hover: 鼠标hover时显示\n * never: 不显示\n */\n backgroundShowMode?: 'always' | 'hover' | 'never';\n /**\n * 背景矩形填充颜色\n */\n backgroundFill?: boolean | IColor;\n /**\n * 背景矩形填充透明度\n */\n backgroundFillOpacity?: number;\n /**\n * 背景矩形边框颜色\n */\n backgroundStroke?: boolean | IColor;\n /**\n * 背景矩形边框透明度\n */\n backgroundStrokeOpacity?: number;\n /**\n * 背景矩形圆角\n */\n backgroundRadius?: number;\n /**\n * 背景矩形的宽度\n */\n backgroundWidth?: number;\n /**\n * 背景矩形的高度\n */\n backgroundHeight?: number;\n\n // lineHeight?: number;\n /**\n * 文字对齐方式\n * left, right, center\n */\n textAlign?: CanvasTextAlign;\n /**\n * 文字基线\n * top, middle, bottom\n */\n textBaseline?: CanvasTextBaseline;\n /**\n * 文字方向\n * horizontal, vertical\n */\n direction?: RichTextLayoutDirectionType;\n /**\n * 图片与相邻节点的间距\n */\n margin?: number | number[];\n\n // backgroundShow?: boolean;\n};\n\nexport interface IRichTextParagraph {\n text: string;\n ascent: number;\n descent: number;\n width: number;\n height: number;\n lineHeight: number;\n fontSize: number;\n length: number;\n newLine: boolean;\n character: IRichTextParagraphCharacter;\n left: number;\n top: number;\n direction?: 'horizontal' | 'vertical';\n widthOrigin?: number;\n heightOrigin?: number;\n textBaseline?: CanvasTextBaseline;\n ellipsis: 'normal' | 'add' | 'replace' | 'hide';\n ellipsisWidth: number;\n ellipsisOtherParagraphWidth: number;\n verticalEllipsis?: boolean;\n updateWidth: () => void;\n draw: (ctx: IContext2d, baseline: number, deltaLeft: number, isLineFirst: boolean, textAlign: string) => void;\n getWidthWithEllips: (direction: string) => number;\n}\n\nexport interface IRichTextLine {\n left: number;\n top: number;\n width: number;\n height: number;\n baseline: number;\n ascent: number;\n descent: number;\n paragraphs: (IRichTextParagraph | IRichTextIcon)[];\n actualWidth: number;\n blankWidth: number;\n textAlign: string;\n direction: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n x: string;\n y: string;\n };\n draw: (\n ctx: IContext2d,\n lastLine: boolean,\n x: number,\n y: number,\n drawEllipsis: boolean | string,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => void;\n getWidthWithEllips: (ellipsis: string) => number;\n}\n\nexport interface IRichTextFrame {\n left: number;\n top: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n actualHeight: number;\n ellipsis: boolean | string;\n wordBreak: 'break-word' | 'break-all';\n verticalDirection: 'top' | 'middle' | 'bottom';\n lines: IRichTextLine[];\n globalAlign: 'left' | 'center' | 'right' | 'start' | 'end';\n globalBaseline: 'top' | 'middle' | 'bottom';\n layoutDirection: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n top: string;\n bottom: string;\n };\n isWidthMax: boolean;\n isHeightMax: boolean;\n singleLine: boolean;\n icons: Map<string, IRichTextIcon>;\n draw: (\n ctx: IContext2d,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => boolean;\n getActualSize: () => {\n width: number;\n height: number;\n };\n getRawActualSize: () => {\n width: number;\n height: number;\n };\n getActualSizeWidthEllipsis: () => {\n width: number;\n height: number;\n };\n}\n\nexport interface IRichText extends IGraphic<IRichTextGraphicAttribute> {\n getFrameCache: () => IRichTextFrame;\n cliped?: boolean;\n}\n\nexport interface IRichTextIcon extends IImage {\n attribute: IRichTextIconGraphicAttribute;\n richtextId?: string;\n globalX?: number;\n globalY?: number;\n\n _x: number;\n _y: number;\n _hovered: boolean;\n _marginArray: [number, number, number, number];\n\n setHoverState: (hovered: boolean) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/richText.ts"],"names":[],"mappings":"","file":"richText.js","sourcesContent":["import type { IColor } from '../color';\nimport type { IContext2d } from '../context';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { IImage, IImageGraphicAttribute } from './image';\nimport type { ITextGraphicAttribute } from './text';\n\nexport type IRichTextEditOptionsType = {\n placeholder?: string;\n placeholderColor?: string;\n placeholderFontSize?: number;\n placeholderFontFamily?: string;\n // 是否将placeholder同步到textConfig中\n syncPlaceholderToTextConfig?: boolean;\n // 即使是空文本,是否也保持高度\n keepHeightWhileEmpty?: boolean;\n // 是否在输入的时候展示包围框,不传默认是false,可以传入颜色\n boundsStrokeWhenInput?: string;\n stopPropagation?: boolean;\n};\n\nexport type IRichTextAttribute = {\n /**\n * @since 0.22.1\n * 升级后避免break change,通过开关来控制\n */\n upgradeAttrs: {\n lineHeight: true;\n multiBreakLine: true;\n } | null;\n /**\n * 富文本的总宽度\n */\n width: number;\n /**\n * 富文本的总高度\n */\n height: number;\n /**\n * 是否可编辑\n */\n editable: boolean;\n /**\n * 测量ascent和descent的模式,预览的时候actual比较合适,而如果需要编辑的话,font比较合适\n */\n ascentDescentMode?: 'actual' | 'font';\n /**\n * 富文本的编辑配置\n */\n editOptions: IRichTextEditOptionsType | null;\n /**\n * 文本超长的时候是否显示省略字符串\n * 1. boolean类型,true 表示将截断后的省略字符串设置为..., false 表示不显示省略字符串\n * 2. string类型,表示显示省略字符串,并将省略字符串设置为指定的值\n */\n ellipsis: boolean | string;\n /**\n * 文字换行类型\n */\n wordBreak: RichTextWordBreak;\n /**\n * 文字垂直方向\n */\n verticalDirection: RichTextVerticalDirection;\n /**\n * 富文本的最大高度,超过这个高度根据ellipsis的配置展示省略字符串或者直接截断\n */\n maxHeight: number;\n /**\n * 富文本的最大宽度,超过这个宽度根据ellipsis的配置展示省略字符串或者直接截断\n */\n maxWidth: number;\n /**\n * 文字对齐方式\n */\n textAlign: RichTextGlobalAlignType;\n /**\n * 文字基线\n */\n textBaseline: RichTextGlobalBaselineType;\n /**\n * 富文本的布局方向\n */\n layoutDirection: RichTextLayoutDirectionType;\n /**\n * 富文本的内容配置\n */\n textConfig: IRichTextCharacter[];\n /**\n * 不自动换行,仅当用户设置了换行符的时候才换行\n */\n disableAutoWrapLine: boolean;\n /**\n * 是否强制单行显示\n */\n singleLine: boolean;\n};\n\nexport type IRichTextGraphicAttribute = Partial<IGraphicAttribute & ITextGraphicAttribute> &\n Partial<IRichTextAttribute>;\n\nexport type RichTextWordBreak = 'break-word' | 'break-all';\nexport type RichTextVerticalDirection = 'top' | 'middle' | 'bottom';\nexport type RichTextGlobalAlignType = 'left' | 'right' | 'center';\nexport type RichTextGlobalBaselineType = 'top' | 'middle' | 'bottom';\nexport type RichTextLayoutDirectionType = 'horizontal' | 'vertical';\nexport type RichTextFontStyle = 'normal' | 'italic' | 'oblique';\nexport type RichTextTextDecoration = 'none' | 'underline' | 'line-through';\n// export type RichTextTextAlign = 'left' | 'right' | 'center';\nexport type RichTextScript = 'normal' | 'sub' | 'super';\n\nexport type IRichTextBasicCharacter = {\n /**\n * 行高\n */\n lineHeight?: number | string;\n /**\n * 文字对齐方式\n * left, right, center\n */\n textAlign?: CanvasTextAlign;\n /**\n * 文字基线\n */\n textBaseline?: CanvasTextBaseline;\n /**\n * 文字方向\n */\n direction?: RichTextLayoutDirectionType;\n};\n\n/**\n * 富文本段落为文本类型时候的配置\n */\nexport type IRichTextParagraphCharacter = IRichTextBasicCharacter & {\n /**\n * 文本内容\n */\n text: string | number;\n /**\n * 富文本片段的字体大小\n */\n fontSize?: number;\n /**\n * 富文本片段的字体类型\n */\n fontFamily?: string;\n /**\n * 富文本片段的文字颜色\n */\n fill?: IColor | boolean;\n /**\n * 富文本片段的文字描边颜色\n */\n stroke?: IColor | boolean;\n /**\n * 富文本片段的文字字重\n */\n fontWeight?: string;\n /**\n * 富文本片段的文字描边宽度\n */\n lineWidth?: number;\n // lineHeight?: number;\n /**\n * 富文本片段的文字斜体设置,支持以下属性\n * normal, italic, oblique\n */\n fontStyle?: RichTextFontStyle;\n /**\n * 富文本片段的文字中划线设置,支持以下属性\n * none, underline, line-through\n */\n textDecoration?: RichTextTextDecoration;\n // textAlign?: RichTextTextAlign; // left, right, center\n script?: RichTextScript; // normal, sub, super\n /**\n * 富文本片段的文字下划线设置,是否显示下划线\n */\n underline?: boolean;\n /**\n * 富文本片段的文字中划线设置,是否显示中划线\n */\n lineThrough?: boolean;\n /**\n * 富文本片段的透明度\n */\n opacity?: number;\n /**\n * 富文本片段的文字填充透明度\n */\n fillOpacity?: number;\n /**\n * 富文本片段的文字描边透明度\n */\n strokeOpacity?: number;\n // 仅支持纯色背景\n background?: string;\n // 背景透明度\n backgroundOpacity?: number;\n // direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextImageCharacter = IRichTextBasicCharacter & {\n /**\n * 设置图片的内容,\n * 支持三种格式:\n * 1. 图片的url\n * 2. 图片的Image对象\n * 3. 图片的Canvas对象\n */\n image: string | HTMLImageElement | HTMLCanvasElement;\n /**\n * 图片的宽度\n */\n width: number;\n /**\n * 图片的高度\n */\n height: number;\n\n // hover相关属性\n // backgroundShow?: boolean; // 是否显示background\n /**\n * 背景的展示模式,支持以下属性\n * always: 一直显示\n * hover: 鼠标hover时显示\n */\n backgroundShowMode?: 'always' | 'hover';\n /**\n * 背景矩形填充颜色\n */\n backgroundFill?: boolean | IColor;\n /**\n * 背景矩形填充透明度\n */\n backgroundFillOpacity?: number;\n /**\n * 背景矩形边框颜色\n */\n backgroundStroke?: boolean | IColor;\n /**\n * 背景矩形边框透明度\n */\n backgroundStrokeOpacity?: number;\n /**\n * 背景矩形圆角\n */\n backgroundRadius?: number;\n // background size 同时控制了该icon的响应范围\n /**\n * 背景矩形的宽度\n */\n backgroundWidth?: number;\n /**\n * 背景矩形的高度\n */\n backgroundHeight?: number;\n\n /**\n * 唯一标识符\n */\n id?: string;\n\n // lineHeight?: number;\n // textAlign?: RichTextTextAlign; // left, right, center\n // direction?: RichTextLayoutDirectionType;\n /**\n * 图片与相邻节点的间距\n */\n margin?: number | number[];\n\n funcType?: string;\n hoverImage?: string | HTMLImageElement | HTMLCanvasElement;\n};\n/**\n * 富文本的字符类型\n */\nexport type IRichTextCharacter = IRichTextParagraphCharacter | IRichTextImageCharacter;\n\nexport type IRichTextIconGraphicAttribute = IImageGraphicAttribute & {\n /**\n * 唯一id\n */\n id?: string;\n /**\n * 背景的展示模式,支持以下属性\n * always: 一直显示\n * hover: 鼠标hover时显示\n * never: 不显示\n */\n backgroundShowMode?: 'always' | 'hover' | 'never';\n /**\n * 背景矩形填充颜色\n */\n backgroundFill?: boolean | IColor;\n /**\n * 背景矩形填充透明度\n */\n backgroundFillOpacity?: number;\n /**\n * 背景矩形边框颜色\n */\n backgroundStroke?: boolean | IColor;\n /**\n * 背景矩形边框透明度\n */\n backgroundStrokeOpacity?: number;\n /**\n * 背景矩形圆角\n */\n backgroundRadius?: number;\n /**\n * 背景矩形的宽度\n */\n backgroundWidth?: number;\n /**\n * 背景矩形的高度\n */\n backgroundHeight?: number;\n\n // lineHeight?: number;\n /**\n * 文字对齐方式\n * left, right, center\n */\n textAlign?: CanvasTextAlign;\n /**\n * 文字基线\n * top, middle, bottom\n */\n textBaseline?: CanvasTextBaseline;\n /**\n * 文字方向\n * horizontal, vertical\n */\n direction?: RichTextLayoutDirectionType;\n /**\n * 图片与相邻节点的间距\n */\n margin?: number | number[];\n\n // backgroundShow?: boolean;\n};\n\nexport interface IRichTextParagraph {\n text: string;\n ascent: number;\n descent: number;\n width: number;\n height: number;\n lineHeight: number;\n fontSize: number;\n length: number;\n newLine: boolean;\n character: IRichTextParagraphCharacter;\n left: number;\n top: number;\n direction?: 'horizontal' | 'vertical';\n widthOrigin?: number;\n heightOrigin?: number;\n textBaseline?: CanvasTextBaseline;\n ellipsis: 'normal' | 'add' | 'replace' | 'hide';\n ellipsisWidth: number;\n ellipsisOtherParagraphWidth: number;\n verticalEllipsis?: boolean;\n updateWidth: () => void;\n draw: (ctx: IContext2d, baseline: number, deltaLeft: number, isLineFirst: boolean, textAlign: string) => void;\n getWidthWithEllips: (direction: string) => number;\n}\n\nexport interface IRichTextLine {\n left: number;\n top: number;\n width: number;\n height: number;\n baseline: number;\n ascent: number;\n descent: number;\n paragraphs: (IRichTextParagraph | IRichTextIcon)[];\n actualWidth: number;\n blankWidth: number;\n textAlign: string;\n direction: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n x: string;\n y: string;\n };\n draw: (\n ctx: IContext2d,\n lastLine: boolean,\n x: number,\n y: number,\n drawEllipsis: boolean | string,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => void;\n getWidthWithEllips: (ellipsis: string) => number;\n}\n\nexport interface IRichTextFrame {\n left: number;\n top: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n actualHeight: number;\n ellipsis: boolean | string;\n wordBreak: 'break-word' | 'break-all';\n verticalDirection: 'top' | 'middle' | 'bottom';\n lines: IRichTextLine[];\n globalAlign: 'left' | 'center' | 'right' | 'start' | 'end';\n globalBaseline: 'top' | 'middle' | 'bottom';\n layoutDirection: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n top: string;\n bottom: string;\n };\n isWidthMax: boolean;\n isHeightMax: boolean;\n singleLine: boolean;\n icons: Map<string, IRichTextIcon>;\n draw: (\n ctx: IContext2d,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => boolean;\n getActualSize: () => {\n width: number;\n height: number;\n };\n getRawActualSize: () => {\n width: number;\n height: number;\n };\n getActualSizeWidthEllipsis: () => {\n width: number;\n height: number;\n };\n}\n\nexport interface IRichText extends IGraphic<IRichTextGraphicAttribute> {\n getFrameCache: () => IRichTextFrame;\n cliped?: boolean;\n}\n\nexport interface IRichTextIcon extends IImage {\n attribute: IRichTextIconGraphicAttribute;\n richtextId?: string;\n globalX?: number;\n globalY?: number;\n\n _x: number;\n _y: number;\n _hovered: boolean;\n _marginArray: [number, number, number, number];\n\n setHoverState: (hovered: boolean) => void;\n}\n"]}
@@ -9,6 +9,7 @@ export type ISymbolAttribute = {
9
9
  export type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymbolAttribute>;
10
10
  export interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {
11
11
  getParsedPath: () => ISymbolClass;
12
+ getParsedPath2D: (x?: number, y?: number, size?: number) => Path2D | null;
12
13
  }
13
14
  export type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'arrow' | 'arrowLeft' | 'arrowRight' | 'arrow2Left' | 'arrow2Right' | 'wedge' | 'thinTriangle' | 'triangle' | 'triangleUp' | 'triangleDown' | 'triangleRight' | 'triangleLeft' | 'stroke' | 'star' | 'wye' | 'rect' | 'rectRound' | 'roundLine' | string;
14
15
  export interface ISymbolClass {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/symbol.ts"],"names":[],"mappings":"","file":"symbol.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D, IPath2D } from '../path';\n\nexport type ISymbolAttribute = {\n symbolType: SymbolType;\n size: number | [number, number];\n clipRange: number;\n};\n\nexport type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymbolAttribute>;\n\nexport interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {\n getParsedPath: () => ISymbolClass;\n}\n\nexport type SymbolType =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'arrow'\n | 'arrowLeft'\n | 'arrowRight'\n | 'arrow2Left'\n | 'arrow2Right'\n | 'wedge'\n | 'thinTriangle'\n | 'triangle'\n | 'triangleUp'\n | 'triangleDown'\n | 'triangleRight'\n | 'triangleLeft'\n | 'stroke'\n | 'star'\n | 'wye'\n | 'rect'\n | 'rectRound'\n | 'roundLine'\n | string;\n\nexport interface ISymbolClass {\n type: SymbolType | string;\n path?: ICustomPath2D;\n pathStr: string;\n isSvg?: boolean;\n\n // 返回true表示内部已经调用closePath,返回false表示没有调用closePath,外部需要调用closePath\n draw: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawWithClipRange?: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawOffset: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n\n drawToSvgPath?: (size: number | [number, number], x: number, y: number, z?: number) => string;\n\n bounds: (size: number | [number, number], bounds: IBounds) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/symbol.ts"],"names":[],"mappings":"","file":"symbol.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D, IPath2D } from '../path';\n\nexport type ISymbolAttribute = {\n symbolType: SymbolType;\n size: number | [number, number];\n clipRange: number;\n};\n\nexport type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymbolAttribute>;\n\nexport interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {\n getParsedPath: () => ISymbolClass;\n getParsedPath2D: (x?: number, y?: number, size?: number) => Path2D | null;\n}\n\nexport type SymbolType =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'arrow'\n | 'arrowLeft'\n | 'arrowRight'\n | 'arrow2Left'\n | 'arrow2Right'\n | 'wedge'\n | 'thinTriangle'\n | 'triangle'\n | 'triangleUp'\n | 'triangleDown'\n | 'triangleRight'\n | 'triangleLeft'\n | 'stroke'\n | 'star'\n | 'wye'\n | 'rect'\n | 'rectRound'\n | 'roundLine'\n | string;\n\nexport interface ISymbolClass {\n type: SymbolType | string;\n path?: ICustomPath2D;\n pathStr: string;\n isSvg?: boolean;\n\n // 返回true表示内部已经调用closePath,返回false表示没有调用closePath,外部需要调用closePath\n draw: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawWithClipRange?: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n clipRange: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawOffset: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n\n drawToSvgPath?: (size: number | [number, number], x: number, y: number, z?: number) => string;\n\n bounds: (size: number | [number, number], bounds: IBounds) => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/text.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,6DAAY,CAAA;IACZ,yEAAkB,CAAA;IAClB,qEAAgB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B","file":"text.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport interface TextLayoutBBox {\n width: number; // 包围盒的宽度\n height: number; // 包围盒的高度\n xOffset: number;\n yOffset: number;\n}\n\nexport interface LayoutItemType {\n str: string; // 这行的字符串\n leftOffset?: number; // 该行距离左侧的偏移\n topOffset?: number; // 该行距离右侧的偏移\n width: number;\n ascent: number;\n descent: number;\n keepCenterInLine: boolean;\n}\n\nexport interface SimplifyLayoutType {\n lines: LayoutItemType[];\n}\n\nexport interface LayoutType {\n bbox: TextLayoutBBox;\n lines: LayoutItemType[];\n fontFamily: string;\n fontSize: number;\n fontWeight?: string | number;\n lineHeight: number;\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n}\n\nexport enum MeasureModeEnum {\n estimate = 0,\n actualBounding = 1,\n fontBounding = 2\n}\n\nexport type ITextAttribute = {\n text: string | number | string[] | number[];\n maxLineWidth: number;\n maxWidth: number;\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n fontSize: number;\n fontFamily: string;\n fontWeight: string | number;\n ellipsis: boolean | string;\n fontVariant: string;\n fontStyle: string;\n lineHeight: number | string;\n underline: number;\n lineThrough: number;\n scaleIn3d: boolean;\n direction: 'horizontal' | 'vertical';\n verticalMode: number; // 垂直布局的模式,0代表默认(横向textAlign,纵向textBaseline),1代表特殊(横向textBaseline,纵向textAlign)\n wordBreak: 'break-word' | 'break-all' | 'keep-all';\n ignoreBuf: boolean;\n heightLimit: number;\n lineClamp: number;\n wrap: boolean;\n whiteSpace: 'normal' | 'no-wrap';\n suffixPosition: 'start' | 'end' | 'middle';\n underlineDash: number[];\n underlineOffset: number;\n // textDecoration: number;\n // textDecorationWidth: number;\n // padding?: number | number[];\n disableAutoClipedPoptip?: boolean;\n // @since 0.21.0\n // 测量模式,默认使用actualBounding\n measureMode?: MeasureModeEnum;\n // @since 0.21.0\n // 保持在行中间的位置\n keepCenterInLine?: boolean;\n};\nexport type ITextCache = {\n // 单行文本的时候缓存(多行文本没有)\n clipedText?: string;\n clipedWidth?: number;\n // 文本的布局缓存(单行文本也有)\n layoutData?: LayoutType;\n // 垂直布局的列表\n verticalList?: { text: string; width?: number; direction: number }[][];\n};\n\nexport type ITextGraphicAttribute = Partial<IGraphicAttribute> & Partial<ITextAttribute>;\n\nexport type IWrapTextGraphicAttribute = ITextGraphicAttribute & {\n heightLimit?: number;\n lineClamp?: number;\n};\n\nexport interface IText extends IGraphic<ITextGraphicAttribute> {\n // 判断是否被ellipisised\n clipedText?: string;\n clipedWidth?: number;\n cliped?: boolean;\n multilineLayout?: LayoutType;\n font?: string;\n isMultiLine: boolean;\n cache?: ITextCache;\n\n getBaselineMapAlign: () => Record<string, string>;\n getAlignMapBaseline: () => Record<string, string>;\n}\n\nexport type TextAlignType = 'left' | 'right' | 'center' | 'start' | 'end';\nexport type TextBaselineType = 'top' | 'middle' | 'bottom' | 'alphabetic';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/text.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,6DAAY,CAAA;IACZ,yEAAkB,CAAA;IAClB,qEAAgB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B","file":"text.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\n\nexport interface TextLayoutBBox {\n width: number; // 包围盒的宽度\n height: number; // 包围盒的高度\n xOffset: number;\n yOffset: number;\n}\n\nexport interface LayoutItemType {\n str: string; // 这行的字符串\n leftOffset?: number; // 该行距离左侧的偏移\n topOffset?: number; // 该行距离右侧的偏移\n width: number;\n ascent: number;\n descent: number;\n keepCenterInLine: boolean;\n}\n\nexport interface SimplifyLayoutType {\n lines: LayoutItemType[];\n}\n\nexport interface LayoutType {\n bbox: TextLayoutBBox;\n lines: LayoutItemType[];\n fontFamily: string;\n fontSize: number;\n fontWeight?: string | number;\n lineHeight: number;\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n}\n\nexport enum MeasureModeEnum {\n estimate = 0,\n actualBounding = 1,\n fontBounding = 2\n}\n\nexport type ITextAttribute = {\n /**\n * 文字内容\n */\n text: string | number | string[] | number[];\n /**\n * 单行的的最大长度,当超出这个长度,可以展示省略符或者换行、截断等\n * 后续可能去除\n */\n maxLineWidth: number;\n /**\n * 单行的的最大长度,当超出这个长度,可以展示省略符或者换行、截断等\n * 同 maxLineWidth\n */\n maxWidth: number;\n /**\n * 文字对齐方式\n */\n textAlign: TextAlignType;\n /**\n * 文字竖直方向的对齐方式\n */\n textBaseline: TextBaselineType;\n /**\n * 字号\n */\n fontSize: number;\n /**\n * 字体\n */\n fontFamily: string;\n /**\n * 字重\n */\n fontWeight: string | number;\n /**\n * 文字超出后的省略符\n */\n ellipsis: boolean | string;\n /**\n * 控制文本的小型大写字母(small-caps)显示\n */\n fontVariant: string;\n /**\n * 字体样式,是否为斜体等\n */\n fontStyle: string;\n /**\n * 行高(字符串类型表示比例值,如\"150%\")\n */\n lineHeight: number | string;\n /**\n * 是否显示下划线\n */\n underline: number;\n /**\n * 是否显示中划线\n */\n lineThrough: number;\n /**\n * 在3d场景下是否根据z坐标缩放\n */\n scaleIn3d: boolean;\n /**\n * 文本的排布方向,如果需要文本纵向排布,可以配置为 'vertical'\n */\n direction: 'horizontal' | 'vertical';\n /**\n * 垂直布局的模式,0代表默认(横向textAlign,纵向textBaseline),1代表特殊(横向textBaseline,纵向textAlign)\n */\n verticalMode: number;\n /*\n * 单词断行\n */\n wordBreak: 'break-word' | 'break-all' | 'keep-all';\n /**\n * 内部配置,是否忽略一些bounds的buffer\n */\n ignoreBuf: boolean;\n /**\n * 高度限制控制显示内容及省略号\n */\n heightLimit: number;\n /**\n * 按照行数限制显示内容及省略号\n */\n lineClamp: number;\n /**\n * 同 whiteSpace: 'normal'\n * 后续可能删除\n */\n wrap: boolean;\n /**\n * 设置如何处理空白字符\n */\n whiteSpace: 'normal' | 'no-wrap';\n /**\n * 省略号的位置,默认为'end'\n */\n suffixPosition: 'start' | 'end' | 'middle';\n /**\n * 下划线的虚线样式\n */\n underlineDash: number[];\n /**\n * 下划线的虚线偏移量\n */\n underlineOffset: number;\n /**\n * 关闭poptip\n */\n disableAutoClipedPoptip?: boolean;\n /**\n * @since 0.21.0\n * 测量模式,默认使用actualBounding\n */\n measureMode?: MeasureModeEnum;\n\n /**\n * @since 0.21.0\n * 保持在行中间的位置\n */\n keepCenterInLine?: boolean;\n};\nexport type ITextCache = {\n // 单行文本的时候缓存(多行文本没有)\n clipedText?: string;\n clipedWidth?: number;\n // 文本的布局缓存(单行文本也有)\n layoutData?: LayoutType;\n // 垂直布局的列表\n verticalList?: { text: string; width?: number; direction: number }[][];\n};\n\nexport type ITextGraphicAttribute = Partial<IGraphicAttribute> & Partial<ITextAttribute>;\n\nexport type IWrapTextGraphicAttribute = ITextGraphicAttribute & {\n heightLimit?: number;\n lineClamp?: number;\n};\n\nexport interface IText extends IGraphic<ITextGraphicAttribute> {\n // 判断是否被ellipisised\n clipedText?: string;\n clipedWidth?: number;\n cliped?: boolean;\n multilineLayout?: LayoutType;\n font?: string;\n isMultiLine: boolean;\n cache?: ITextCache;\n\n getBaselineMapAlign: () => Record<string, string>;\n getAlignMapBaseline: () => Record<string, string>;\n}\n\nexport type TextAlignType = 'left' | 'right' | 'center' | 'start' | 'end';\nexport type TextBaselineType = 'top' | 'middle' | 'bottom' | 'alphabetic';\n"]}
@@ -11,6 +11,7 @@ import type { IGlyphGraphicAttribute } from './graphic/glyph';
11
11
  import type { IContainPointMode } from '../common/enums';
12
12
  import type { IFace3d } from './graphic/face3d';
13
13
  import type { IPickerService } from './picker';
14
+ import type { ISymbolClass } from './graphic/symbol';
14
15
  type IStrokeSeg = {
15
16
  start: number;
16
17
  end: number;
@@ -181,6 +182,9 @@ export type IGraphicAttribute = IDebugType & IGraphicStyle & ITransform & {
181
182
  overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';
182
183
  fillStrokeOrder: number;
183
184
  keepStrokeScale: boolean;
185
+ clipConfig: {
186
+ shape: string;
187
+ } | null;
184
188
  };
185
189
  export interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {
186
190
  attribute: Partial<T>;
@@ -260,6 +264,7 @@ export interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphi
260
264
  containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;
261
265
  setMode: (mode: '3d' | '2d') => void;
262
266
  isValid: () => boolean;
267
+ getClipPath: () => ISymbolClass | null;
263
268
  translate: (x: number, y: number) => this;
264
269
  translateTo: (x: number, y: number) => this;
265
270
  scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;