@visactor/vchart 1.12.15 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +2381 -1727
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/utils.js +8 -6
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +3 -0
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/index.d.ts +5 -3
- package/cjs/chart/index.js +16 -2
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +1 -0
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/interface/type.d.ts +2 -1
- package/cjs/chart/interface/type.js +1 -1
- package/cjs/chart/interface/type.js.map +1 -1
- package/cjs/chart/pictogram/index.d.ts +3 -0
- package/cjs/{plugin/components/tooltip-handler/canvas → chart/pictogram}/index.js +2 -1
- package/cjs/chart/pictogram/index.js.map +1 -0
- package/cjs/chart/pictogram/interface.d.ts +6 -0
- package/cjs/chart/pictogram/interface.js.map +1 -0
- package/cjs/chart/pictogram/pictogram-transformer.d.ts +8 -0
- package/cjs/chart/pictogram/pictogram-transformer.js +38 -0
- package/cjs/chart/pictogram/pictogram-transformer.js.map +1 -0
- package/cjs/chart/pictogram/pictogram.d.ts +12 -0
- package/cjs/chart/pictogram/pictogram.js +24 -0
- package/cjs/chart/pictogram/pictogram.js.map +1 -0
- package/cjs/chart/sankey/sankey-transformer.js +2 -1
- package/cjs/chart/sankey/sankey-transformer.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +3 -2
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.js +1 -1
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.js +7 -1
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.js +6 -6
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +2 -2
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/utils/get-value.js +3 -1
- package/cjs/component/tooltip/utils/get-value.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +4 -1
- package/cjs/core/vchart.js +21 -7
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/transforms/pictogram.d.ts +84 -0
- package/cjs/data/transforms/pictogram.js +149 -0
- package/cjs/data/transforms/pictogram.js.map +1 -0
- package/cjs/mark/group.d.ts +3 -2
- package/cjs/mark/group.js +12 -2
- package/cjs/mark/group.js.map +1 -1
- package/cjs/mark/interface/type.d.ts +2 -1
- package/cjs/mark/interface/type.js +2 -1
- package/cjs/mark/interface/type.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/base.d.ts +4 -6
- package/cjs/plugin/components/tooltip-handler/base.js +3 -20
- package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.d.ts → canvas-tooltip-handler.d.ts} +8 -3
- package/cjs/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.js → canvas-tooltip-handler.js} +15 -2
- package/cjs/plugin/components/tooltip-handler/canvas-tooltip-handler.js.map +1 -0
- package/cjs/plugin/components/tooltip-handler/constants.d.ts +7 -8
- package/cjs/plugin/components/tooltip-handler/constants.js +6 -9
- package/cjs/plugin/components/tooltip-handler/constants.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/{dom/dom-tooltip-handler.d.ts → dom-tooltip-handler.d.ts} +20 -9
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +187 -0
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -0
- package/cjs/plugin/components/tooltip-handler/index.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/index.js +1 -1
- package/cjs/plugin/components/tooltip-handler/index.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/interface/index.d.ts +15 -2
- package/cjs/plugin/components/tooltip-handler/interface/index.js +1 -16
- package/cjs/plugin/components/tooltip-handler/interface/index.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/attribute.d.ts +9 -2
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js +36 -18
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/common.d.ts +1 -12
- package/cjs/plugin/components/tooltip-handler/utils/common.js +7 -35
- package/cjs/plugin/components/tooltip-handler/utils/common.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/style.d.ts +18 -0
- package/cjs/plugin/components/tooltip-handler/utils/style.js +94 -0
- package/cjs/plugin/components/tooltip-handler/utils/style.js.map +1 -0
- package/cjs/plugin/components/tooltip-handler/utils/svg.d.ts +2 -0
- package/cjs/plugin/components/tooltip-handler/utils/svg.js +48 -0
- package/cjs/plugin/components/tooltip-handler/utils/svg.js.map +1 -0
- package/cjs/series/base/base-series.d.ts +22 -6
- package/cjs/series/base/base-series.js +33 -24
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/interface/type.d.ts +4 -2
- package/cjs/series/interface/type.js +4 -2
- package/cjs/series/interface/type.js.map +1 -1
- package/cjs/series/pictogram/constant.d.ts +2 -0
- package/cjs/series/pictogram/constant.js +15 -0
- package/cjs/series/pictogram/constant.js.map +1 -0
- package/cjs/series/pictogram/interface.d.ts +15 -0
- package/cjs/series/pictogram/interface.js.map +1 -0
- package/cjs/series/pictogram/pictogram-transformer.d.ts +5 -0
- package/cjs/series/pictogram/pictogram-transformer.js +23 -0
- package/cjs/series/pictogram/pictogram-transformer.js.map +1 -0
- package/cjs/series/pictogram/pictogram.d.ts +77 -0
- package/cjs/series/pictogram/pictogram.js +303 -0
- package/cjs/series/pictogram/pictogram.js.map +1 -0
- package/cjs/series/pictogram/svg-source.d.ts +7 -0
- package/cjs/series/pictogram/svg-source.js +38 -0
- package/cjs/series/pictogram/svg-source.js.map +1 -0
- package/cjs/series/pictogram/tooltip-helper.d.ts +9 -0
- package/cjs/series/pictogram/tooltip-helper.js +26 -0
- package/cjs/series/pictogram/tooltip-helper.js.map +1 -0
- package/cjs/series/sankey/interface.d.ts +1 -0
- package/cjs/series/sankey/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.js +4 -0
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +1 -0
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/tooltip/common.d.ts +3 -1
- package/cjs/typings/tooltip/common.js.map +1 -1
- package/esm/animation/utils.js +8 -6
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +3 -0
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/index.d.ts +5 -3
- package/esm/chart/index.js +4 -2
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +1 -0
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/interface/type.d.ts +2 -1
- package/esm/chart/interface/type.js +1 -1
- package/esm/chart/interface/type.js.map +1 -1
- package/esm/chart/pictogram/index.d.ts +3 -0
- package/esm/chart/pictogram/index.js +6 -0
- package/esm/chart/pictogram/index.js.map +1 -0
- package/esm/chart/pictogram/interface.d.ts +6 -0
- package/esm/chart/pictogram/interface.js.map +1 -0
- package/esm/chart/pictogram/pictogram-transformer.d.ts +8 -0
- package/esm/chart/pictogram/pictogram-transformer.js +32 -0
- package/esm/chart/pictogram/pictogram-transformer.js.map +1 -0
- package/esm/chart/pictogram/pictogram.d.ts +12 -0
- package/esm/chart/pictogram/pictogram.js +24 -0
- package/esm/chart/pictogram/pictogram.js.map +1 -0
- package/esm/chart/sankey/sankey-transformer.js +2 -1
- package/esm/chart/sankey/sankey-transformer.js.map +1 -1
- package/esm/chart/sankey/sankey.js +3 -1
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/compile/mark/compilable-mark.js +1 -1
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.js +7 -1
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/geo/geo-coordinate.js +6 -6
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +2 -2
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/component/tooltip/utils/get-value.js +3 -2
- package/esm/component/tooltip/utils/get-value.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +4 -1
- package/esm/core/vchart.js +23 -6
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/transforms/pictogram.d.ts +84 -0
- package/esm/data/transforms/pictogram.js +145 -0
- package/esm/data/transforms/pictogram.js.map +1 -0
- package/esm/mark/group.d.ts +3 -2
- package/esm/mark/group.js +12 -2
- package/esm/mark/group.js.map +1 -1
- package/esm/mark/interface/type.d.ts +2 -1
- package/esm/mark/interface/type.js +2 -1
- package/esm/mark/interface/type.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/base.d.ts +4 -6
- package/esm/plugin/components/tooltip-handler/base.js +3 -22
- package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.d.ts → canvas-tooltip-handler.d.ts} +8 -3
- package/esm/plugin/components/tooltip-handler/{canvas/canvas-tooltip-handler.js → canvas-tooltip-handler.js} +19 -5
- package/esm/plugin/components/tooltip-handler/canvas-tooltip-handler.js.map +1 -0
- package/esm/plugin/components/tooltip-handler/constants.d.ts +7 -8
- package/esm/plugin/components/tooltip-handler/constants.js +9 -4
- package/esm/plugin/components/tooltip-handler/constants.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/{dom/dom-tooltip-handler.d.ts → dom-tooltip-handler.d.ts} +20 -9
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +191 -0
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -0
- package/esm/plugin/components/tooltip-handler/index.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/index.js +2 -2
- package/esm/plugin/components/tooltip-handler/index.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/interface/index.d.ts +15 -2
- package/esm/plugin/components/tooltip-handler/interface/index.js +1 -3
- package/esm/plugin/components/tooltip-handler/interface/index.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/attribute.d.ts +9 -2
- package/esm/plugin/components/tooltip-handler/utils/attribute.js +31 -11
- package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/common.d.ts +1 -12
- package/esm/plugin/components/tooltip-handler/utils/common.js +3 -31
- package/esm/plugin/components/tooltip-handler/utils/common.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/style.d.ts +18 -0
- package/esm/plugin/components/tooltip-handler/utils/style.js +80 -0
- package/esm/plugin/components/tooltip-handler/utils/style.js.map +1 -0
- package/esm/plugin/components/tooltip-handler/utils/svg.d.ts +2 -0
- package/esm/plugin/components/tooltip-handler/utils/svg.js +42 -0
- package/esm/plugin/components/tooltip-handler/utils/svg.js.map +1 -0
- package/esm/series/base/base-series.d.ts +22 -6
- package/esm/series/base/base-series.js +33 -23
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/interface/type.d.ts +4 -2
- package/esm/series/interface/type.js +4 -2
- package/esm/series/interface/type.js.map +1 -1
- package/esm/series/pictogram/constant.d.ts +2 -0
- package/esm/series/pictogram/constant.js +9 -0
- package/esm/series/pictogram/constant.js.map +1 -0
- package/esm/series/pictogram/interface.d.ts +15 -0
- package/esm/series/pictogram/interface.js.map +1 -0
- package/esm/series/pictogram/pictogram-transformer.d.ts +5 -0
- package/esm/series/pictogram/pictogram-transformer.js +19 -0
- package/esm/series/pictogram/pictogram-transformer.js.map +1 -0
- package/esm/series/pictogram/pictogram.d.ts +77 -0
- package/esm/series/pictogram/pictogram.js +329 -0
- package/esm/series/pictogram/pictogram.js.map +1 -0
- package/esm/series/pictogram/svg-source.d.ts +7 -0
- package/esm/series/pictogram/svg-source.js +35 -0
- package/esm/series/pictogram/svg-source.js.map +1 -0
- package/esm/series/pictogram/tooltip-helper.d.ts +9 -0
- package/esm/series/pictogram/tooltip-helper.js +18 -0
- package/esm/series/pictogram/tooltip-helper.js.map +1 -0
- package/esm/series/sankey/interface.d.ts +1 -0
- package/esm/series/sankey/interface.js.map +1 -1
- package/esm/series/sankey/sankey.js +4 -0
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/typings/spec/common.d.ts +1 -0
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/tooltip/common.d.ts +3 -1
- package/esm/typings/tooltip/common.js.map +1 -1
- package/package.json +15 -15
- package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/canvas/index.d.ts +0 -1
- package/cjs/plugin/components/tooltip-handler/canvas/index.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/constant.d.ts +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/constant.js +0 -6
- package/cjs/plugin/components/tooltip-handler/dom/constant.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +0 -98
- package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/index.d.ts +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/index.js +0 -21
- package/cjs/plugin/components/tooltip-handler/dom/index.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/interface.d.ts +0 -58
- package/cjs/plugin/components/tooltip-handler/dom/interface.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +0 -25
- package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js +0 -73
- package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +0 -23
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +0 -126
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.d.ts +0 -14
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js +0 -54
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/interface.d.ts +0 -10
- package/cjs/plugin/components/tooltip-handler/dom/model/interface.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.d.ts +0 -23
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +0 -69
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.d.ts +0 -7
- package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js +0 -34
- package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/text-model.d.ts +0 -5
- package/cjs/plugin/components/tooltip-handler/dom/model/text-model.js +0 -21
- package/cjs/plugin/components/tooltip-handler/dom/model/text-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/title-model.d.ts +0 -15
- package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js +0 -66
- package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.d.ts +0 -21
- package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js +0 -79
- package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/common.d.ts +0 -3
- package/cjs/plugin/components/tooltip-handler/dom/utils/common.js +0 -33
- package/cjs/plugin/components/tooltip-handler/dom/utils/common.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/index.d.ts +0 -2
- package/cjs/plugin/components/tooltip-handler/dom/utils/index.js +0 -21
- package/cjs/plugin/components/tooltip-handler/dom/utils/index.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.d.ts +0 -4
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +0 -91
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/interface/common.d.ts +0 -4
- package/cjs/plugin/components/tooltip-handler/interface/common.js +0 -6
- package/cjs/plugin/components/tooltip-handler/interface/common.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/interface/style.d.ts +0 -13
- package/cjs/plugin/components/tooltip-handler/interface/style.js +0 -6
- package/cjs/plugin/components/tooltip-handler/interface/style.js.map +0 -1
- package/cjs/plugin/components/tooltip-handler/utils/index.d.ts +0 -3
- package/cjs/plugin/components/tooltip-handler/utils/index.js +0 -22
- package/cjs/plugin/components/tooltip-handler/utils/index.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/canvas/index.d.ts +0 -1
- package/esm/plugin/components/tooltip-handler/canvas/index.js +0 -2
- package/esm/plugin/components/tooltip-handler/canvas/index.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/constant.d.ts +0 -1
- package/esm/plugin/components/tooltip-handler/dom/constant.js +0 -2
- package/esm/plugin/components/tooltip-handler/dom/constant.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +0 -104
- package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/index.d.ts +0 -1
- package/esm/plugin/components/tooltip-handler/dom/index.js +0 -2
- package/esm/plugin/components/tooltip-handler/dom/index.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/interface.d.ts +0 -58
- package/esm/plugin/components/tooltip-handler/dom/interface.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +0 -25
- package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js +0 -67
- package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +0 -23
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +0 -130
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.d.ts +0 -14
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.js +0 -52
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/interface.d.ts +0 -10
- package/esm/plugin/components/tooltip-handler/dom/model/interface.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.d.ts +0 -23
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +0 -66
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/style-constants.d.ts +0 -7
- package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js +0 -41
- package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/text-model.d.ts +0 -5
- package/esm/plugin/components/tooltip-handler/dom/model/text-model.js +0 -13
- package/esm/plugin/components/tooltip-handler/dom/model/text-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/title-model.d.ts +0 -15
- package/esm/plugin/components/tooltip-handler/dom/model/title-model.js +0 -65
- package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.d.ts +0 -21
- package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js +0 -82
- package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/common.d.ts +0 -3
- package/esm/plugin/components/tooltip-handler/dom/utils/common.js +0 -22
- package/esm/plugin/components/tooltip-handler/dom/utils/common.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/index.d.ts +0 -2
- package/esm/plugin/components/tooltip-handler/dom/utils/index.js +0 -4
- package/esm/plugin/components/tooltip-handler/dom/utils/index.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/style.d.ts +0 -4
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js +0 -87
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/interface/common.d.ts +0 -4
- package/esm/plugin/components/tooltip-handler/interface/common.js +0 -2
- package/esm/plugin/components/tooltip-handler/interface/common.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/interface/style.d.ts +0 -13
- package/esm/plugin/components/tooltip-handler/interface/style.js +0 -2
- package/esm/plugin/components/tooltip-handler/interface/style.js.map +0 -1
- package/esm/plugin/components/tooltip-handler/utils/index.d.ts +0 -3
- package/esm/plugin/components/tooltip-handler/utils/index.js +0 -6
- package/esm/plugin/components/tooltip-handler/utils/index.js.map +0 -1
- /package/cjs/{plugin/components/tooltip-handler/dom → chart/pictogram}/interface.js +0 -0
- /package/cjs/{plugin/components/tooltip-handler/dom/model → series/pictogram}/interface.js +0 -0
- /package/esm/{plugin/components/tooltip-handler/dom → chart/pictogram}/interface.js +0 -0
- /package/esm/{plugin/components/tooltip-handler/dom/model → series/pictogram}/interface.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/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,CAAC;IACzD,MAAM,QAAQ,GAAgB,EAAE,CAAC;IAEjC,QAAQ,CAAC,KAAK,GAAG,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC;AAClB,CAAC","file":"style.js","sourcesContent":["import type { Maybe } from '@visactor/vutils';\nimport type { FontWeight, TextAlign } from '../../../../../typings';\nimport { mergeSpec } from '@visactor/vutils-extension';\nimport { normalizeLayoutPaddingSpec } from '../../../../../util/space';\nimport type { ITooltipAttributes, ITooltipTextStyle } from '../../interface';\nimport type { ILabelStyle, IShapeStyle, IDomTooltipStyle } from '../interface';\nimport { calculateLineHeight } from '@visactor/vrender-core';\nimport type { ITooltipTheme } from '../../../../../component/tooltip';\nimport { getPixelPropertyStr } from './common';\n\nconst DEFAULT_SHAPE_SPACING = 8;\nconst DEFAULT_KEY_SPACING = 26;\nconst DEFAULT_VALUE_SPACING = 0;\n\nexport function getDomStyles(attributes?: Maybe<ITooltipAttributes>): IDomTooltipStyle {\n const {\n panel = {},\n title: titleAttribute,\n content: contentAttribute,\n titleStyle = {},\n contentStyle = {},\n padding,\n keyWidth,\n valueWidth,\n enterable,\n transitionDuration,\n panelDomHeight = 0,\n align = 'left'\n } = attributes ?? {};\n\n const {\n fill: backgroundColor,\n shadow,\n shadowBlur,\n shadowColor,\n shadowOffsetX,\n shadowOffsetY,\n shadowSpread,\n cornerRadius,\n stroke: strokeColor,\n lineWidth = 0,\n width = 0\n } = panel;\n\n const { value: title = {} } = titleStyle;\n const { shape = {}, key = {}, value = {} } = contentStyle;\n\n const shapeStyle = getShapeStyle(shape);\n const keyStyle = getLabelStyle(key);\n const valueStyle = getLabelStyle(value);\n const { bottom, left, right, top } = normalizeLayoutPaddingSpec(padding);\n const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';\n\n const styles: IDomTooltipStyle = {\n align,\n panel: {\n width: getPixelPropertyStr(width + lineWidth * 2),\n minHeight: getPixelPropertyStr(panelDomHeight + lineWidth * 2),\n paddingBottom: getPixelPropertyStr(bottom as number),\n paddingLeft: getPixelPropertyStr(left as number),\n paddingRight: getPixelPropertyStr(right as number),\n paddingTop: getPixelPropertyStr(top as number),\n borderColor: strokeColor as string,\n borderWidth: getPixelPropertyStr(lineWidth),\n borderRadius: getPixelPropertyStr(cornerRadius),\n backgroundColor: backgroundColor ? `${backgroundColor}` : 'transparent',\n boxShadow: shadow\n ? `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}`\n : 'initial',\n pointerEvents: enterable ? 'auto' : 'none',\n transitionDuration: transitionDuration ? `${transitionDuration}ms` : 'initial',\n transitionProperty: transitionDuration ? 'transform' : 'initial',\n transitionTimingFunction: transitionDuration ? 'ease-out' : 'initial'\n },\n title: {\n marginTop: '0px',\n marginBottom: contentAttribute?.length ? getPixelPropertyStr(titleAttribute?.spaceRow) : '0px',\n ...getLabelStyle(mergeSpec({}, title, titleAttribute?.value))\n },\n content: {},\n shapeColumn: {\n common: shapeStyle,\n items: contentAttribute?.map(\n ({ spaceRow }, i) =>\n ({\n marginTop: '0px',\n marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px'\n } as IShapeStyle)\n ),\n width: getPixelPropertyStr(shape.size),\n [marginKey]: getPixelPropertyStr(shape.spacing ?? DEFAULT_SHAPE_SPACING)\n },\n keyColumn: {\n common: keyStyle,\n items: contentAttribute?.map(\n ({ key, spaceRow }, i) =>\n ({\n marginTop: '0px',\n marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px',\n ...keyStyle,\n ...getLabelStyle(key as ITooltipTextStyle),\n ...(key?.multiLine ? { width: getPixelPropertyStr(Math.ceil(key.width)) } : undefined) // 对多行文本使用定宽\n } as ILabelStyle)\n ),\n width: getPixelPropertyStr(keyWidth),\n [marginKey]: getPixelPropertyStr(key.spacing ?? DEFAULT_KEY_SPACING)\n },\n valueColumn: {\n common: valueStyle,\n items: contentAttribute?.map(\n ({ value, spaceRow }, i) =>\n ({\n marginTop: '0px',\n marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px',\n ...valueStyle,\n ...getLabelStyle(value as ITooltipTextStyle),\n ...(value?.multiLine ? { width: getPixelPropertyStr(Math.ceil(value.width)) } : undefined) // 对多行文本使用定宽\n } as ILabelStyle)\n ),\n width: getPixelPropertyStr(valueWidth),\n [marginKey]: getPixelPropertyStr(value.spacing ?? DEFAULT_VALUE_SPACING)\n }\n };\n return styles;\n}\n\nfunction getLabelStyle(\n labelStyle?: ITooltipTextStyle,\n defaultStyle?: Partial<ITooltipTextStyle>\n): ILabelStyle | undefined {\n if (!labelStyle) {\n return undefined;\n }\n const {\n fontFamily: labelFont,\n fontSize: labelFontSize,\n fill: labelColor,\n textAlign,\n lineHeight,\n fontWeight,\n multiLine,\n wordBreak,\n maxWidth\n } = mergeSpec({}, defaultStyle, labelStyle) as ITooltipTextStyle;\n const styleObj: ILabelStyle = {};\n\n styleObj.fontFamily = labelFont;\n styleObj.fontSize = getPixelPropertyStr(labelFontSize);\n styleObj.color = labelColor as string;\n styleObj.textAlign = textAlign as TextAlign;\n styleObj.lineHeight = getPixelPropertyStr(calculateLineHeight(lineHeight, labelFontSize));\n styleObj.fontWeight = fontWeight as FontWeight;\n styleObj.whiteSpace = multiLine ? 'initial' : 'nowrap';\n styleObj.wordBreak = multiLine ? wordBreak ?? 'break-word' : 'normal';\n styleObj.maxWidth = getPixelPropertyStr(maxWidth);\n return styleObj;\n}\n\nfunction getShapeStyle(\n shapeStyle?: ITooltipTheme['shape'],\n defaultStyle?: Partial<ITooltipTheme['shape']>\n): IShapeStyle | undefined {\n if (!shapeStyle) {\n return undefined;\n }\n const { size } = mergeSpec({}, defaultStyle, shapeStyle);\n const styleObj: IShapeStyle = {};\n\n styleObj.width = getPixelPropertyStr(size);\n return styleObj;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/interface/common.ts"],"names":[],"mappings":"","file":"common.js","sourcesContent":["import type { ITooltipHandler } from '../../../../typings';\n\nexport interface ITooltipHandlerConstructor {\n new (): ITooltipHandler;\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TooltipAttributes } from '@visactor/vrender-components';
|
|
2
|
-
import type { ITextAttribute, IFillStyle } from '@visactor/vrender-core';
|
|
3
|
-
export interface ITooltipTextStyle extends Partial<ITextAttribute & IFillStyle> {
|
|
4
|
-
spacing?: number;
|
|
5
|
-
multiLine?: boolean;
|
|
6
|
-
maxWidth?: number;
|
|
7
|
-
autoWidth?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface ITooltipAttributes extends TooltipAttributes {
|
|
10
|
-
panelDomHeight?: number;
|
|
11
|
-
maxContentHeight?: number;
|
|
12
|
-
align?: 'left' | 'right';
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/interface/style.ts"],"names":[],"mappings":"","file":"style.js","sourcesContent":["import type { TooltipAttributes } from '@visactor/vrender-components';\nimport type { ITextAttribute, IFillStyle } from '@visactor/vrender-core';\n\nexport interface ITooltipTextStyle extends Partial<ITextAttribute & IFillStyle> {\n /** 和相邻元素的水平间距 */\n spacing?: number;\n /** 是否支持换行 */\n multiLine?: boolean;\n /** 文本元素的最大宽度 */\n maxWidth?: number;\n /** 是否开启自动宽度 */\n autoWidth?: boolean;\n}\n\nexport interface ITooltipAttributes extends TooltipAttributes {\n /** dom tooltip 的高度。由于 canvas tooltip 不支持滚动条,dom tooltip 单独计算高度 */\n panelDomHeight?: number;\n /** dom tooltip 内容区的最大高度,canvas tooltip 不支持 */\n maxContentHeight?: number;\n /**\n * @since 1.11.5\n *\n * shape、key、value的对齐方式,可选项如下:\n * 'left': 从左到右对齐\n * 'right': 从右到左对齐\n */\n align?: 'left' | 'right';\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
-
void 0 === k2 && (k2 = k);
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
-
enumerable: !0,
|
|
8
|
-
get: function() {
|
|
9
|
-
return m[k];
|
|
10
|
-
}
|
|
11
|
-
}), Object.defineProperty(o, k2, desc);
|
|
12
|
-
} : function(o, m, k, k2) {
|
|
13
|
-
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
-
}), __exportStar = this && this.__exportStar || function(m, exports) {
|
|
15
|
-
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, "__esModule", {
|
|
19
|
-
value: !0
|
|
20
|
-
}), __exportStar(require("./common"), exports), __exportStar(require("./position"), exports),
|
|
21
|
-
__exportStar(require("./attribute"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B","file":"index.js","sourcesContent":["export * from './common';\nexport * from './position';\nexport * from './attribute';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,uBAAuB,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jB,CAAC,CAAC;SACJ;IACH,CAAC;IAED,cAAc;;QACZ,OAAO,MAAA,IAAI,CAAC,iBAAiB,0CAAE,SAAS,CAAC,UAAU,CAAC;IACtD,CAAC;IAED,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,EAAE,CAAC;IACzB,CAAC;;AApGe,yBAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;AAuGnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;AAChD,CAAC,CAAC","file":"canvas-tooltip-handler.js","sourcesContent":["import type { ILayer, INode, Stage } from '@visactor/vrender-core';\nimport { BaseTooltipHandler } from '../base';\nimport { Tooltip as TooltipComponent } from '@visactor/vrender-components';\nimport { isValid } from '@visactor/vutils';\nimport type { TooltipHandlerParams } from '../../../../component/tooltip';\nimport type { IComponentPluginService } from '../../interface';\nimport { registerComponentPlugin } from '../../register';\nimport { TooltipHandlerType } from '../../../../component/tooltip/constant';\n\n/**\n * The tooltip handler class.\n */\nexport class CanvasTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.canvas;\n readonly type = TooltipHandlerType.canvas;\n\n private _layer: ILayer;\n protected _el?: HTMLCanvasElement;\n protected _tooltipCanvasId?: string;\n protected _tooltipComponent: TooltipComponent;\n\n constructor() {\n super(CanvasTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._tooltipCanvasId = (this._chartOption.modeParams as any)?.tooltipCanvasId;\n }\n\n private _initTooltipComponent(stage: Stage) {\n const layer = this._getLayer(stage);\n this._tooltipComponent = new TooltipComponent({\n autoCalculatePosition: false,\n autoMeasure: false\n });\n layer.add(this._tooltipComponent as unknown as INode);\n }\n\n private _getLayer(stage: Stage) {\n if (this._layer) {\n return this._layer;\n }\n\n this._layer = stage.createLayer(this._tooltipCanvasId);\n\n // 需要关闭 layer 对应的 canvas 的事件\n const layerCanvas = this._layer.layerHandler.canvas.nativeCanvas as HTMLCanvasElement;\n // TODO:待 vrender 支持\n if (layerCanvas && layerCanvas.style) {\n layerCanvas.style.touchAction = 'none';\n layerCanvas.style.pointerEvents = 'none';\n }\n\n return this._layer;\n }\n\n protected _removeTooltip() {\n if (this._layer) {\n this._layer.removeAllChild();\n // this._layer.render();\n }\n this._attributes = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n this._visible = visible;\n\n const stage = this._compiler.getStage();\n if (!stage) {\n return;\n }\n\n if (!visible) {\n if (this._tooltipComponent && this._tooltipComponent.attribute.visible) {\n this._tooltipComponent.hideAll();\n this._tooltipComponent.setAttributes({\n visibleAll: false\n });\n }\n return;\n }\n\n if (!this._tooltipComponent) {\n this._initTooltipComponent(stage);\n }\n\n const { activeTooltipSpec } = params;\n const pos = activeTooltipSpec.position;\n if (!params.changePositionOnly) {\n this._tooltipComponent.setAttributes({\n ...this._attributes,\n ...pos\n });\n } else if (isValid(pos)) {\n this._tooltipComponent.setAttributes(pos);\n }\n\n if (!this._tooltipComponent.attribute.visible) {\n this._tooltipComponent.showAll();\n this._tooltipComponent.setAttributes({\n visibleAll: true\n });\n }\n }\n\n isTooltipShown() {\n return this._tooltipComponent?.attribute.visibleAll;\n }\n\n release() {\n super.release();\n this._layer?.release();\n }\n}\n\nexport const registerCanvasTooltipHandler = () => {\n registerComponentPlugin(CanvasTooltipHandler);\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './canvas-tooltip-handler';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/canvas/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","file":"index.js","sourcesContent":["export * from './canvas-tooltip-handler';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_TOOLTIP_Z_INDEX = "99999999999999";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAgB,CAAC","file":"constant.js","sourcesContent":["export const DEFAULT_TOOLTIP_Z_INDEX = '99999999999999';\n"]}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { BaseTooltipHandler } from "../base";
|
|
2
|
-
|
|
3
|
-
import { getDomStyles } from "./utils";
|
|
4
|
-
|
|
5
|
-
import { TooltipModel } from "./model/tooltip-model";
|
|
6
|
-
|
|
7
|
-
import { TOOLTIP_CONTAINER_EL_CLASS_NAME } from "../constants";
|
|
8
|
-
|
|
9
|
-
import { domDocument } from "../../../../util/env";
|
|
10
|
-
|
|
11
|
-
import { registerComponentPlugin } from "../../register";
|
|
12
|
-
|
|
13
|
-
import { DEFAULT_TOOLTIP_Z_INDEX } from "./constant";
|
|
14
|
-
|
|
15
|
-
import { TooltipHandlerType } from "../../../../component/tooltip/constant";
|
|
16
|
-
|
|
17
|
-
export class DomTooltipHandler extends BaseTooltipHandler {
|
|
18
|
-
getVisibility() {
|
|
19
|
-
var _a;
|
|
20
|
-
return !!(null === (_a = this.model) || void 0 === _a ? void 0 : _a.getVisibility());
|
|
21
|
-
}
|
|
22
|
-
setVisibility(_value) {
|
|
23
|
-
var _a;
|
|
24
|
-
_value !== this.getVisibility() && (null === (_a = this.model) || void 0 === _a || _a.setVisibility(_value));
|
|
25
|
-
}
|
|
26
|
-
constructor() {
|
|
27
|
-
super(DomTooltipHandler.type), this.type = TooltipHandlerType.dom, this._tooltipContainer = null == domDocument ? void 0 : domDocument.body;
|
|
28
|
-
}
|
|
29
|
-
onAdd(service) {
|
|
30
|
-
super.onAdd(service), this._initStyle(), this.initEl();
|
|
31
|
-
}
|
|
32
|
-
initEl() {
|
|
33
|
-
const tooltipSpec = this._component.getSpec(), parentElement = tooltipSpec.parentElement;
|
|
34
|
-
if (domDocument && parentElement && parentElement.children && parentElement.children.length) {
|
|
35
|
-
for (let i = 0; i < parentElement.children.length; i++) if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {
|
|
36
|
-
this._container = parentElement.children[i];
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
this._container || (this._container = domDocument.createElement("div"), this._container.style.position = "relative",
|
|
40
|
-
this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX, this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME),
|
|
41
|
-
parentElement.appendChild(this._container)), this.model = new TooltipModel({
|
|
42
|
-
valueToHtml: this._option.sanitize,
|
|
43
|
-
getTooltipStyle: () => this._domStyle,
|
|
44
|
-
getTooltipActual: () => this._tooltipActual,
|
|
45
|
-
getTooltipAttributes: () => this._attributes,
|
|
46
|
-
getContainer: () => this._container
|
|
47
|
-
}, [ tooltipSpec.className ], this.name);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
_removeTooltip() {
|
|
51
|
-
var _a;
|
|
52
|
-
null === (_a = this.model) || void 0 === _a || _a.release(), this._container = null;
|
|
53
|
-
}
|
|
54
|
-
_updateTooltip(visible, params) {
|
|
55
|
-
var _a, _b;
|
|
56
|
-
if (visible && this.model) {
|
|
57
|
-
const {tooltipSpec: tooltipSpec, activeTooltipSpec: activeTooltipSpec} = params;
|
|
58
|
-
params.changePositionOnly || (this._tooltipActual = activeTooltipSpec, this._initStyle(),
|
|
59
|
-
this.model.initAll(), this.model.setStyle(), this.model.setContent()), this.setVisibility(visible);
|
|
60
|
-
const el = this.model.product;
|
|
61
|
-
if (el) {
|
|
62
|
-
const {x: x = 0, y: y = 0} = null !== (_a = activeTooltipSpec.position) && void 0 !== _a ? _a : {};
|
|
63
|
-
if (tooltipSpec.updateElement) {
|
|
64
|
-
this._updatePosition(null !== (_b = this._cacheCustomTooltipPosition) && void 0 !== _b ? _b : {
|
|
65
|
-
x: x,
|
|
66
|
-
y: y
|
|
67
|
-
}), tooltipSpec.updateElement(el, activeTooltipSpec, params);
|
|
68
|
-
const position = this._getActualTooltipPosition(activeTooltipSpec, params, {
|
|
69
|
-
width: el.offsetWidth,
|
|
70
|
-
height: el.offsetHeight
|
|
71
|
-
});
|
|
72
|
-
this._updatePosition(position), this._cacheCustomTooltipPosition = position;
|
|
73
|
-
} else this._updatePosition({
|
|
74
|
-
x: x,
|
|
75
|
-
y: y
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
} else this.setVisibility(visible), this._cacheCustomTooltipPosition = void 0;
|
|
79
|
-
}
|
|
80
|
-
_initStyle() {
|
|
81
|
-
this._domStyle = getDomStyles(this._attributes);
|
|
82
|
-
}
|
|
83
|
-
_getParentElement(spec) {
|
|
84
|
-
var _a;
|
|
85
|
-
return null !== (_a = this._container) && void 0 !== _a ? _a : super._getParentElement(spec);
|
|
86
|
-
}
|
|
87
|
-
isTooltipShown() {
|
|
88
|
-
return this.getVisibility();
|
|
89
|
-
}
|
|
90
|
-
reInit() {
|
|
91
|
-
super.reInit(), this._initStyle();
|
|
92
|
-
}
|
|
93
|
-
_updatePosition({x: x, y: y}) {
|
|
94
|
-
const el = this.model.product;
|
|
95
|
-
el && (el.style.transform = `translate3d(${x}px, ${y}px, 0)`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
DomTooltipHandler.type = TooltipHandlerType.dom;
|
|
100
|
-
|
|
101
|
-
export const registerDomTooltipHandler = () => {
|
|
102
|
-
registerComponentPlugin(DomTooltipHandler);
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=dom-tooltip-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/dom-tooltip-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAA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BAE/B,IAAI,CAAC,2BAA2B,GAAG,QAAQ,CAAC;iBAC7C;qBAAM;oBACL,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;iBAChC;aACF;SACF;IACH,CAAC;IAES,UAAU;QAClB,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;IAES,iBAAiB,CAAC,IAAkB;;QAC5C,OAAO,MAAA,IAAI,CAAC,UAAU,mCAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAES,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAA0B;QACxD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,EAAE,EAAE;YAEN,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;SACvD;IACH,CAAC;;AAvIe,sBAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC;AA0IhD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC,CAAC","file":"dom-tooltip-handler.js","sourcesContent":["import type { ITooltipActual, ITooltipPositionActual } from '../../../../typings/tooltip';\nimport { BaseTooltipHandler } from '../base';\nimport { getDomStyles } from './utils';\nimport type { IDomTooltipStyle } from './interface';\nimport { TooltipModel } from './model/tooltip-model';\nimport { TOOLTIP_CONTAINER_EL_CLASS_NAME } from '../constants';\nimport { type Maybe } from '@visactor/vutils';\nimport { domDocument } from '../../../../util/env';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../../../component/tooltip';\nimport type { IComponentPluginService } from '../../interface';\nimport { registerComponentPlugin } from '../../register';\nimport { DEFAULT_TOOLTIP_Z_INDEX } from './constant';\nimport type { ILayoutPoint } from '../../../../typings';\nimport { TooltipHandlerType } from '../../../../component/tooltip/constant';\n\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.dom;\n readonly type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: IDomTooltipStyle;\n protected _tooltipActual?: ITooltipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n /** 自定义 tooltip 的位置缓存 */\n protected _cacheCustomTooltipPosition: ILayoutPoint;\n\n protected model: TooltipModel;\n\n getVisibility() {\n return !!this.model?.getVisibility();\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility()) {\n this.model?.setVisibility(_value);\n }\n }\n\n constructor() {\n super(DomTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement && parentElement.children && parentElement.children.length) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX;\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n this.model = new TooltipModel(\n {\n valueToHtml: this._option.sanitize,\n getTooltipStyle: () => this._domStyle,\n getTooltipActual: () => this._tooltipActual,\n getTooltipAttributes: () => this._attributes,\n getContainer: () => this._container\n },\n [tooltipSpec.className],\n this.name\n );\n }\n }\n\n protected _removeTooltip() {\n this.model?.release();\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n if (!visible || !this.model) {\n this.setVisibility(visible);\n this._cacheCustomTooltipPosition = undefined;\n } else {\n const { tooltipSpec, activeTooltipSpec } = params;\n\n if (!params.changePositionOnly) {\n this._tooltipActual = activeTooltipSpec;\n this._initStyle();\n\n this.model.initAll();\n this.model.setStyle();\n this.model.setContent();\n }\n this.setVisibility(visible);\n\n // 位置\n const el = this.model.product;\n if (el) {\n const { x = 0, y = 0 } = activeTooltipSpec.position ?? {};\n if (tooltipSpec.updateElement) {\n // 此处先设定一次位置,防止页面暂时出现滚动条(优先设置上次的位置)\n this._updatePosition(this._cacheCustomTooltipPosition ?? { x, y });\n // 更新 tooltip dom\n tooltipSpec.updateElement(el, activeTooltipSpec, params);\n // 重新计算 tooltip 位置\n const position = this._getActualTooltipPosition(activeTooltipSpec, params, {\n width: el.offsetWidth,\n height: el.offsetHeight\n });\n // 更新位置\n this._updatePosition(position);\n // 更新缓存\n this._cacheCustomTooltipPosition = position;\n } else {\n this._updatePosition({ x, y });\n }\n }\n }\n }\n\n protected _initStyle() {\n this._domStyle = getDomStyles(this._attributes);\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n }\n\n protected _updatePosition({ x, y }: ITooltipPositionActual) {\n const el = this.model.product;\n if (el) {\n // translate3d 性能较好:https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n el.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n }\n }\n}\n\nexport const registerDomTooltipHandler = () => {\n registerComponentPlugin(DomTooltipHandler);\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dom-tooltip-handler';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","file":"index.js","sourcesContent":["export * from './dom-tooltip-handler';\n"]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { FontWeight, TextAlign } from '../../../../typings/visual';
|
|
2
|
-
export interface IDomTooltipStyle {
|
|
3
|
-
panel: IPadding & IBorder & {
|
|
4
|
-
width?: string;
|
|
5
|
-
height?: string;
|
|
6
|
-
minHeight?: string;
|
|
7
|
-
backgroundColor?: string;
|
|
8
|
-
boxShadow?: string;
|
|
9
|
-
pointerEvents?: 'auto' | 'none';
|
|
10
|
-
transitionDuration?: string;
|
|
11
|
-
transitionProperty?: string;
|
|
12
|
-
transitionTimingFunction?: string;
|
|
13
|
-
};
|
|
14
|
-
title: ILabelStyle;
|
|
15
|
-
content: IMargin;
|
|
16
|
-
shapeColumn: TooltipColumnStyle<IShapeStyle>;
|
|
17
|
-
keyColumn: TooltipColumnStyle<ILabelStyle>;
|
|
18
|
-
valueColumn: TooltipColumnStyle<ILabelStyle>;
|
|
19
|
-
align?: 'left' | 'right';
|
|
20
|
-
}
|
|
21
|
-
export type TooltipColumnStyle<T> = IMargin & {
|
|
22
|
-
width?: string;
|
|
23
|
-
common?: T;
|
|
24
|
-
items?: T[];
|
|
25
|
-
};
|
|
26
|
-
export interface ILabelStyle extends IMargin {
|
|
27
|
-
fontFamily?: string;
|
|
28
|
-
fontSize?: string;
|
|
29
|
-
color?: string;
|
|
30
|
-
textAlign?: TextAlign;
|
|
31
|
-
lineHeight?: string;
|
|
32
|
-
fontWeight?: FontWeight;
|
|
33
|
-
whiteSpace?: string;
|
|
34
|
-
wordBreak?: string;
|
|
35
|
-
maxWidth?: string;
|
|
36
|
-
width?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface IShapeStyle extends IMargin {
|
|
39
|
-
width?: string;
|
|
40
|
-
height?: string;
|
|
41
|
-
}
|
|
42
|
-
export interface IMargin {
|
|
43
|
-
marginLeft?: string;
|
|
44
|
-
marginRight?: string;
|
|
45
|
-
marginTop?: string;
|
|
46
|
-
marginBottom?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface IPadding {
|
|
49
|
-
paddingTop?: string;
|
|
50
|
-
paddingRight?: string;
|
|
51
|
-
paddingBottom?: string;
|
|
52
|
-
paddingLeft?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface IBorder {
|
|
55
|
-
borderColor?: string;
|
|
56
|
-
borderWidth?: string;
|
|
57
|
-
borderRadius?: string;
|
|
58
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { FontWeight, TextAlign } from '../../../../typings/visual';\n\nexport interface IDomTooltipStyle {\n panel: IPadding &\n IBorder & {\n width?: string;\n height?: string;\n minHeight?: string;\n backgroundColor?: string;\n boxShadow?: string;\n pointerEvents?: 'auto' | 'none';\n transitionDuration?: string;\n transitionProperty?: string;\n transitionTimingFunction?: string;\n };\n title: ILabelStyle;\n content: IMargin;\n shapeColumn: TooltipColumnStyle<IShapeStyle>;\n keyColumn: TooltipColumnStyle<ILabelStyle>;\n valueColumn: TooltipColumnStyle<ILabelStyle>;\n align?: 'left' | 'right';\n}\n\nexport type TooltipColumnStyle<T> = IMargin & {\n width?: string;\n /** 各行通用配置 */\n common?: T;\n /** 各行具体配置 */\n items?: T[];\n};\n\nexport interface ILabelStyle extends IMargin {\n fontFamily?: string;\n fontSize?: string;\n color?: string;\n textAlign?: TextAlign;\n lineHeight?: string;\n fontWeight?: FontWeight;\n whiteSpace?: string;\n wordBreak?: string;\n maxWidth?: string;\n width?: string;\n}\n\nexport interface IShapeStyle extends IMargin {\n width?: string;\n height?: string;\n}\n\nexport interface IMargin {\n marginLeft?: string;\n marginRight?: string;\n marginTop?: string;\n marginBottom?: string;\n}\n\nexport interface IPadding {\n paddingTop?: string;\n paddingRight?: string;\n paddingBottom?: string;\n paddingLeft?: string;\n}\n\nexport interface IBorder {\n borderColor?: string;\n borderWidth?: string;\n borderRadius?: string;\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Maybe } from '@visactor/vutils';
|
|
2
|
-
import type { ITooltipLineActual } from '../../../../../typings';
|
|
3
|
-
import type { ITooltipModelOption } from './interface';
|
|
4
|
-
export declare class BaseTooltipModel {
|
|
5
|
-
static type: string;
|
|
6
|
-
static isInstance(obj: any): obj is BaseTooltipModel;
|
|
7
|
-
readonly type: string;
|
|
8
|
-
readonly parent: BaseTooltipModel | HTMLElement;
|
|
9
|
-
readonly childIndex: number;
|
|
10
|
-
protected _option: ITooltipModelOption;
|
|
11
|
-
setOption(option: ITooltipModelOption): void;
|
|
12
|
-
protected _renderContentCache: ITooltipLineActual[] | null;
|
|
13
|
-
children: Record<number, BaseTooltipModel>;
|
|
14
|
-
product: Maybe<HTMLElement>;
|
|
15
|
-
getParentEl(): HTMLElement;
|
|
16
|
-
constructor(parent: BaseTooltipModel | HTMLElement, option: ITooltipModelOption, childIndex?: number);
|
|
17
|
-
init(classList?: string[], id?: string): void;
|
|
18
|
-
initAll(): void;
|
|
19
|
-
setStyle(style?: Partial<CSSStyleDeclaration>): void;
|
|
20
|
-
setContent(content?: any): void;
|
|
21
|
-
setVisibility(visibility: boolean): void;
|
|
22
|
-
getVisibility(): boolean;
|
|
23
|
-
release(): void;
|
|
24
|
-
protected createElement(tag: keyof HTMLElementTagNameMap, classList?: string[], style?: Partial<CSSStyleDeclaration>, id?: string): HTMLElement;
|
|
25
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { domDocument } from "../../../../../util/env";
|
|
2
|
-
|
|
3
|
-
export class BaseTooltipModel {
|
|
4
|
-
static isInstance(obj) {
|
|
5
|
-
return !!obj && obj.type === BaseTooltipModel.type;
|
|
6
|
-
}
|
|
7
|
-
setOption(option) {
|
|
8
|
-
this._option = option, Object.values(this.children).forEach((c => c.setOption(option)));
|
|
9
|
-
}
|
|
10
|
-
getParentEl() {
|
|
11
|
-
return BaseTooltipModel.isInstance(this.parent) ? this.parent.product : this.parent;
|
|
12
|
-
}
|
|
13
|
-
constructor(parent, option, childIndex) {
|
|
14
|
-
this.type = BaseTooltipModel.type, this._renderContentCache = null, this.children = {},
|
|
15
|
-
this.parent = parent, this._option = option, this.childIndex = null != childIndex ? childIndex : 0;
|
|
16
|
-
}
|
|
17
|
-
init(classList, id) {}
|
|
18
|
-
initAll() {
|
|
19
|
-
this.init(), Object.values(this.children).forEach((c => c.initAll()));
|
|
20
|
-
}
|
|
21
|
-
setStyle(style) {
|
|
22
|
-
this.product && style && Object.keys(style).forEach((key => {
|
|
23
|
-
this.product.style[key] !== style[key] && (this.product.style[key] = style[key]);
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
setContent(content) {}
|
|
27
|
-
setVisibility(visibility) {
|
|
28
|
-
if (!this.product) return;
|
|
29
|
-
const {style: style} = this.product;
|
|
30
|
-
style.visibility = visibility ? "visible" : "hidden", Object.values(this.children).forEach((c => c.setVisibility(visibility)));
|
|
31
|
-
}
|
|
32
|
-
getVisibility() {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
return !!(null === (_b = null === (_a = this.product) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.visibility) && "hidden" !== this.product.style.visibility;
|
|
35
|
-
}
|
|
36
|
-
release() {
|
|
37
|
-
var _a;
|
|
38
|
-
if (Object.values(this.children).forEach((c => c.release())), this.children = {},
|
|
39
|
-
this.product) {
|
|
40
|
-
try {
|
|
41
|
-
null === (_a = this.getParentEl()) || void 0 === _a || _a.removeChild(this.product);
|
|
42
|
-
} catch (_b) {}
|
|
43
|
-
this.product = null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
createElement(tag, classList, style, id) {
|
|
47
|
-
const element = null == domDocument ? void 0 : domDocument.createElement(tag), parentEl = this.getParentEl();
|
|
48
|
-
if (!element || !parentEl) return;
|
|
49
|
-
classList && element.classList.add(...classList), style && Object.keys(style).forEach((key => {
|
|
50
|
-
element.style[key] = style[key];
|
|
51
|
-
})), id && (element.id = id);
|
|
52
|
-
let ptr = this.childIndex;
|
|
53
|
-
if (BaseTooltipModel.isInstance(this.parent)) {
|
|
54
|
-
let nextChildIndex = Number.MAX_VALUE;
|
|
55
|
-
for (let i = 0; i < parentEl.children.length; i++) {
|
|
56
|
-
const childModel = Object.values(this.parent.children).find((c => c.product === parentEl.children[i]));
|
|
57
|
-
childModel.childIndex > this.childIndex && childModel.childIndex < nextChildIndex && (nextChildIndex = childModel.childIndex,
|
|
58
|
-
ptr = i);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return ptr >= parentEl.children.length ? parentEl.appendChild(element) : parentEl.insertBefore(element, parentEl.children[ptr]),
|
|
62
|
-
element;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
BaseTooltipModel.type = "tooltipModel";
|
|
67
|
-
//# sourceMappingURL=base-tooltip-model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/base-tooltip-model.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,OAAO,gBAAgB;IAE3B,MAAM,CAAC,UAAU,CAAC,GAAQ;QACxB,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,KAAK,CAAC;SACd;QACD,OAAO,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,CAAC;IAC5C,CAAC;IAOD,SAAS,CAAC,MAA2B;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC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,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC/B;aAAM;YACL,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;SACxD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AAtIM,qBAAI,GAAG,cAAc,CAAC","file":"base-tooltip-model.js","sourcesContent":["import type { Maybe } from '@visactor/vutils';\nimport type { ITooltipLineActual } from '../../../../../typings';\nimport type { ITooltipModelOption } from './interface';\nimport { domDocument } from '../../../../../util/env';\n\nexport class BaseTooltipModel {\n static type = 'tooltipModel';\n static isInstance(obj: any): obj is BaseTooltipModel {\n if (!obj) {\n return false;\n }\n return obj.type === BaseTooltipModel.type;\n }\n readonly type = BaseTooltipModel.type;\n\n readonly parent: BaseTooltipModel | HTMLElement;\n readonly childIndex: number;\n\n protected _option: ITooltipModelOption;\n setOption(option: ITooltipModelOption) {\n this._option = option;\n Object.values(this.children).forEach(c => c.setOption(option));\n }\n\n protected _renderContentCache: ITooltipLineActual[] | null = null;\n\n children: Record<number, BaseTooltipModel> = {};\n\n product: Maybe<HTMLElement>;\n\n getParentEl() {\n if (BaseTooltipModel.isInstance(this.parent)) {\n return this.parent.product;\n }\n return this.parent;\n }\n\n constructor(parent: BaseTooltipModel | HTMLElement, option: ITooltipModelOption, childIndex?: number) {\n this.parent = parent;\n this._option = option;\n this.childIndex = childIndex ?? 0;\n }\n\n init(classList?: string[], id?: string) {\n // do nothing\n }\n\n initAll() {\n this.init();\n Object.values(this.children).forEach(c => c.initAll());\n }\n\n setStyle(style?: Partial<CSSStyleDeclaration>) {\n if (!this.product || !style) {\n return;\n }\n Object.keys(style).forEach(key => {\n if (this.product!.style[key] !== style[key]) {\n this.product!.style[key] = style[key];\n }\n });\n }\n\n setContent(content?: any) {\n // do nothing\n }\n\n setVisibility(visibility: boolean) {\n if (!this.product) {\n return;\n }\n const { style } = this.product;\n if (visibility) {\n style.visibility = 'visible';\n } else {\n style.visibility = 'hidden';\n }\n Object.values(this.children).forEach(c => c.setVisibility(visibility));\n }\n\n getVisibility() {\n if (!this.product?.style?.visibility) {\n return false;\n }\n return this.product.style.visibility !== 'hidden';\n }\n\n release() {\n Object.values(this.children).forEach(c => c.release());\n this.children = {};\n if (this.product) {\n try {\n this.getParentEl()?.removeChild(this.product);\n } catch {}\n this.product = null;\n }\n }\n\n protected createElement(\n tag: keyof HTMLElementTagNameMap,\n classList?: string[],\n style?: Partial<CSSStyleDeclaration>,\n id?: string\n ) {\n const element = domDocument?.createElement(tag);\n const parentEl = this.getParentEl();\n if (!element || !parentEl) {\n return undefined;\n }\n\n if (classList) {\n element.classList.add(...classList);\n }\n if (style) {\n Object.keys(style).forEach(key => {\n element.style[key] = style[key];\n });\n }\n if (id) {\n element.id = id;\n }\n\n let ptr = this.childIndex;\n if (BaseTooltipModel.isInstance(this.parent)) {\n // 按照自身 childIndex 插入对应位置\n let nextChildIndex = Number.MAX_VALUE;\n for (let i = 0; i < parentEl.children.length; i++) {\n const childModel = Object.values(this.parent.children).find(c => c.product === parentEl.children[i]);\n if (childModel.childIndex > this.childIndex && childModel.childIndex < nextChildIndex) {\n nextChildIndex = childModel.childIndex;\n ptr = i;\n }\n }\n }\n if (ptr >= parentEl.children.length) {\n parentEl.appendChild(element);\n } else {\n parentEl.insertBefore(element, parentEl.children[ptr]);\n }\n return element;\n }\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BaseTooltipModel } from './base-tooltip-model';
|
|
2
|
-
import type { ITooltipModelOption } from './interface';
|
|
3
|
-
import type { IShapeSvgOption } from './shape-model';
|
|
4
|
-
import type { ITooltipLineActual } from '../../../../../typings';
|
|
5
|
-
export type ContentColumnType = 'shape-box' | 'key-box' | 'value-box';
|
|
6
|
-
export declare class ContentColumnModel extends BaseTooltipModel {
|
|
7
|
-
readonly className: ContentColumnType;
|
|
8
|
-
constructor(parent: BaseTooltipModel | HTMLElement, option: ITooltipModelOption, className: ContentColumnType, childIndex?: number);
|
|
9
|
-
init(): void;
|
|
10
|
-
setStyle(): void;
|
|
11
|
-
setContent(): void;
|
|
12
|
-
protected _getContentColumnStyle(): import("../interface").TooltipColumnStyle<import("../interface").ILabelStyle> | {
|
|
13
|
-
display?: string;
|
|
14
|
-
marginLeft?: string;
|
|
15
|
-
marginRight?: string;
|
|
16
|
-
marginTop?: string;
|
|
17
|
-
marginBottom?: string;
|
|
18
|
-
width?: string;
|
|
19
|
-
common?: import("../interface").IShapeStyle;
|
|
20
|
-
items?: import("../interface").IShapeStyle[];
|
|
21
|
-
};
|
|
22
|
-
protected _getShapeSvgOption(line: ITooltipLineActual, index: number): IShapeSvgOption;
|
|
23
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { isNumber, isString, toNumber } from "@visactor/vutils";
|
|
2
|
-
|
|
3
|
-
import { defaultKeyStyle, defaultContentColumnStyle, defaultValueStyle, defaultAdaptiveKeyStyle, defaultShapeStyle } from "./style-constants";
|
|
4
|
-
|
|
5
|
-
import { BaseTooltipModel } from "./base-tooltip-model";
|
|
6
|
-
|
|
7
|
-
import { ShapeModel } from "./shape-model";
|
|
8
|
-
|
|
9
|
-
import { TextModel } from "./text-model";
|
|
10
|
-
|
|
11
|
-
import { TOOLTIP_EMPTY_STRING } from "../../constants";
|
|
12
|
-
|
|
13
|
-
import { getPixelPropertyStr } from "../utils";
|
|
14
|
-
|
|
15
|
-
import { mergeSpec } from "@visactor/vutils-extension";
|
|
16
|
-
|
|
17
|
-
const defaultLabelStyle = {
|
|
18
|
-
overflowWrap: "normal",
|
|
19
|
-
wordWrap: "normal"
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export class ContentColumnModel extends BaseTooltipModel {
|
|
23
|
-
constructor(parent, option, className, childIndex) {
|
|
24
|
-
super(parent, option, childIndex), this.className = className;
|
|
25
|
-
}
|
|
26
|
-
init() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
this.product || (this.product = this.createElement("div", [ this.className ]));
|
|
29
|
-
const renderContent = null !== (_b = null === (_a = this._option.getTooltipActual()) || void 0 === _a ? void 0 : _a.content) && void 0 !== _b ? _b : [];
|
|
30
|
-
if ("shape-box" !== this.className || renderContent.some((c => c.hasShape && c.shapeType))) {
|
|
31
|
-
Object.keys(this.children).forEach((key => {
|
|
32
|
-
const i = toNumber(key);
|
|
33
|
-
i >= renderContent.length && (this.children[i].release(), delete this.children[i]);
|
|
34
|
-
}));
|
|
35
|
-
for (let i = 0; i < renderContent.length; i++) if (!this.children[i]) if ("key-box" === this.className || "value-box" === this.className) {
|
|
36
|
-
const text = new TextModel(this.product, this._option, i);
|
|
37
|
-
text.init([ this.className.substring(0, this.className.indexOf("-")) ], void 0, "div"),
|
|
38
|
-
this.children[i] = text;
|
|
39
|
-
} else if ("shape-box" === this.className) {
|
|
40
|
-
const shape = new ShapeModel(this.product, this._option, i);
|
|
41
|
-
shape.init([ "shape" ], void 0, "div"), this.children[i] = shape;
|
|
42
|
-
}
|
|
43
|
-
} else Object.keys(this.children).forEach((key => {
|
|
44
|
-
const i = toNumber(key);
|
|
45
|
-
this.children[i].release(), delete this.children[i];
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
setStyle() {
|
|
49
|
-
var _a, _b, _c, _d;
|
|
50
|
-
const tooltipStyle = this._option.getTooltipStyle();
|
|
51
|
-
super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));
|
|
52
|
-
const renderContent = null !== (_b = null === (_a = this._option.getTooltipActual()) || void 0 === _a ? void 0 : _a.content) && void 0 !== _b ? _b : [], contentAttributes = null !== (_d = null === (_c = this._option.getTooltipAttributes()) || void 0 === _c ? void 0 : _c.content) && void 0 !== _d ? _d : [], getKeyItemStyle = (line, attrs, i) => {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
const {key: key, isKeyAdaptive: isKeyAdaptive} = line, {height: height} = attrs, {keyColumn: keyColumn} = tooltipStyle, style = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({
|
|
55
|
-
height: getPixelPropertyStr(height)
|
|
56
|
-
}, defaultLabelStyle), keyColumn.common), null === (_a = keyColumn.items) || void 0 === _a ? void 0 : _a[i]));
|
|
57
|
-
return isString(key) && "" !== (null === (_b = null == key ? void 0 : key.trim) || void 0 === _b ? void 0 : _b.call(key)) || isNumber(key) || style.visibility ? style.visibility = "visible" : style.visibility = "hidden",
|
|
58
|
-
style;
|
|
59
|
-
};
|
|
60
|
-
contentAttributes.forEach(((attrs, i) => {
|
|
61
|
-
var _a;
|
|
62
|
-
const line = renderContent[i];
|
|
63
|
-
"key-box" === this.className ? this.children[i].setStyle(getKeyItemStyle(line, attrs, i)) : "value-box" === this.className ? this.children[i].setStyle(((line, attrs, i) => {
|
|
64
|
-
var _a;
|
|
65
|
-
const {height: height} = attrs, {valueColumn: valueColumn} = tooltipStyle;
|
|
66
|
-
return mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({
|
|
67
|
-
height: getPixelPropertyStr(height)
|
|
68
|
-
}, defaultLabelStyle), valueColumn.common), null === (_a = valueColumn.items) || void 0 === _a ? void 0 : _a[i]));
|
|
69
|
-
})(0, attrs, i)) : "shape-box" === this.className && (null === (_a = this.children[i]) || void 0 === _a || _a.setStyle(((line, attrs, i) => {
|
|
70
|
-
var _a, _b, _c, _d;
|
|
71
|
-
const {height: height} = attrs, {shapeColumn: shapeColumn} = tooltipStyle, keyStyle = getKeyItemStyle(line, attrs, i), paddingTop = `calc((${null !== (_b = null !== (_a = keyStyle.lineHeight) && void 0 !== _a ? _a : keyStyle.fontSize) && void 0 !== _b ? _b : "18px"} - ${null !== (_c = shapeColumn.width) && void 0 !== _c ? _c : "8px"}) / 2)`;
|
|
72
|
-
return mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({
|
|
73
|
-
height: getPixelPropertyStr(height),
|
|
74
|
-
paddingTop: paddingTop
|
|
75
|
-
}, shapeColumn.common), null === (_d = shapeColumn.items) || void 0 === _d ? void 0 : _d[i]));
|
|
76
|
-
})(line, attrs, i), this._getShapeSvgOption(line, i)));
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
setContent() {
|
|
80
|
-
var _a, _b, _c, _d;
|
|
81
|
-
const renderContent = null !== (_b = null === (_a = this._option.getTooltipActual()) || void 0 === _a ? void 0 : _a.content) && void 0 !== _b ? _b : [];
|
|
82
|
-
(null !== (_d = null === (_c = this._option.getTooltipAttributes()) || void 0 === _c ? void 0 : _c.content) && void 0 !== _d ? _d : []).forEach(((attributes, i) => {
|
|
83
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
84
|
-
let childContent;
|
|
85
|
-
const line = renderContent[i];
|
|
86
|
-
if ("key-box" === this.className) {
|
|
87
|
-
const keyContent = line.key;
|
|
88
|
-
childContent = isString(keyContent) && "" !== (null === (_a = null == keyContent ? void 0 : keyContent.trim) || void 0 === _a ? void 0 : _a.call(keyContent)) || isNumber(keyContent) ? keyContent : TOOLTIP_EMPTY_STRING,
|
|
89
|
-
null === (_b = this.children[i]) || void 0 === _b || _b.setContent(childContent, null === (_c = attributes.key) || void 0 === _c ? void 0 : _c.multiLine);
|
|
90
|
-
} else if ("value-box" === this.className) {
|
|
91
|
-
const valueContent = line.value;
|
|
92
|
-
childContent = isString(valueContent) && "" !== (null === (_d = null == valueContent ? void 0 : valueContent.trim) || void 0 === _d ? void 0 : _d.call(valueContent)) || isNumber(valueContent) ? valueContent : TOOLTIP_EMPTY_STRING,
|
|
93
|
-
null === (_e = this.children[i]) || void 0 === _e || _e.setContent(childContent, null === (_f = attributes.value) || void 0 === _f ? void 0 : _f.multiLine);
|
|
94
|
-
} else "shape-box" === this.className && (childContent = this._getShapeSvgOption(line, i),
|
|
95
|
-
null === (_g = this.children[i]) || void 0 === _g || _g.setContent(childContent));
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
_getContentColumnStyle() {
|
|
99
|
-
var _a, _b;
|
|
100
|
-
const tooltipStyle = this._option.getTooltipStyle();
|
|
101
|
-
switch (this.className) {
|
|
102
|
-
case "shape-box":
|
|
103
|
-
const renderContent = null !== (_b = null === (_a = this._option.getTooltipActual()) || void 0 === _a ? void 0 : _a.content) && void 0 !== _b ? _b : [];
|
|
104
|
-
return Object.assign(Object.assign({}, tooltipStyle.shapeColumn), "shape-box" !== this.className || renderContent.some((c => c.hasShape && c.shapeType)) ? {} : {
|
|
105
|
-
display: "none"
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
case "key-box":
|
|
109
|
-
return tooltipStyle.keyColumn;
|
|
110
|
-
|
|
111
|
-
case "value-box":
|
|
112
|
-
return tooltipStyle.valueColumn;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
_getShapeSvgOption(line, index) {
|
|
116
|
-
var _a;
|
|
117
|
-
const tooltipStyle = this._option.getTooltipStyle(), shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), null === (_a = tooltipStyle.shapeColumn.items) || void 0 === _a ? void 0 : _a[index]);
|
|
118
|
-
return {
|
|
119
|
-
hasShape: line.hasShape,
|
|
120
|
-
symbolType: line.shapeType,
|
|
121
|
-
size: shapeColumn.width,
|
|
122
|
-
fill: line.shapeFill,
|
|
123
|
-
stroke: line.shapeStroke,
|
|
124
|
-
lineWidth: line.shapeLineWidth,
|
|
125
|
-
hollow: line.shapeHollow,
|
|
126
|
-
index: index
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=content-column-model.js.map
|