@visactor/vchart 1.11.4 → 1.11.5
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.es.js +112 -61
- package/build/index.js +112 -61
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +1 -0
- package/cjs/component/tooltip/interface/theme.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/data/transforms/waterfall.js +17 -6
- package/cjs/data/transforms/waterfall.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/interface.d.ts +1 -0
- package/cjs/plugin/components/tooltip-handler/dom/interface.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -3
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js +9 -14
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +7 -11
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js +8 -6
- package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +6 -5
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/interface/style.d.ts +1 -0
- package/cjs/plugin/components/tooltip-handler/interface/style.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js +8 -3
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js +24 -0
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/tooltip.js +0 -2
- package/cjs/theme/builtin/common/component/tooltip.js.map +1 -1
- package/cjs/theme/builtin/dark/color-scheme.js +4 -1
- package/cjs/theme/builtin/dark/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/light/color-scheme.js +4 -1
- package/cjs/theme/builtin/light/color-scheme.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +1 -0
- package/esm/component/tooltip/interface/theme.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/data/transforms/waterfall.js +17 -6
- package/esm/data/transforms/waterfall.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/interface.d.ts +1 -0
- package/esm/plugin/components/tooltip-handler/dom/interface.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -3
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.js +9 -14
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +5 -9
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/title-model.js +8 -6
- package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js +5 -4
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/interface/style.d.ts +1 -0
- package/esm/plugin/components/tooltip-handler/interface/style.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/attribute.js +7 -2
- package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/discrete-legend.js +24 -0
- package/esm/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/tooltip.js +0 -2
- package/esm/theme/builtin/common/component/tooltip.js.map +1 -1
- package/esm/theme/builtin/dark/color-scheme.js +4 -1
- package/esm/theme/builtin/dark/color-scheme.js.map +1 -1
- package/esm/theme/builtin/light/color-scheme.js +4 -1
- package/esm/theme/builtin/light/color-scheme.js.map +1 -1
- package/package.json +5 -5
|
@@ -28,12 +28,8 @@ export class ShapeModel extends BaseTooltipModel {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const builtInShape = {
|
|
32
|
-
star: "M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"
|
|
33
|
-
};
|
|
34
|
-
|
|
35
31
|
function getSvgHtml(option, valueToHtml) {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f
|
|
32
|
+
var _a, _b, _c, _d, _e, _f;
|
|
37
33
|
if (!(null == option ? void 0 : option.hasShape) || !option.symbolType) return "";
|
|
38
34
|
const {symbolType: symbolType, fill: fill, stroke: stroke, hollow: hollow = !1} = option, size = option.size ? valueToHtml(option.size) : "8px", lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + "px" : "0px";
|
|
39
35
|
let fillString = "currentColor";
|
|
@@ -42,7 +38,7 @@ function getSvgHtml(option, valueToHtml) {
|
|
|
42
38
|
size: sizeNumber,
|
|
43
39
|
fill: !0
|
|
44
40
|
});
|
|
45
|
-
let symbol = createSymbol(
|
|
41
|
+
let symbol = createSymbol(symbolType);
|
|
46
42
|
const parsedPath = symbol.getParsedPath();
|
|
47
43
|
parsedPath.path || (symbol = createSymbol(parsedPath.pathStr));
|
|
48
44
|
const pathModel = symbol.getParsedPath().path, path = pathModel.toString(), bounds = pathModel.bounds;
|
|
@@ -54,10 +50,10 @@ function getSvgHtml(option, valueToHtml) {
|
|
|
54
50
|
if (!fill || isString(fill) || hollow) return fillString = hollow ? "none" : fill ? valueToHtml(fill) : "currentColor",
|
|
55
51
|
`\n <svg width="${size}" height="${size}" viewBox="${viewBox}"\n style="display: block;">\n <path\n d="${path}"\n style="fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}"\n >\n </path>\n </svg>`;
|
|
56
52
|
if (isObject(fill)) {
|
|
57
|
-
fillString = null !== (
|
|
53
|
+
fillString = null !== (_a = "gradientColor" + option.index) && void 0 !== _a ? _a : "";
|
|
58
54
|
let gradient = "";
|
|
59
|
-
const stops = (null !== (
|
|
60
|
-
return "radial" === fill.gradient ? gradient = `<radialGradient id="${fillString}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${stops}\n </radialGradient>` : "linear" === fill.gradient && (gradient = `<linearGradient id="${fillString}" x1="${100 * (null !== (
|
|
55
|
+
const stops = (null !== (_b = fill.stops) && void 0 !== _b ? _b : []).map((s => `<stop offset="${valueToHtml(s.offset.toString())}" stop-color="${valueToHtml(s.color)}"/>`)).join("");
|
|
56
|
+
return "radial" === fill.gradient ? gradient = `<radialGradient id="${fillString}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${stops}\n </radialGradient>` : "linear" === fill.gradient && (gradient = `<linearGradient id="${fillString}" x1="${100 * (null !== (_c = fill.x0) && void 0 !== _c ? _c : 0)}%" y1="${100 * (null !== (_d = fill.y0) && void 0 !== _d ? _d : 0)}%" x2="${100 * (null !== (_e = fill.x1) && void 0 !== _e ? _e : 0)}%" y2="${100 * (null !== (_f = fill.y1) && void 0 !== _f ? _f : 0)}%">\n ${stops}\n </linearGradient>`),
|
|
61
57
|
`\n <svg width="${size}" height="${size}" viewBox="-0.5 -0.5 1 1"\n style="display: block;">\n ${gradient}\n <path\n d="${path}"\n style="fill: url(#${fillString}); stroke: ${getStroke()}; stroke-width: ${lineWidth}"\n >\n </path>\n </svg>`;
|
|
62
58
|
}
|
|
63
59
|
return "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/shape-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;;WAG1E,CAAC;KACT;IACD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,UAAU,GAAG,MAAA,eAAe,GAAG,MAAM,CAAC,KAAK,mCAAI,EAAE,CAAC;QAClD,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,iBAAiB,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;aACrG,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,IAAK,IAAuB,CAAC,QAAQ,KAAK,QAAQ,EAAE;YAClD,QAAQ,GAAG,uBAAuB,UAAU;QAC1C,KAAK;wBACW,CAAC;SACpB;aAAM,IAAK,IAAuB,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACzD,QAAQ,GAAG,uBAAuB,UAAU,SAC1C,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GACpD,UAAU,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GAAG,UAC7D,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GACpD,UAAU,CAAC,MAAE,IAAwB,CAAC,EAAa,mCAAI,CAAC,CAAC,GAAG,GAAG;QAC7D,KAAK;wBACW,CAAC;SACpB;QACD,OAAO;kBACO,IAAI,aAAa,IAAI;;QAE/B,QAAQ;;aAEH,IAAI;4BACW,UAAU,cAAc,SAAS,EAAE,mBAAmB,SAAS;;;WAGhF,CAAC;KACT;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","file":"shape-model.js","sourcesContent":["import type { IGradientColor, ILinearGradient } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { Symbol } from '@visactor/vrender-core';\n\nimport { isObject, isString } from '@visactor/vutils';\nimport type { ShapeType } from '../../../../../typings';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport { pixelPropertyStrToNumber } from '../utils';\n\nexport interface IShapeSvgOption {\n hasShape?: boolean;\n symbolType?: ShapeType | string;\n size?: string;\n fill?: string | IGradientColor;\n stroke?: string;\n lineWidth?: number;\n hollow?: boolean;\n marginTop?: string;\n index?: number;\n}\n\nexport class ShapeModel extends BaseTooltipModel {\n svg: SVGElement;\n\n private _svgHtmlCache: string;\n\n init(classList?: string[], id?: string, tag?: keyof HTMLElementTagNameMap): void {\n if (!this.product) {\n const container = this.createElement(tag ?? 'div', [...(classList ?? []), 'shape'], undefined, id);\n this.product = container;\n }\n }\n\n setStyle(style?: Partial<CSSStyleDeclaration>, option?: IShapeSvgOption): void {\n super.setStyle(style);\n this.setSvg(option);\n }\n\n setContent(option: IShapeSvgOption) {\n this.setSvg(option);\n }\n\n setSvg(option?: IShapeSvgOption) {\n const html = getSvgHtml(option, this._option.valueToHtml);\n if (this.product && html !== this._svgHtmlCache) {\n this._svgHtmlCache = html;\n this.product.innerHTML = html;\n }\n }\n\n release(): void {\n super.release();\n this._svgHtmlCache = '';\n }\n}\n\nfunction getSvgHtml(option: IShapeSvgOption | undefined, valueToHtml: (value: any) => string) {\n if (!option?.hasShape || !option.symbolType) {\n return '';\n }\n\n const { symbolType, fill, stroke, hollow = false } = option;\n const size = option.size ? valueToHtml(option.size) : '8px';\n const lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + 'px' : '0px';\n let fillString: string = 'currentColor';\n const getStroke = () => (stroke ? valueToHtml(stroke) : fillString);\n\n const sizeNumber = pixelPropertyStrToNumber(size) as number;\n const createSymbol = (symbolType: string) => new Symbol({ symbolType, size: sizeNumber, fill: true });\n\n let symbol = createSymbol(symbolType);\n const parsedPath = symbol.getParsedPath();\n if (!parsedPath.path) {\n symbol = createSymbol(parsedPath.pathStr);\n }\n const pathModel = symbol.getParsedPath().path;\n const path = pathModel.toString();\n const bounds = pathModel.bounds;\n let viewBox = `${bounds.x1} ${bounds.y1} ${bounds.width()} ${bounds.height()}`;\n\n // svg 不支持内描边,需要手动将描边空间预留在 viewBox 上\n if (lineWidth !== '0px') {\n const [x, y, w, h] = viewBox.split(' ').map(n => Number(n));\n const lw = Number(lineWidth.slice(0, -2));\n viewBox = `${x - lw / 2} ${y - lw / 2} ${w + lw} ${h + lw}`;\n }\n\n if (!fill || isString(fill) || hollow) {\n fillString = hollow ? 'none' : fill ? valueToHtml(fill) : 'currentColor';\n return `\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"${viewBox}\"\n style=\"display: block;\">\n <path\n d=\"${path}\"\n style=\"fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}\"\n >\n </path>\n </svg>`;\n }\n if (isObject(fill)) {\n fillString = 'gradientColor' + option.index ?? '';\n let gradient = '';\n const stops = (fill.stops ?? [])\n .map(s => `<stop offset=\"${valueToHtml(s.offset.toString())}\" stop-color=\"${valueToHtml(s.color)}\"/>`)\n .join('');\n if ((fill as IGradientColor).gradient === 'radial') {\n gradient = `<radialGradient id=\"${fillString}\" cx=\"50%\" cy=\"50%\" r=\"50%\" fx=\"0%\" fy=\"0%\">\n ${stops}\n </radialGradient>`;\n } else if ((fill as IGradientColor).gradient === 'linear') {\n gradient = `<linearGradient id=\"${fillString}\" x1=\"${\n (((fill as ILinearGradient).x0 as number) ?? 0) * 100\n }%\" y1=\"${(((fill as ILinearGradient).y0 as number) ?? 0) * 100}%\" x2=\"${\n (((fill as ILinearGradient).x1 as number) ?? 0) * 100\n }%\" y2=\"${(((fill as ILinearGradient).y1 as number) ?? 0) * 100}%\">\n ${stops}\n </linearGradient>`;\n }\n return `\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"-0.5 -0.5 1 1\"\n style=\"display: block;\">\n ${gradient}\n <path\n d=\"${path}\"\n style=\"fill: url(#${fillString}); stroke: ${getStroke()}; stroke-width: ${lineWidth}\"\n >\n </path>\n </svg>`;\n }\n\n return '';\n}\n"]}
|
|
@@ -12,20 +12,22 @@ export class TitleModel extends BaseTooltipModel {
|
|
|
12
12
|
init() {
|
|
13
13
|
const tooltipActual = this._option.getTooltipActual();
|
|
14
14
|
this.product || (this.product = this.createElement("h2"));
|
|
15
|
+
const {align: align} = this._option.getTooltipAttributes();
|
|
16
|
+
"right" !== align || this.textSpan || this._initTextSpan(0);
|
|
15
17
|
const {title: title} = tooltipActual;
|
|
16
|
-
(null == title ? void 0 : title.hasShape) && (null == title ? void 0 : title.shapeType) ? this.shape || this._initShape() : this.shape && this._releaseShape(),
|
|
17
|
-
this.textSpan || this._initTextSpan();
|
|
18
|
+
(null == title ? void 0 : title.hasShape) && (null == title ? void 0 : title.shapeType) ? this.shape || this._initShape("right" === align ? 1 : 0) : this.shape && this._releaseShape(),
|
|
19
|
+
"right" === align || this.textSpan || this._initTextSpan(1);
|
|
18
20
|
}
|
|
19
|
-
_initShape() {
|
|
20
|
-
const shape = new ShapeModel(this.product, this._option,
|
|
21
|
+
_initShape(index = 0) {
|
|
22
|
+
const shape = new ShapeModel(this.product, this._option, index);
|
|
21
23
|
shape.init(), this.shape = shape, this.children[shape.childIndex] = shape;
|
|
22
24
|
}
|
|
23
25
|
_releaseShape() {
|
|
24
26
|
this.shape && (this.shape.release(), delete this.children[this.shape.childIndex],
|
|
25
27
|
this.shape = null);
|
|
26
28
|
}
|
|
27
|
-
_initTextSpan() {
|
|
28
|
-
const textSpan = new TextModel(this.product, this._option,
|
|
29
|
+
_initTextSpan(index = 1) {
|
|
30
|
+
const textSpan = new TextModel(this.product, this._option, index);
|
|
29
31
|
textSpan.init(), this.textSpan = textSpan, this.children[textSpan.childIndex] = textSpan;
|
|
30
32
|
}
|
|
31
33
|
setStyle(style) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/model/title-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM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from '@visactor/vutils';\nimport { defaultH2Style } from './style-constants';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport { ShapeModel } from './shape-model';\nimport { TextModel } from './text-model';\nimport { mergeSpec } from '@visactor/vutils-extension';\n\nexport class TitleModel extends BaseTooltipModel {\n shape: Maybe<ShapeModel>;\n textSpan: Maybe<TextModel>;\n\n init(): void {\n const tooltipActual = this._option.getTooltipActual();\n\n if (!this.product) {\n this.product = this.createElement('h2');\n }\n const { align } = this._option.getTooltipAttributes();\n\n if (align === 'right' && !this.textSpan) {\n this._initTextSpan(0);\n }\n\n const { title } = tooltipActual;\n if (title?.hasShape && title?.shapeType) {\n if (!this.shape) {\n this._initShape(align === 'right' ? 1 : 0);\n }\n } else if (this.shape) {\n this._releaseShape();\n }\n\n if (align !== 'right' && !this.textSpan) {\n this._initTextSpan(1);\n }\n }\n\n private _initShape(index: number = 0) {\n const shape = new ShapeModel(this.product!, this._option, index);\n shape.init();\n this.shape = shape;\n this.children[shape.childIndex] = shape;\n }\n\n private _releaseShape() {\n if (!this.shape) {\n return;\n }\n this.shape.release();\n delete this.children[this.shape.childIndex];\n this.shape = null;\n }\n\n private _initTextSpan(index: number = 1) {\n const textSpan = new TextModel(this.product!, this._option, index);\n textSpan.init();\n this.textSpan = textSpan;\n this.children[textSpan.childIndex] = textSpan;\n }\n\n setStyle(style?: Partial<CSSStyleDeclaration>): void {\n const tooltipStyle = this._option.getTooltipStyle();\n const tooltipActual = this._option.getTooltipActual();\n\n const { title } = tooltipActual;\n super.setStyle(mergeSpec({}, defaultH2Style, tooltipStyle.title, style));\n\n this.shape?.setStyle(\n {\n paddingRight: tooltipStyle.shapeColumn.common?.marginRight\n },\n {\n hasShape: title?.hasShape,\n symbolType: title?.shapeType,\n size: tooltipStyle.shapeColumn.common?.width,\n fill: title?.shapeColor,\n hollow: title?.shapeHollow\n }\n );\n this.textSpan?.setStyle({\n color: 'inherit'\n });\n }\n\n setContent(): void {\n const tooltipStyle = this._option.getTooltipStyle();\n const tooltipActual = this._option.getTooltipActual();\n const tooltipAttributes = this._option.getTooltipAttributes();\n\n const { title } = tooltipActual;\n this.init();\n this.shape?.setStyle(undefined, {\n hasShape: title?.hasShape,\n symbolType: title?.shapeType,\n size: tooltipStyle.shapeColumn.common?.width,\n fill: title?.shapeColor,\n hollow: title?.shapeHollow\n });\n this.textSpan?.setStyle({\n color: 'inherit'\n });\n this.textSpan?.setContent(title?.value, tooltipAttributes.title?.value?.multiLine);\n }\n\n release(): void {\n super.release();\n this.shape = null;\n this.textSpan = null;\n }\n}\n"]}
|
|
@@ -10,8 +10,9 @@ const DEFAULT_SHAPE_SPACING = 8, DEFAULT_KEY_SPACING = 26, DEFAULT_VALUE_SPACING
|
|
|
10
10
|
|
|
11
11
|
export function getDomStyles(attributes) {
|
|
12
12
|
var _a, _b, _c;
|
|
13
|
-
const {panel: panel = {}, title: titleAttribute, content: contentAttribute, titleStyle: titleStyle = {}, contentStyle: contentStyle = {}, padding: padding, keyWidth: keyWidth, valueWidth: valueWidth, enterable: enterable, transitionDuration: transitionDuration, panelDomHeight: panelDomHeight = 0} = null != attributes ? attributes : {}, {fill: backgroundColor, shadow: shadow, shadowBlur: shadowBlur, shadowColor: shadowColor, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowSpread: shadowSpread, cornerRadius: cornerRadius, stroke: strokeColor, lineWidth: lineWidth = 0, width: width = 0} = panel, {value: title = {}} = titleStyle, {shape: shape = {}, key: key = {}, value: value = {}} = contentStyle, shapeStyle = getShapeStyle(shape), keyStyle = getLabelStyle(key), valueStyle = getLabelStyle(value), {bottom: bottom, left: left, right: right, top: top} = normalizeLayoutPaddingSpec(padding);
|
|
13
|
+
const {panel: panel = {}, title: titleAttribute, content: contentAttribute, titleStyle: titleStyle = {}, contentStyle: contentStyle = {}, padding: padding, keyWidth: keyWidth, valueWidth: valueWidth, enterable: enterable, transitionDuration: transitionDuration, panelDomHeight: panelDomHeight = 0, align: align = "left"} = null != attributes ? attributes : {}, {fill: backgroundColor, shadow: shadow, shadowBlur: shadowBlur, shadowColor: shadowColor, shadowOffsetX: shadowOffsetX, shadowOffsetY: shadowOffsetY, shadowSpread: shadowSpread, cornerRadius: cornerRadius, stroke: strokeColor, lineWidth: lineWidth = 0, width: width = 0} = panel, {value: title = {}} = titleStyle, {shape: shape = {}, key: key = {}, value: value = {}} = contentStyle, shapeStyle = getShapeStyle(shape), keyStyle = getLabelStyle(key), valueStyle = getLabelStyle(value), {bottom: bottom, left: left, right: right, top: top} = normalizeLayoutPaddingSpec(padding), marginKey = "right" === align ? "marginLeft" : "marginRight";
|
|
14
14
|
return {
|
|
15
|
+
align: align,
|
|
15
16
|
panel: {
|
|
16
17
|
width: getPixelPropertyStr(width + 2 * lineWidth),
|
|
17
18
|
minHeight: getPixelPropertyStr(panelDomHeight + 2 * lineWidth),
|
|
@@ -41,7 +42,7 @@ export function getDomStyles(attributes) {
|
|
|
41
42
|
marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : "0px"
|
|
42
43
|
}))),
|
|
43
44
|
width: getPixelPropertyStr(shape.size),
|
|
44
|
-
|
|
45
|
+
[marginKey]: getPixelPropertyStr(null !== (_a = shape.spacing) && void 0 !== _a ? _a : 8)
|
|
45
46
|
},
|
|
46
47
|
keyColumn: {
|
|
47
48
|
common: keyStyle,
|
|
@@ -52,7 +53,7 @@ export function getDomStyles(attributes) {
|
|
|
52
53
|
width: getPixelPropertyStr(Math.ceil(key.width))
|
|
53
54
|
} : void 0))),
|
|
54
55
|
width: getPixelPropertyStr(keyWidth),
|
|
55
|
-
|
|
56
|
+
[marginKey]: getPixelPropertyStr(null !== (_b = key.spacing) && void 0 !== _b ? _b : 26)
|
|
56
57
|
},
|
|
57
58
|
valueColumn: {
|
|
58
59
|
common: valueStyle,
|
|
@@ -63,7 +64,7 @@ export function getDomStyles(attributes) {
|
|
|
63
64
|
width: getPixelPropertyStr(Math.ceil(value.width))
|
|
64
65
|
} : void 0))),
|
|
65
66
|
width: getPixelPropertyStr(valueWidth),
|
|
66
|
-
|
|
67
|
+
[marginKey]: getPixelPropertyStr(null !== (_c = value.spacing) && void 0 !== _c ? _c : 0)
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/utils/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,UAAU,YAAY,CAAC,UAAsC;;IACjE,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,gBAAgB,EACzB,UAAU,GAAG,EAAE,EACf,YAAY,GAAG,EAAE,EACjB,OAAO,EACP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,cAAc,GAAG,CAAC,EACnB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC;IAErB,MAAM,EACJ,IAAI,EAAE,eAAe,EACrB,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,EAAE,WAAW,EACnB,SAAS,GAAG,CAAC,EACb,KAAK,GAAG,CAAC,EACV,GAAG,KAAK,CAAC;IAEV,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,UAAU,CAAC;IACzC,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,GAAG,EAA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AAU,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAgB,EAAE,CAAC;IAEjC,QAAQ,CAAC,KAAK,GAAG,mBAAmB,CAAC,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 } = 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\n const styles: IDomTooltipStyle = {\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 marginRight: 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 marginRight: 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 marginRight: 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
|
+
{"version":3,"sources":["../src/plugin/components/tooltip-handler/dom/utils/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;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AQ,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 +1 @@
|
|
|
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, RichTextWordBreak } 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 wordBreak?: RichTextWordBreak;\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"]}
|
|
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, RichTextWordBreak } 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 wordBreak?: RichTextWordBreak;\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"]}
|
|
@@ -49,7 +49,11 @@ export const getPanelAttributes = style => {
|
|
|
49
49
|
|
|
50
50
|
export const getTooltipAttributes = (actualTooltip, spec, globalTheme) => {
|
|
51
51
|
var _a, _b, _c, _d, _e;
|
|
52
|
-
const {style: style = {}, enterable: enterable, transitionDuration: transitionDuration} = spec, {panel: panel = {}, titleLabel: titleLabel, shape: shape, keyLabel: keyLabel, valueLabel: valueLabel, spaceRow: commonSpaceRow, maxContentHeight: maxContentHeight} = style, padding = normalizePadding(panel.padding), paddingSpec = normalizeLayoutPaddingSpec(panel.padding), titleStyle = getTextAttributes(
|
|
52
|
+
const {style: style = {}, enterable: enterable, transitionDuration: transitionDuration} = spec, {panel: panel = {}, titleLabel: titleLabel, shape: shape, keyLabel: keyLabel, valueLabel: valueLabel, spaceRow: commonSpaceRow, maxContentHeight: maxContentHeight, align: align} = style, padding = normalizePadding(panel.padding), paddingSpec = normalizeLayoutPaddingSpec(panel.padding), titleStyle = getTextAttributes(Object.assign({
|
|
53
|
+
textAlign: "right" === align ? "right" : "left"
|
|
54
|
+
}, titleLabel), globalTheme), keyStyle = getTextAttributes(Object.assign({
|
|
55
|
+
textAlign: "right" === align ? "right" : "left"
|
|
56
|
+
}, keyLabel), globalTheme), valueStyle = getTextAttributes(valueLabel, globalTheme), shapeStyle = {
|
|
53
57
|
fill: !0,
|
|
54
58
|
size: null !== (_a = null == shape ? void 0 : shape.size) && void 0 !== _a ? _a : 8,
|
|
55
59
|
spacing: null !== (_b = null == shape ? void 0 : shape.spacing) && void 0 !== _b ? _b : 6
|
|
@@ -73,7 +77,8 @@ export const getTooltipAttributes = (actualTooltip, spec, globalTheme) => {
|
|
|
73
77
|
valueWidth: 0,
|
|
74
78
|
maxContentHeight: maxContentHeight,
|
|
75
79
|
enterable: enterable,
|
|
76
|
-
transitionDuration: transitionDuration
|
|
80
|
+
transitionDuration: transitionDuration,
|
|
81
|
+
align: align
|
|
77
82
|
}, {title: title = {}, content: content = []} = actualTooltip;
|
|
78
83
|
let panelWidth = paddingSpec.left + paddingSpec.right, panelHeight = paddingSpec.top + paddingSpec.bottom, panelDomHeight = paddingSpec.top + paddingSpec.bottom, contentMaxWidth = 0;
|
|
79
84
|
const filteredContent = content.filter((item => (item.key || item.value) && !1 !== item.visible)), hasContent =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MAAM,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,cAAc,GAAG,cAAc,CAAC;IAC3C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","file":"attribute.js","sourcesContent":["import type {\n TooltipPanelAttrs,\n TooltipRowAttrs,\n TooltipRowStyleAttrs,\n TooltipSymbolAttrs,\n TooltipTextAttrs\n} from '@visactor/vrender-components';\nimport type { IPadding, ITooltipActual } from '../../../../typings';\nimport type { ITooltipAttributes, ITooltipTextStyle } from '../interface';\nimport { isValid, maxInArray, normalizePadding } from '@visactor/vutils';\nimport { mergeSpec } from '@visactor/vutils-extension';\nimport { normalizeLayoutPaddingSpec } from '../../../../util/space';\nimport { measureTooltipText } from './common';\nimport type { ITheme } from '../../../../theme';\nimport type { ITooltipSpec, ITooltipTextTheme, ITooltipTheme } from '../../../../component/tooltip';\nimport { token } from '../../../../theme/token';\n\nconst DEFAULT_TEXT_ATTRIBUTES: Partial<ITooltipTextStyle> = {\n fontFamily: token.fontFamily,\n spacing: 10,\n wordBreak: 'break-word'\n};\n\nexport function getTextAttributes(\n style: ITooltipTextTheme = {},\n globalTheme?: ITheme,\n defaultAttributes?: Partial<ITooltipTextStyle>\n): ITooltipTextStyle {\n const attrs: ITooltipTextStyle = {\n ...(defaultAttributes ?? DEFAULT_TEXT_ATTRIBUTES),\n fill: (style.fill ?? style.fontColor) as string,\n textAlign: style.textAlign,\n textBaseline: style.textBaseline,\n fontFamily: style.fontFamily ?? (globalTheme?.fontFamily as string),\n fontSize: style.fontSize as number,\n fontWeight: style.fontWeight,\n lineHeight: style.lineHeight as number,\n spacing: style.spacing,\n multiLine: style.multiLine,\n maxWidth: style.maxWidth,\n wordBreak: style.wordBreak,\n autoWidth: style.autoWidth\n };\n return attrs;\n}\n\nexport const getPanelAttributes = (style: ITooltipTheme['panel']): TooltipPanelAttrs => {\n const { backgroundColor, border, shadow } = style;\n const panelAttrs: TooltipPanelAttrs = {\n lineWidth: border?.width ?? 0,\n shadow: !!shadow\n };\n if (border?.color) {\n panelAttrs.stroke = border.color as string;\n }\n if (backgroundColor) {\n panelAttrs.fill = backgroundColor as string;\n }\n if (shadow) {\n panelAttrs.shadowColor = shadow.color as string;\n panelAttrs.shadowBlur = shadow.blur;\n panelAttrs.shadowOffsetX = shadow.x;\n panelAttrs.shadowOffsetY = shadow.y;\n panelAttrs.shadowSpread = shadow.spread;\n }\n const { radius } = border ?? {};\n if (isValid(radius)) {\n panelAttrs.cornerRadius = [radius, radius, radius, radius];\n }\n return panelAttrs;\n};\n\nexport const getTooltipAttributes = (\n actualTooltip: ITooltipActual,\n spec: ITooltipSpec,\n globalTheme: ITheme\n): ITooltipAttributes => {\n const { style = {}, enterable, transitionDuration } = spec;\n const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow: commonSpaceRow, maxContentHeight } = style;\n const padding = normalizePadding(panel.padding);\n const paddingSpec = normalizeLayoutPaddingSpec(panel.padding) as IPadding;\n\n const titleStyle = getTextAttributes(titleLabel, globalTheme);\n const keyStyle = getTextAttributes(keyLabel, globalTheme);\n const valueStyle = getTextAttributes(valueLabel, globalTheme);\n const shapeStyle: TooltipRowStyleAttrs['shape'] = {\n fill: true,\n size: shape?.size ?? 8,\n spacing: shape?.spacing ?? 6\n };\n\n const attributes: ITooltipAttributes = {\n panel: getPanelAttributes(panel),\n padding,\n\n title: {},\n content: [],\n\n titleStyle: {\n value: titleStyle,\n spaceRow: commonSpaceRow\n },\n contentStyle: {\n shape: shapeStyle,\n key: keyStyle,\n value: valueStyle,\n spaceRow: commonSpaceRow\n },\n hasContentShape: false,\n keyWidth: 0,\n valueWidth: 0,\n\n maxContentHeight,\n\n enterable,\n transitionDuration\n };\n\n const { title = {}, content = [] } = actualTooltip;\n\n let panelWidth = paddingSpec.left + paddingSpec.right;\n let panelHeight = paddingSpec.top + paddingSpec.bottom;\n /** dom tooltip 的高度。由于 canvas tooltip 不支持滚动条,dom tooltip 单独计算高度 */\n let panelDomHeight = paddingSpec.top + paddingSpec.bottom;\n\n // calculate content\n let contentMaxWidth = 0;\n // filter content\n const filteredContent = content.filter(item => {\n return (item.key || item.value) && item.visible !== false;\n });\n const hasContent = !!filteredContent.length;\n let maxKeyWidth = 0;\n let maxAdaptiveKeyWidth = 0;\n let maxValueWidth = 0;\n let maxShapeWidth = 0;\n\n if (hasContent) {\n const keyWidths: number[] = [];\n const adaptiveKeyWidths: number[] = [];\n const valueWidths: number[] = [];\n const shapeWidths: number[] = [];\n\n let contentHeight = 0;\n attributes.content = filteredContent.map((item, i) => {\n let itemHeight = 0;\n const {\n hasShape: actualHasShape,\n key: actualKey,\n shapeType: actualShapeType = '',\n shapeFill: actualShapeFill,\n shapeStroke: actualShapeStroke,\n shapeLineWidth: actualShapeLineWidth,\n shapeSize: actualShapeSize,\n value: actualValue,\n isKeyAdaptive: actualIsKeyAdaptive,\n spaceRow: actualSpaceRow,\n keyStyle: actualKeyStyle,\n valueStyle: actualValueStyle,\n shapeHollow: actualShapeHollow,\n // 弃用的属性,做下兼容\n shapeColor: actualShapeColor\n } = item;\n const itemAttrs: TooltipRowAttrs = { height: 0, spaceRow: actualSpaceRow ?? commonSpaceRow };\n if (isValid(actualKey)) {\n const itemKeyStyle: ITooltipTextStyle = mergeSpec(\n {},\n keyStyle,\n getTextAttributes(actualKeyStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualKey, itemKeyStyle);\n itemAttrs.key = {\n width,\n height,\n ...itemKeyStyle,\n text\n };\n if (!actualIsKeyAdaptive) {\n keyWidths.push(width);\n } else {\n adaptiveKeyWidths.push(width);\n }\n itemHeight = Math.max(itemHeight, height);\n }\n if (isValid(actualValue)) {\n const itemValueStyle: ITooltipTextStyle = mergeSpec(\n {},\n valueStyle,\n getTextAttributes(actualValueStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualValue, itemValueStyle);\n itemAttrs.value = {\n width,\n height,\n ...itemValueStyle,\n text\n };\n valueWidths.push(width);\n itemHeight = Math.max(itemHeight, height);\n }\n if (actualHasShape) {\n const shape: TooltipSymbolAttrs = {\n visible: true,\n symbolType: actualShapeType\n };\n const adaptiveShapeFill = actualShapeFill ?? actualShapeColor;\n if (actualShapeHollow) {\n shape.stroke = adaptiveShapeFill;\n } else {\n shape.fill = adaptiveShapeFill;\n }\n shape.stroke = actualShapeStroke ?? adaptiveShapeFill;\n shape.lineWidth = actualShapeLineWidth;\n itemAttrs.shape = shape;\n\n const shapeWidth = actualShapeSize ?? shapeStyle.size;\n itemHeight = Math.max(shapeWidth, itemHeight);\n shapeWidths.push(shapeWidth);\n } else {\n itemAttrs.shape = { visible: false };\n }\n\n itemAttrs.height = itemHeight;\n contentHeight += itemHeight;\n if (i < filteredContent.length - 1) {\n contentHeight += itemAttrs.spaceRow;\n }\n\n return itemAttrs;\n });\n panelHeight += contentHeight;\n panelDomHeight += Math.min(contentHeight, maxContentHeight ?? Infinity);\n\n maxKeyWidth = keyWidths.length ? maxInArray(keyWidths) : 0; // name 需要对齐\n maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? maxInArray(adaptiveKeyWidths) : 0;\n maxValueWidth = valueWidths.length ? maxInArray(valueWidths) : 0; // value 需要对齐\n maxShapeWidth = shapeWidths.length ? maxInArray(shapeWidths) + shapeStyle.spacing : 0; // shape 列宽度\n contentMaxWidth = Math.max(\n maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing,\n maxShapeWidth + maxAdaptiveKeyWidth,\n contentMaxWidth\n );\n attributes.hasContentShape = !!shapeWidths.length;\n attributes.keyWidth = maxKeyWidth;\n attributes.valueWidth = maxValueWidth;\n }\n\n // calculate title\n let titleMaxWidth = 0;\n let titleMaxHeight = 0;\n let titleHeightWithSpace = 0;\n const {\n visible: actualTitleVisible = true,\n value: actualTitleValue = '',\n valueStyle: actualTitleValueStyle,\n spaceRow: actualTitleSpaceRow\n } = title;\n attributes.title.visible = actualTitleVisible;\n attributes.title.spaceRow = actualTitleSpaceRow ?? commonSpaceRow;\n\n let titleValueStyle: ITooltipTextStyle = {};\n // 当前是否处于自适应宽度模式\n const isAutoWidthMode = () => titleValueStyle.autoWidth && titleValueStyle.multiLine !== false;\n if (actualTitleVisible) {\n titleValueStyle = mergeSpec({}, titleStyle, getTextAttributes(actualTitleValueStyle, undefined, {}));\n // 标题默认优化策略:如果 autoWidth 为 true,则宽度默认跟随 content 宽度并开启自动换行\n if (isAutoWidthMode()) {\n titleValueStyle.multiLine = titleValueStyle.multiLine ?? true;\n titleValueStyle.maxWidth = titleValueStyle.maxWidth ?? (hasContent ? Math.ceil(contentMaxWidth) : undefined);\n }\n\n const { text, width, height } = measureTooltipText(actualTitleValue, titleValueStyle);\n attributes.title.value = {\n width: isAutoWidthMode() ? Math.min(width, titleValueStyle.maxWidth ?? Number.MAX_VALUE) : width,\n height,\n ...titleValueStyle,\n text\n };\n titleMaxWidth = attributes.title.value.width;\n titleMaxHeight = attributes.title.value.height;\n\n titleHeightWithSpace = titleMaxHeight + (hasContent ? attributes.title.spaceRow : 0);\n }\n panelHeight += titleHeightWithSpace;\n panelDomHeight += titleHeightWithSpace;\n attributes.title.width = titleMaxWidth;\n attributes.title.height = titleMaxHeight;\n\n if (isAutoWidthMode()) {\n panelWidth += contentMaxWidth ? contentMaxWidth : titleMaxWidth;\n } else {\n panelWidth += Math.max(titleMaxWidth, contentMaxWidth);\n }\n\n // 处理 content 的自动宽度模式\n if (hasContent) {\n attributes.content.forEach(item => {\n const value = item.value as ITooltipTextStyle & TooltipTextAttrs;\n // 最后一列默认自适应宽度\n if (value && (value.autoWidth ?? true)) {\n value.width =\n panelWidth -\n paddingSpec.left -\n paddingSpec.right -\n maxShapeWidth -\n maxKeyWidth -\n keyStyle.spacing -\n valueStyle.spacing;\n //value.multiLine = true; multiLine 需要用户手动开启,不会自动开启\n if (!value.maxWidth) {\n value.maxWidth = Math.ceil(value.width);\n }\n attributes.valueWidth = Math.max(attributes.valueWidth, value.width);\n }\n });\n }\n\n attributes.panel.width = panelWidth;\n attributes.panel.height = panelHeight;\n attributes.panelDomHeight = panelDomHeight;\n return attributes;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin/components/tooltip-handler/utils/attribute.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,MAAM,uBAAuB,GAA+B;IAC1D,UAAU,EAAE,KAAK,CAAC,UAAU;IAC5B,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAC/B,QAA2B,EAAE,EAC7B,WAAoB,EACpB,iBAA8C;;IAE9C,MAAM,KAAK,mCACN,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,uBAAuB,CAAC,KACjD,IAAI,EAAE,CAAC,MAAA,KAAK,CAAC,IAAI,mCAAI,KAAK,CAAC,SAAS,CAAW,EAC/C,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,UAAU,EAAE,MAAA,KAAK,CAAC,UAAU,mCAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAqB,EACnE,QAAQ,EAAE,KAAK,CAAC,QAAkB,EAClC,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,UAAU,EAAE,KAAK,CAAC,UAAoB,EACtC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,C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G,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aACtE;QACH,CAAC,CAAC,CAAC;KACJ;IAED,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;IACpC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,cAAc,GAAG,cAAc,CAAC;IAC3C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","file":"attribute.js","sourcesContent":["import type {\n TooltipPanelAttrs,\n TooltipRowAttrs,\n TooltipRowStyleAttrs,\n TooltipSymbolAttrs,\n TooltipTextAttrs\n} from '@visactor/vrender-components';\nimport type { IPadding, ITooltipActual } from '../../../../typings';\nimport type { ITooltipAttributes, ITooltipTextStyle } from '../interface';\nimport { isValid, maxInArray, normalizePadding } from '@visactor/vutils';\nimport { mergeSpec } from '@visactor/vutils-extension';\nimport { normalizeLayoutPaddingSpec } from '../../../../util/space';\nimport { measureTooltipText } from './common';\nimport type { ITheme } from '../../../../theme';\nimport type { ITooltipSpec, ITooltipTextTheme, ITooltipTheme } from '../../../../component/tooltip';\nimport { token } from '../../../../theme/token';\n\nconst DEFAULT_TEXT_ATTRIBUTES: Partial<ITooltipTextStyle> = {\n fontFamily: token.fontFamily,\n spacing: 10,\n wordBreak: 'break-word'\n};\n\nexport function getTextAttributes(\n style: ITooltipTextTheme = {},\n globalTheme?: ITheme,\n defaultAttributes?: Partial<ITooltipTextStyle>\n): ITooltipTextStyle {\n const attrs: ITooltipTextStyle = {\n ...(defaultAttributes ?? DEFAULT_TEXT_ATTRIBUTES),\n fill: (style.fill ?? style.fontColor) as string,\n textAlign: style.textAlign,\n textBaseline: style.textBaseline,\n fontFamily: style.fontFamily ?? (globalTheme?.fontFamily as string),\n fontSize: style.fontSize as number,\n fontWeight: style.fontWeight,\n lineHeight: style.lineHeight as number,\n spacing: style.spacing,\n multiLine: style.multiLine,\n maxWidth: style.maxWidth,\n wordBreak: style.wordBreak,\n autoWidth: style.autoWidth\n };\n return attrs;\n}\n\nexport const getPanelAttributes = (style: ITooltipTheme['panel']): TooltipPanelAttrs => {\n const { backgroundColor, border, shadow } = style;\n const panelAttrs: TooltipPanelAttrs = {\n lineWidth: border?.width ?? 0,\n shadow: !!shadow\n };\n if (border?.color) {\n panelAttrs.stroke = border.color as string;\n }\n if (backgroundColor) {\n panelAttrs.fill = backgroundColor as string;\n }\n if (shadow) {\n panelAttrs.shadowColor = shadow.color as string;\n panelAttrs.shadowBlur = shadow.blur;\n panelAttrs.shadowOffsetX = shadow.x;\n panelAttrs.shadowOffsetY = shadow.y;\n panelAttrs.shadowSpread = shadow.spread;\n }\n const { radius } = border ?? {};\n if (isValid(radius)) {\n panelAttrs.cornerRadius = [radius, radius, radius, radius];\n }\n return panelAttrs;\n};\n\nexport const getTooltipAttributes = (\n actualTooltip: ITooltipActual,\n spec: ITooltipSpec,\n globalTheme: ITheme\n): ITooltipAttributes => {\n const { style = {}, enterable, transitionDuration } = spec;\n const {\n panel = {},\n titleLabel,\n shape,\n keyLabel,\n valueLabel,\n spaceRow: commonSpaceRow,\n maxContentHeight,\n align\n } = style;\n const padding = normalizePadding(panel.padding);\n const paddingSpec = normalizeLayoutPaddingSpec(panel.padding) as IPadding;\n\n const titleStyle = getTextAttributes(\n {\n textAlign: align === 'right' ? 'right' : 'left',\n ...titleLabel\n },\n globalTheme\n );\n const keyStyle = getTextAttributes(\n {\n textAlign: align === 'right' ? 'right' : 'left',\n ...keyLabel\n },\n globalTheme\n );\n const valueStyle = getTextAttributes(valueLabel, globalTheme);\n const shapeStyle: TooltipRowStyleAttrs['shape'] = {\n fill: true,\n size: shape?.size ?? 8,\n spacing: shape?.spacing ?? 6\n };\n\n const attributes: ITooltipAttributes = {\n panel: getPanelAttributes(panel),\n padding,\n\n title: {},\n content: [],\n\n titleStyle: {\n value: titleStyle,\n spaceRow: commonSpaceRow\n },\n contentStyle: {\n shape: shapeStyle,\n key: keyStyle,\n value: valueStyle,\n spaceRow: commonSpaceRow\n },\n hasContentShape: false,\n keyWidth: 0,\n valueWidth: 0,\n\n maxContentHeight,\n\n enterable,\n transitionDuration,\n align\n };\n\n const { title = {}, content = [] } = actualTooltip;\n\n let panelWidth = paddingSpec.left + paddingSpec.right;\n let panelHeight = paddingSpec.top + paddingSpec.bottom;\n /** dom tooltip 的高度。由于 canvas tooltip 不支持滚动条,dom tooltip 单独计算高度 */\n let panelDomHeight = paddingSpec.top + paddingSpec.bottom;\n\n // calculate content\n let contentMaxWidth = 0;\n // filter content\n const filteredContent = content.filter(item => {\n return (item.key || item.value) && item.visible !== false;\n });\n const hasContent = !!filteredContent.length;\n let maxKeyWidth = 0;\n let maxAdaptiveKeyWidth = 0;\n let maxValueWidth = 0;\n let maxShapeWidth = 0;\n\n if (hasContent) {\n const keyWidths: number[] = [];\n const adaptiveKeyWidths: number[] = [];\n const valueWidths: number[] = [];\n const shapeWidths: number[] = [];\n\n let contentHeight = 0;\n attributes.content = filteredContent.map((item, i) => {\n let itemHeight = 0;\n const {\n hasShape: actualHasShape,\n key: actualKey,\n shapeType: actualShapeType = '',\n shapeFill: actualShapeFill,\n shapeStroke: actualShapeStroke,\n shapeLineWidth: actualShapeLineWidth,\n shapeSize: actualShapeSize,\n value: actualValue,\n isKeyAdaptive: actualIsKeyAdaptive,\n spaceRow: actualSpaceRow,\n keyStyle: actualKeyStyle,\n valueStyle: actualValueStyle,\n shapeHollow: actualShapeHollow,\n // 弃用的属性,做下兼容\n shapeColor: actualShapeColor\n } = item;\n const itemAttrs: TooltipRowAttrs = { height: 0, spaceRow: actualSpaceRow ?? commonSpaceRow };\n if (isValid(actualKey)) {\n const itemKeyStyle: ITooltipTextStyle = mergeSpec(\n {},\n keyStyle,\n getTextAttributes(actualKeyStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualKey, itemKeyStyle);\n itemAttrs.key = {\n width,\n height,\n ...itemKeyStyle,\n text\n };\n if (!actualIsKeyAdaptive) {\n keyWidths.push(width);\n } else {\n adaptiveKeyWidths.push(width);\n }\n itemHeight = Math.max(itemHeight, height);\n }\n if (isValid(actualValue)) {\n const itemValueStyle: ITooltipTextStyle = mergeSpec(\n {},\n valueStyle,\n getTextAttributes(actualValueStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualValue, itemValueStyle);\n itemAttrs.value = {\n width,\n height,\n ...itemValueStyle,\n text\n };\n valueWidths.push(width);\n itemHeight = Math.max(itemHeight, height);\n }\n if (actualHasShape) {\n const shape: TooltipSymbolAttrs = {\n visible: true,\n symbolType: actualShapeType\n };\n const adaptiveShapeFill = actualShapeFill ?? actualShapeColor;\n if (actualShapeHollow) {\n shape.stroke = adaptiveShapeFill;\n } else {\n shape.fill = adaptiveShapeFill;\n }\n shape.stroke = actualShapeStroke ?? adaptiveShapeFill;\n shape.lineWidth = actualShapeLineWidth;\n itemAttrs.shape = shape;\n\n const shapeWidth = actualShapeSize ?? shapeStyle.size;\n itemHeight = Math.max(shapeWidth, itemHeight);\n shapeWidths.push(shapeWidth);\n } else {\n itemAttrs.shape = { visible: false };\n }\n\n itemAttrs.height = itemHeight;\n contentHeight += itemHeight;\n if (i < filteredContent.length - 1) {\n contentHeight += itemAttrs.spaceRow;\n }\n\n return itemAttrs;\n });\n panelHeight += contentHeight;\n panelDomHeight += Math.min(contentHeight, maxContentHeight ?? Infinity);\n\n maxKeyWidth = keyWidths.length ? maxInArray(keyWidths) : 0; // name 需要对齐\n maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? maxInArray(adaptiveKeyWidths) : 0;\n maxValueWidth = valueWidths.length ? maxInArray(valueWidths) : 0; // value 需要对齐\n maxShapeWidth = shapeWidths.length ? maxInArray(shapeWidths) + shapeStyle.spacing : 0; // shape 列宽度\n contentMaxWidth = Math.max(\n maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing,\n maxShapeWidth + maxAdaptiveKeyWidth,\n contentMaxWidth\n );\n attributes.hasContentShape = !!shapeWidths.length;\n attributes.keyWidth = maxKeyWidth;\n attributes.valueWidth = maxValueWidth;\n }\n\n // calculate title\n let titleMaxWidth = 0;\n let titleMaxHeight = 0;\n let titleHeightWithSpace = 0;\n const {\n visible: actualTitleVisible = true,\n value: actualTitleValue = '',\n valueStyle: actualTitleValueStyle,\n spaceRow: actualTitleSpaceRow\n } = title;\n attributes.title.visible = actualTitleVisible;\n attributes.title.spaceRow = actualTitleSpaceRow ?? commonSpaceRow;\n\n let titleValueStyle: ITooltipTextStyle = {};\n // 当前是否处于自适应宽度模式\n const isAutoWidthMode = () => titleValueStyle.autoWidth && titleValueStyle.multiLine !== false;\n if (actualTitleVisible) {\n titleValueStyle = mergeSpec({}, titleStyle, getTextAttributes(actualTitleValueStyle, undefined, {}));\n // 标题默认优化策略:如果 autoWidth 为 true,则宽度默认跟随 content 宽度并开启自动换行\n if (isAutoWidthMode()) {\n titleValueStyle.multiLine = titleValueStyle.multiLine ?? true;\n titleValueStyle.maxWidth = titleValueStyle.maxWidth ?? (hasContent ? Math.ceil(contentMaxWidth) : undefined);\n }\n\n const { text, width, height } = measureTooltipText(actualTitleValue, titleValueStyle);\n attributes.title.value = {\n width: isAutoWidthMode() ? Math.min(width, titleValueStyle.maxWidth ?? Number.MAX_VALUE) : width,\n height,\n ...titleValueStyle,\n text\n };\n titleMaxWidth = attributes.title.value.width;\n titleMaxHeight = attributes.title.value.height;\n\n titleHeightWithSpace = titleMaxHeight + (hasContent ? attributes.title.spaceRow : 0);\n }\n panelHeight += titleHeightWithSpace;\n panelDomHeight += titleHeightWithSpace;\n attributes.title.width = titleMaxWidth;\n attributes.title.height = titleMaxHeight;\n\n if (isAutoWidthMode()) {\n panelWidth += contentMaxWidth ? contentMaxWidth : titleMaxWidth;\n } else {\n panelWidth += Math.max(titleMaxWidth, contentMaxWidth);\n }\n\n // 处理 content 的自动宽度模式\n if (hasContent) {\n attributes.content.forEach(item => {\n const value = item.value as ITooltipTextStyle & TooltipTextAttrs;\n // 最后一列默认自适应宽度\n if (value && (value.autoWidth ?? true)) {\n value.width =\n panelWidth -\n paddingSpec.left -\n paddingSpec.right -\n maxShapeWidth -\n maxKeyWidth -\n keyStyle.spacing -\n valueStyle.spacing;\n //value.multiLine = true; multiLine 需要用户手动开启,不会自动开启\n if (!value.maxWidth) {\n value.maxWidth = Math.ceil(value.width);\n }\n attributes.valueWidth = Math.max(attributes.valueWidth, value.width);\n }\n });\n }\n\n attributes.panel.width = panelWidth;\n attributes.panel.height = panelHeight;\n attributes.panelDomHeight = panelDomHeight;\n return attributes;\n};\n"]}
|
|
@@ -22,6 +22,30 @@ export const discreteLegend = {
|
|
|
22
22
|
},
|
|
23
23
|
space: 12
|
|
24
24
|
},
|
|
25
|
+
pager: {
|
|
26
|
+
textStyle: {
|
|
27
|
+
fill: {
|
|
28
|
+
type: "palette",
|
|
29
|
+
key: "discreteLegendPagerTextColor"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
handler: {
|
|
33
|
+
style: {
|
|
34
|
+
fill: {
|
|
35
|
+
type: "palette",
|
|
36
|
+
key: "discreteLegendPagerHandlerColor"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
state: {
|
|
40
|
+
disable: {
|
|
41
|
+
fill: {
|
|
42
|
+
type: "palette",
|
|
43
|
+
key: "discreteLegendPagerHandlerDisableColor"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
25
49
|
item: {
|
|
26
50
|
visible: !0,
|
|
27
51
|
spaceCol: 10,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/legend/discrete-legend.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACjB,KAAK,EAAE;QACL,OAA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ElD,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;oBAClD,OAAO,EAAE,CAAC;iBACX;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC","file":"discrete-legend.js","sourcesContent":["import type { IDiscreteLegendTheme } from '../../../../../component/legend';\n\nexport const discreteLegend: IDiscreteLegendTheme = {\n orient: 'bottom',\n position: 'middle',\n padding: [16, 24],\n title: {\n visible: false,\n padding: 0,\n textStyle: {\n fontSize: { type: 'token', key: 'l5FontSize' },\n lineHeight: { type: 'token', key: 'l5LineHeight' },\n\n fill: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'normal'\n },\n space: 12\n },\n item: {\n visible: true,\n spaceCol: 10,\n spaceRow: 6,\n padding: 2,\n background: {\n state: {\n selectedHover: {\n fill: { type: 'palette', key: 'hoverBackgroundColor' }\n },\n unSelectedHover: {\n fill: { type: 'palette', key: 'hoverBackgroundColor' }\n }\n }\n },\n shape: {\n space: 6,\n style: {\n lineWidth: 0,\n fillOpacity: 1,\n opacity: 1 // 覆盖 vrender-components 里的默认值\n },\n state: {\n unSelected: {\n fillOpacity: 0.2,\n opacity: 1 // 覆盖 vrender-components 里的默认值\n }\n }\n },\n label: {\n space: 6,\n style: {\n fill: { type: 'palette', key: 'secondaryFontColor', default: '#89909d' },\n fontSize: { type: 'token', key: 'l5FontSize' },\n lineHeight: { type: 'token', key: 'l5LineHeight' },\n\n opacity: 1 // 覆盖 vrender-components 里的默认值\n },\n state: {\n unSelected: {\n fill: { type: 'palette', key: 'disableFontColor' },\n opacity: 1 // 覆盖 vrender-components 里的默认值\n }\n }\n }\n },\n allowAllCanceled: false\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common/component/legend/discrete-legend.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAA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AE;gBACL,SAAS,EAAE,CAAC;gBACZ,WAAW,EAAE,CAAC;gBACd,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,WAAW,EAAE,GAAG;oBAChB,OAAO,EAAE,CAAC;iBACX;aACF;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,CAAC;YACR,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,EAAE,SAAS,EAAE;gBACxE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE;gBAC9C,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE;gBAElD,OAAO,EAAE,CAAC;aACX;YACD,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;oBAClD,OAAO,EAAE,CAAC;iBACX;aACF;SACF;KACF;IACD,gBAAgB,EAAE,KAAK;CACxB,CAAC","file":"discrete-legend.js","sourcesContent":["import type { IDiscreteLegendTheme } from '../../../../../component/legend';\n\nexport const discreteLegend: IDiscreteLegendTheme = {\n orient: 'bottom',\n position: 'middle',\n padding: [16, 24],\n title: {\n visible: false,\n padding: 0,\n textStyle: {\n fontSize: { type: 'token', key: 'l5FontSize' },\n lineHeight: { type: 'token', key: 'l5LineHeight' },\n\n fill: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'normal'\n },\n space: 12\n },\n pager: {\n textStyle: {\n fill: { type: 'palette', key: 'discreteLegendPagerTextColor' }\n },\n handler: {\n style: {\n fill: { type: 'palette', key: 'discreteLegendPagerHandlerColor' }\n },\n state: {\n disable: {\n fill: { type: 'palette', key: 'discreteLegendPagerHandlerDisableColor' }\n }\n }\n }\n },\n item: {\n visible: true,\n spaceCol: 10,\n spaceRow: 6,\n padding: 2,\n background: {\n state: {\n selectedHover: {\n fill: { type: 'palette', key: 'hoverBackgroundColor' }\n },\n unSelectedHover: {\n fill: { type: 'palette', key: 'hoverBackgroundColor' }\n }\n }\n },\n shape: {\n space: 6,\n style: {\n lineWidth: 0,\n fillOpacity: 1,\n opacity: 1 // 覆盖 vrender-components 里的默认值\n },\n state: {\n unSelected: {\n fillOpacity: 0.2,\n opacity: 1 // 覆盖 vrender-components 里的默认值\n }\n }\n },\n label: {\n space: 6,\n style: {\n fill: { type: 'palette', key: 'secondaryFontColor', default: '#89909d' },\n fontSize: { type: 'token', key: 'l5FontSize' },\n lineHeight: { type: 'token', key: 'l5LineHeight' },\n\n opacity: 1 // 覆盖 vrender-components 里的默认值\n },\n state: {\n unSelected: {\n fill: { type: 'palette', key: 'disableFontColor' },\n opacity: 1 // 覆盖 vrender-components 里的默认值\n }\n }\n }\n },\n allowAllCanceled: false\n};\n"]}
|
|
@@ -48,7 +48,6 @@ export const tooltip = {
|
|
|
48
48
|
key: "primaryFontColor"
|
|
49
49
|
},
|
|
50
50
|
fontWeight: "bold",
|
|
51
|
-
textAlign: "left",
|
|
52
51
|
textBaseline: "middle",
|
|
53
52
|
spacing: 0
|
|
54
53
|
},
|
|
@@ -69,7 +68,6 @@ export const tooltip = {
|
|
|
69
68
|
type: "palette",
|
|
70
69
|
key: "secondaryFontColor"
|
|
71
70
|
},
|
|
72
|
-
textAlign: "left",
|
|
73
71
|
textBaseline: "middle",
|
|
74
72
|
spacing: 26
|
|
75
73
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/tooltip.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,OAAO,GAAsC;IACxD,MAAM,EAAE;QACN,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,EAAE;KACN;IACD,KAAK,EAAE;QACL,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,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CACF,CAAC","file":"tooltip.js","sourcesContent":["import type { ITooltipTheme } from '../../../../component/tooltip/interface';\nimport type { IColorKey } from '../../../color-scheme';\n\nexport const tooltip: ITooltipTheme<string | IColorKey> = {\n offset: {\n x: 10,\n y: 10\n },\n panel: {\n padding: {\n top: 10,\n left: 10,\n right: 10,\n bottom: 10\n },\n backgroundColor: { type: 'palette', key: 'popupBackgroundColor' },\n border: {\n color: { type: 'palette', key: 'popupBackgroundColor' },\n width: 0,\n radius: 3\n },\n shadow: {\n x: 0,\n y: 4,\n blur: 12,\n spread: 0,\n color: { type: 'palette', key: 'shadowColor' }\n }\n },\n spaceRow: 6,\n titleLabel: {\n fontSize: { type: 'token', key: 'l4FontSize' },\n lineHeight: { type: 'token', key: 'l4LineHeight' },\n\n fontColor: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'bold',\n textBaseline: 'middle',\n spacing: 0\n },\n shape: {\n size: 8,\n spacing: 6\n },\n keyLabel: {\n fontSize: { type: 'token', key: 'l4FontSize' },\n lineHeight: { type: 'token', key: 'l4LineHeight' },\n\n fontColor: { type: 'palette', key: 'secondaryFontColor' },\n textBaseline: 'middle',\n spacing: 26\n },\n valueLabel: {\n fontSize: { type: 'token', key: 'l4FontSize' },\n lineHeight: { type: 'token', key: 'l4LineHeight' },\n\n fontColor: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'bold',\n textBaseline: 'middle',\n spacing: 0\n }\n};\n"]}
|
|
@@ -30,7 +30,10 @@ export const colorScheme = {
|
|
|
30
30
|
dangerColor: "#eb4b4b",
|
|
31
31
|
warningColor: "#f0bd30",
|
|
32
32
|
successColor: "#14b267",
|
|
33
|
-
infoColor: "#4284ff"
|
|
33
|
+
infoColor: "#4284ff",
|
|
34
|
+
discreteLegendPagerTextColor: "#BBBDC3",
|
|
35
|
+
discreteLegendPagerHandlerColor: "#BBBDC3",
|
|
36
|
+
discreteLegendPagerHandlerDisableColor: "#55595F"
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/dark/color-scheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,iBAAiB;YAE9B,oBAAoB,EAAE,SAAS;YAE/B,eAAe,EAAE,SAAS;YAE1B,iBAAiB,EAAE,SAAS;YAE5B,gBAAgB,EAAE,SAAS;YAE3B,oBAAoB,EAAE,SAAS;YAG/B,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,iBAAiB,EAAE,SAAS;YAE5B,kBAAkB,EAAE,SAAS;YAE7B,gBAAgB,EAAE,SAAS;YAE3B,mBAAmB,EAAE,SAAS;YAG9B,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,yBAAyB,EAAE,SAAS;YAEpC,kBAAkB,EAAE,SAAS;YAG7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,uBAAuB;YAG7C,yBAAyB,EAAE,SAAS;YAEpC,wBAAwB,EAAE,SAAS;YAEnC,mBAAmB,EAAE,SAAS;YAG9B,WAAW,EAAE,SAAS;YAEtB,YAAY,EAAE,SAAS;YAEvB,YAAY,EAAE,SAAS;YAEvB,SAAS,EAAE,SAAS;
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/dark/color-scheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,iBAAiB;YAE9B,oBAAoB,EAAE,SAAS;YAE/B,eAAe,EAAE,SAAS;YAE1B,iBAAiB,EAAE,SAAS;YAE5B,gBAAgB,EAAE,SAAS;YAE3B,oBAAoB,EAAE,SAAS;YAG/B,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,iBAAiB,EAAE,SAAS;YAE5B,kBAAkB,EAAE,SAAS;YAE7B,gBAAgB,EAAE,SAAS;YAE3B,mBAAmB,EAAE,SAAS;YAG9B,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,yBAAyB,EAAE,SAAS;YAEpC,kBAAkB,EAAE,SAAS;YAG7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,uBAAuB;YAG7C,yBAAyB,EAAE,SAAS;YAEpC,wBAAwB,EAAE,SAAS;YAEnC,mBAAmB,EAAE,SAAS;YAG9B,WAAW,EAAE,SAAS;YAEtB,YAAY,EAAE,SAAS;YAEvB,YAAY,EAAE,SAAS;YAEvB,SAAS,EAAE,SAAS;YAGpB,4BAA4B,EAAE,SAAS;YAEvC,+BAA+B,EAAE,SAAS;YAE1C,sCAAsC,EAAE,SAAS;SAC3B;KACzB;CACF,CAAC","file":"color-scheme.js","sourcesContent":["import type { IThemeColorScheme } from '../../color-scheme/interface';\nimport { dataScheme } from '../../color-scheme/builtin/default';\nimport type { BuiltinColorPalette } from '../../color-scheme/builtin/interface';\n\nexport const colorScheme: IThemeColorScheme = {\n default: {\n dataScheme,\n palette: {\n /** 背景色 */\n backgroundColor: '#202226',\n /** 图表边框色 */\n borderColor: '#404349',\n /** 默认阴影颜色 */\n shadowColor: 'rgba(0,0,0,0.1)',\n /** 鼠标 hover 项背景颜色 */\n hoverBackgroundColor: '#404349',\n /** 滑块类组件背景条填充颜色 */\n sliderRailColor: '#404349',\n /** 滑块类组件滑块填充颜色 */\n sliderHandleColor: '#202226',\n /** 滑块类组件已选范围填充颜色 */\n sliderTrackColor: '#4284FF',\n /** 浮层背景区域颜色 */\n popupBackgroundColor: '#404349',\n\n /** 主要字色 */\n primaryFontColor: '#fdfdfd',\n /** 次要字色 */\n secondaryFontColor: '#bbbdc3',\n /** 第三字色 */\n tertiaryFontColor: '#888c93',\n /** 轴标签字色 */\n axisLabelFontColor: '#888c93',\n /** 禁用字色 */\n disableFontColor: '#55595f',\n /** 轴高亮标记字色 */\n axisMarkerFontColor: '#202226',\n\n /** 轴网格线颜色 */\n axisGridColor: '#404349',\n /** 轴线颜色 */\n axisDomainColor: '#4b4f54',\n\n /** 缩略轴滑块描边颜色 */\n dataZoomHandleStrokeColor: '#bbbdc3',\n /** 缩略轴图表区域颜色 */\n dataZoomChartColor: '#55595F',\n\n /** 播放器控制器填充颜色 */\n playerControllerColor: '#4284FF',\n\n /** 滚动条滑块颜色 */\n scrollBarSliderColor: 'rgba(255,255,255,0.3)',\n\n /** 轴高亮标记背景色 */\n axisMarkerBackgroundColor: '#fdfdfd',\n /** 标注标签背景颜色 */\n markLabelBackgroundColor: '#404349',\n /** 标注线颜色 */\n markLineStrokeColor: '#bbbdc3',\n\n /** 危险色 */\n dangerColor: '#eb4b4b',\n /** 警告色 */\n warningColor: '#f0bd30',\n /** 成功色 */\n successColor: '#14b267',\n /** 信息色 */\n infoColor: '#4284ff',\n\n /** 图例翻页器文字颜色 */\n discreteLegendPagerTextColor: '#BBBDC3',\n /** 图例翻页器按钮颜色 */\n discreteLegendPagerHandlerColor: '#BBBDC3',\n /** 图例翻页器按钮颜色(disable 态) */\n discreteLegendPagerHandlerDisableColor: '#55595F'\n } as BuiltinColorPalette\n }\n};\n"]}
|
|
@@ -30,7 +30,10 @@ export const colorScheme = {
|
|
|
30
30
|
dangerColor: "#e33232",
|
|
31
31
|
warningColor: "#ffc528",
|
|
32
32
|
successColor: "#07a35a",
|
|
33
|
-
infoColor: "#3073f2"
|
|
33
|
+
infoColor: "#3073f2",
|
|
34
|
+
discreteLegendPagerTextColor: "rgb(51, 51, 51)",
|
|
35
|
+
discreteLegendPagerHandlerColor: "rgb(47, 69, 84)",
|
|
36
|
+
discreteLegendPagerHandlerDisableColor: "rgb(170, 170, 170)"
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/light/color-scheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,oBAAoB;YAEjC,oBAAoB,EAAE,SAAS;YAE/B,eAAe,EAAE,SAAS;YAE1B,iBAAiB,EAAE,SAAS;YAE5B,gBAAgB,EAAE,SAAS;YAE3B,oBAAoB,EAAE,SAAS;YAG/B,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,iBAAiB,EAAE,SAAS;YAE5B,kBAAkB,EAAE,SAAS;YAE7B,gBAAgB,EAAE,SAAS;YAE3B,mBAAmB,EAAE,SAAS;YAG9B,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,yBAAyB,EAAE,SAAS;YAEpC,kBAAkB,EAAE,SAAS;YAG7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,iBAAiB;YAGvC,yBAAyB,EAAE,SAAS;YAEpC,wBAAwB,EAAE,SAAS;YAEnC,mBAAmB,EAAE,SAAS;YAG9B,WAAW,EAAE,SAAS;YAEtB,YAAY,EAAE,SAAS;YAEvB,YAAY,EAAE,SAAS;YAEvB,SAAS,EAAE,SAAS;
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/light/color-scheme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,oBAAoB;YAEjC,oBAAoB,EAAE,SAAS;YAE/B,eAAe,EAAE,SAAS;YAE1B,iBAAiB,EAAE,SAAS;YAE5B,gBAAgB,EAAE,SAAS;YAE3B,oBAAoB,EAAE,SAAS;YAG/B,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,iBAAiB,EAAE,SAAS;YAE5B,kBAAkB,EAAE,SAAS;YAE7B,gBAAgB,EAAE,SAAS;YAE3B,mBAAmB,EAAE,SAAS;YAG9B,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,yBAAyB,EAAE,SAAS;YAEpC,kBAAkB,EAAE,SAAS;YAG7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,iBAAiB;YAGvC,yBAAyB,EAAE,SAAS;YAEpC,wBAAwB,EAAE,SAAS;YAEnC,mBAAmB,EAAE,SAAS;YAG9B,WAAW,EAAE,SAAS;YAEtB,YAAY,EAAE,SAAS;YAEvB,YAAY,EAAE,SAAS;YAEvB,SAAS,EAAE,SAAS;YAGpB,4BAA4B,EAAE,iBAAiB;YAE/C,+BAA+B,EAAE,iBAAiB;YAElD,sCAAsC,EAAE,oBAAoB;SACtC;KACzB;CACF,CAAC","file":"color-scheme.js","sourcesContent":["import type { IThemeColorScheme } from '../../color-scheme/interface';\nimport { dataScheme } from '../../color-scheme/builtin/default';\nimport type { BuiltinColorPalette } from '../../color-scheme/builtin/interface';\n\nexport const colorScheme: IThemeColorScheme = {\n default: {\n dataScheme,\n palette: {\n /** 背景色 */\n backgroundColor: '#ffffff',\n /** 图表边框色 */\n borderColor: '#e3e5e8',\n /** 默认阴影颜色 */\n shadowColor: 'rgba(33,37,44,0.1)',\n /** 鼠标 hover 项背景颜色 */\n hoverBackgroundColor: '#f1f2f5',\n /** 滑块类组件背景条填充颜色 */\n sliderRailColor: '#f1f3f4',\n /** 滑块类组件滑块填充颜色 */\n sliderHandleColor: '#ffffff',\n /** 滑块类组件已选范围填充颜色 */\n sliderTrackColor: '#0040ff',\n /** 浮层背景区域颜色 */\n popupBackgroundColor: '#ffffff',\n\n /** 主要字色 */\n primaryFontColor: '#21252c',\n /** 次要字色 */\n secondaryFontColor: '#606773',\n /** 第三字色 */\n tertiaryFontColor: '#89909d',\n /** 轴标签字色 */\n axisLabelFontColor: '#89909d',\n /** 禁用字色 */\n disableFontColor: '#bcc1cb',\n /** 轴高亮标记字色 */\n axisMarkerFontColor: '#ffffff',\n\n /** 轴网格线颜色 */\n axisGridColor: '#f1f2f5',\n /** 轴线颜色 */\n axisDomainColor: '#d9dde4',\n\n /** 缩略轴滑块描边颜色 */\n dataZoomHandleStrokeColor: '#aeb5be',\n /** 缩略轴图表区域颜色 */\n dataZoomChartColor: '#c9ced8',\n\n /** 播放器控制器填充颜色 */\n playerControllerColor: '#0040ff',\n\n /** 滚动条滑块颜色 */\n scrollBarSliderColor: 'rgba(0,0,0,0.3)',\n\n /** 轴高亮标记背景色 */\n axisMarkerBackgroundColor: '#21252c',\n /** 标注标签背景颜色 */\n markLabelBackgroundColor: '#f1f2f5',\n /** 标注线颜色 */\n markLineStrokeColor: '#606773',\n\n /** 危险色 */\n dangerColor: '#e33232',\n /** 警告色 */\n warningColor: '#ffc528',\n /** 成功色 */\n successColor: '#07a35a',\n /** 信息色 */\n infoColor: '#3073f2',\n\n /** 图例翻页器文字颜色 */\n discreteLegendPagerTextColor: 'rgb(51, 51, 51)',\n /** 图例翻页器按钮颜色 */\n discreteLegendPagerHandlerColor: 'rgb(47, 69, 84)',\n /** 图例翻页器按钮颜色(disable 态) */\n discreteLegendPagerHandlerDisableColor: 'rgb(170, 170, 170)'\n } as BuiltinColorPalette\n }\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vchart",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.5",
|
|
4
4
|
"description": "charts lib based @visactor/VGrammar",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"@size-limit/file": "9.0.0",
|
|
82
82
|
"rimraf": "3.0.2",
|
|
83
83
|
"cross-env": "^7.0.3",
|
|
84
|
-
"@internal/typescript-json-schema": "0.0.1",
|
|
85
84
|
"@internal/bundler": "0.0.1",
|
|
86
|
-
"@internal/
|
|
87
|
-
"@internal/
|
|
85
|
+
"@internal/ts-config": "0.0.1",
|
|
86
|
+
"@internal/typescript-json-schema": "0.0.1",
|
|
87
|
+
"@internal/eslint-config": "0.0.1"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@visactor/vutils": "~0.18.9",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@visactor/vgrammar-sankey": "0.13.10",
|
|
102
102
|
"@visactor/vgrammar-venn": "0.13.10",
|
|
103
103
|
"@visactor/vgrammar-util": "0.13.10",
|
|
104
|
-
"@visactor/vutils-extension": "1.11.
|
|
104
|
+
"@visactor/vutils-extension": "1.11.5"
|
|
105
105
|
},
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public",
|