@visactor/vchart 1.6.1-alpha.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +133 -124
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/compilable-base.js +1 -2
- package/cjs/compile/grammar-item.js +2 -1
- package/cjs/component/marker/mark-point/interface/spec.d.ts +2 -2
- package/cjs/component/marker/mark-point/interface/spec.js.map +1 -1
- package/cjs/component/marker/mark-point/interface/theme.d.ts +5 -5
- package/cjs/component/marker/mark-point/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +4 -2
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.js +2 -2
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +1 -2
- package/cjs/component/tooltip/handler/utils/attribute.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/layout/grid-layout/grid-layout.js +4 -4
- package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js +2 -2
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/common-axis.js +1 -1
- package/cjs/theme/builtin/common/component/axis/common-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/crosshair.js +5 -5
- package/cjs/theme/builtin/common/component/crosshair.js.map +1 -1
- package/cjs/theme/builtin/common/component/data-zoom.js +10 -10
- package/cjs/theme/builtin/common/component/data-zoom.js.map +1 -1
- package/cjs/theme/builtin/common/component/indicator.js +1 -1
- package/cjs/theme/builtin/common/component/indicator.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/color-legend.js +4 -3
- package/cjs/theme/builtin/common/component/legend/color-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js +2 -2
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/size-legend.js +6 -6
- package/cjs/theme/builtin/common/component/legend/size-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/map-label.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-area.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-line.js +9 -9
- package/cjs/theme/builtin/common/component/mark-line.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-point.js +3 -15
- package/cjs/theme/builtin/common/component/mark-point.js.map +1 -1
- package/cjs/theme/builtin/common/component/player.js +7 -7
- package/cjs/theme/builtin/common/component/player.js.map +1 -1
- package/cjs/theme/builtin/common/component/poptip.js +4 -3
- package/cjs/theme/builtin/common/component/poptip.js.map +1 -1
- package/cjs/theme/builtin/common/component/scroll-bar.js +1 -1
- package/cjs/theme/builtin/common/component/scroll-bar.js.map +1 -1
- package/cjs/theme/builtin/common/component/title.js +1 -1
- package/cjs/theme/builtin/common/component/title.js.map +1 -1
- package/cjs/theme/builtin/common/component/tooltip.js +4 -3
- package/cjs/theme/builtin/common/component/tooltip.js.map +1 -1
- package/cjs/theme/builtin/common/component/total-label.js.map +1 -1
- package/cjs/theme/builtin/common/mark.js.map +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.js +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/cjs/theme/builtin/dark/color-scheme.js +10 -19
- package/cjs/theme/builtin/dark/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/light/color-scheme.js +9 -18
- package/cjs/theme/builtin/light/color-scheme.js.map +1 -1
- package/cjs/theme/color-scheme/builtin/interface.d.ts +7 -16
- package/cjs/theme/color-scheme/builtin/interface.js.map +1 -1
- package/cjs/theme/color-scheme/legacy.d.ts +5 -0
- package/cjs/theme/color-scheme/legacy.js +21 -0
- package/cjs/theme/color-scheme/legacy.js.map +1 -0
- package/cjs/theme/color-scheme/util.js +5 -6
- package/cjs/theme/color-scheme/util.js.map +1 -1
- package/esm/compile/compilable-base.js +1 -2
- package/esm/compile/grammar-item.js +2 -1
- package/esm/component/marker/mark-point/interface/spec.d.ts +2 -2
- package/esm/component/marker/mark-point/interface/spec.js.map +1 -1
- package/esm/component/marker/mark-point/interface/theme.d.ts +5 -5
- package/esm/component/marker/mark-point/interface/theme.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +4 -2
- package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.js +2 -2
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +1 -2
- package/esm/component/tooltip/handler/utils/attribute.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/layout/grid-layout/grid-layout.js +4 -4
- package/esm/layout/grid-layout/grid-layout.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js +2 -2
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/common-axis.js +1 -1
- package/esm/theme/builtin/common/component/axis/common-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/crosshair.js +5 -5
- package/esm/theme/builtin/common/component/crosshair.js.map +1 -1
- package/esm/theme/builtin/common/component/data-zoom.js +10 -10
- package/esm/theme/builtin/common/component/data-zoom.js.map +1 -1
- package/esm/theme/builtin/common/component/indicator.js +1 -1
- package/esm/theme/builtin/common/component/indicator.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/color-legend.js +4 -3
- package/esm/theme/builtin/common/component/legend/color-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/discrete-legend.js +2 -2
- package/esm/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/size-legend.js +6 -6
- package/esm/theme/builtin/common/component/legend/size-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/map-label.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-area.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-line.js +9 -9
- package/esm/theme/builtin/common/component/mark-line.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-point.js +3 -15
- package/esm/theme/builtin/common/component/mark-point.js.map +1 -1
- package/esm/theme/builtin/common/component/player.js +7 -7
- package/esm/theme/builtin/common/component/player.js.map +1 -1
- package/esm/theme/builtin/common/component/poptip.js +4 -3
- package/esm/theme/builtin/common/component/poptip.js.map +1 -1
- package/esm/theme/builtin/common/component/scroll-bar.js +1 -1
- package/esm/theme/builtin/common/component/scroll-bar.js.map +1 -1
- package/esm/theme/builtin/common/component/title.js +1 -1
- package/esm/theme/builtin/common/component/title.js.map +1 -1
- package/esm/theme/builtin/common/component/tooltip.js +4 -3
- package/esm/theme/builtin/common/component/tooltip.js.map +1 -1
- package/esm/theme/builtin/common/component/total-label.js.map +1 -1
- package/esm/theme/builtin/common/mark.js.map +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.js +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/esm/theme/builtin/dark/color-scheme.js +10 -19
- package/esm/theme/builtin/dark/color-scheme.js.map +1 -1
- package/esm/theme/builtin/light/color-scheme.js +9 -18
- package/esm/theme/builtin/light/color-scheme.js.map +1 -1
- package/esm/theme/color-scheme/builtin/interface.d.ts +7 -16
- package/esm/theme/color-scheme/builtin/interface.js.map +1 -1
- package/esm/theme/color-scheme/legacy.d.ts +5 -0
- package/esm/theme/color-scheme/legacy.js +18 -0
- package/esm/theme/color-scheme/legacy.js.map +1 -0
- package/esm/theme/color-scheme/util.js +7 -5
- package/esm/theme/color-scheme/util.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/title.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,KAAK,GAAgB;IAChC,OAAO,EAAE;QACP,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE;KACX;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,2BAAe,CAAC,UAAU;QACpC,UAAU,EAAE,2BAAe,CAAC,YAAmB;QAE/C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;KACnD;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,2BAAe,CAAC,UAAU;QACpC,UAAU,EAAE,2BAAe,CAAC,YAAmB;QAE/C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common/component/title.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,KAAK,GAAgB;IAChC,OAAO,EAAE;QACP,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE;KACX;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,2BAAe,CAAC,UAAU;QACpC,UAAU,EAAE,2BAAe,CAAC,YAAmB;QAE/C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;KACnD;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,2BAAe,CAAC,UAAU;QACpC,UAAU,EAAE,2BAAe,CAAC,YAAmB;QAE/C,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,oBAAoB,EAAE;KACrD;CACF,CAAC","file":"title.js","sourcesContent":["import type { ITitleTheme } from '../../../../component/title/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const title: ITitleTheme = {\n padding: {\n top: 4,\n bottom: 20\n },\n textStyle: {\n fontSize: THEME_CONSTANTS.l3FontSize,\n lineHeight: THEME_CONSTANTS.l3LineHeight as any, // FIXME: vrender 支持行高字符串后删除 any\n\n fill: { type: 'palette', key: 'primaryFontColor' }\n },\n subtextStyle: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight as any, // FIXME: vrender 支持行高字符串后删除 any\n\n fill: { type: 'palette', key: 'secondaryFontColor' }\n }\n};\n"]}
|
|
@@ -20,12 +20,12 @@ exports.tooltip = {
|
|
|
20
20
|
},
|
|
21
21
|
backgroundColor: {
|
|
22
22
|
type: "palette",
|
|
23
|
-
key: "
|
|
23
|
+
key: "tooltipBackgroundColor"
|
|
24
24
|
},
|
|
25
25
|
border: {
|
|
26
26
|
color: {
|
|
27
27
|
type: "palette",
|
|
28
|
-
key: "
|
|
28
|
+
key: "tooltipBackgroundColor"
|
|
29
29
|
},
|
|
30
30
|
width: 0,
|
|
31
31
|
radius: 3
|
|
@@ -37,7 +37,8 @@ exports.tooltip = {
|
|
|
37
37
|
spread: 0,
|
|
38
38
|
color: {
|
|
39
39
|
type: "palette",
|
|
40
|
-
key: "shadowColor"
|
|
40
|
+
key: "shadowColor",
|
|
41
|
+
a: .1
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/tooltip.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,OAAO,GAAkB;IACpC,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,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common/component/tooltip.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,OAAO,GAAkB;IACpC,MAAM,EAAE;QACN,CAAC,EAAE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,EAAE,2BAAe,CAAC,UAAU;QACpC,UAAU,EAAE,2BAAe,CAAC,YAAY;QAExC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;QACvD,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,QAAQ;QACtB,OAAO,EAAE,CAAC;KACX;CACF,CAAC","file":"tooltip.js","sourcesContent":["import type { ITooltipTheme } from '../../../../component/tooltip/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const tooltip: ITooltipTheme = {\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: 'tooltipBackgroundColor' },\n border: {\n color: { type: 'palette', key: 'tooltipBackgroundColor' },\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', a: 0.1 }\n }\n },\n spaceRow: 6,\n titleLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontColor: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'bold',\n textAlign: 'left',\n textBaseline: 'middle',\n spacing: 0\n },\n shape: {\n size: 8,\n spacing: 6\n },\n keyLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontColor: { type: 'palette', key: 'secondaryFontColor' },\n textAlign: 'left',\n textBaseline: 'middle',\n spacing: 26\n },\n valueLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontColor: { type: 'palette', key: 'primaryFontColor' },\n fontWeight: 'bold',\n textBaseline: 'middle',\n spacing: 0\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/total-label.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,UAAU,GAAqB;IAC1C,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,CAAC;IACT,OAAO,EAAE;QACP,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAe,CAAC,UAAU;
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common/component/total-label.ts"],"names":[],"mappings":";;;AACA,4CAA+C;AAElC,QAAA,UAAU,GAAqB;IAC1C,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,CAAC;IACT,OAAO,EAAE;QACP,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAe,CAAC,UAAU;QAGpC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE;KACnD;CACF,CAAC","file":"total-label.js","sourcesContent":["import type { ITotalLabelTheme } from '../../../../component/label';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const totalLabel: ITotalLabelTheme = {\n visible: false,\n offset: 5,\n overlap: {\n clampForce: true,\n strategy: []\n },\n smartInvert: false,\n animation: false,\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n // lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fill: { type: 'palette', key: 'primaryFontColor' }\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/mark.ts"],"names":[],"mappings":";;;AACA,2CAA8C;AAEjC,QAAA,UAAU,GAA2B;IAChD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,QAAQ,EAAE,2BAAe,CAAC,UAAU;YACpC,UAAU,EAAE,2BAAe,CAAC,YAAY;YAExC,UAAU,EAAE,QAAQ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AiB,EAAE;SACpD;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,EAAE;SACpD;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,KAAK;SACd;KACF;IACD,aAAa,EAAE;QACb,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE;SAC5D;KACF;CACF,CAAC","file":"mark.js","sourcesContent":["import type { IGlobalMarkThemeByName, IGlobalMarkThemeByType } from '../../interface';\nimport { THEME_CONSTANTS } from './constants';\n\nexport const markByType: IGlobalMarkThemeByType = {\n text: {\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontWeight: 'normal',\n fillOpacity: 1\n }\n }\n};\n\nexport const markByName: IGlobalMarkThemeByName = {\n label: {\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n // lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontWeight: 'normal',\n fillOpacity: 1\n }\n },\n area: {\n style: {\n fillOpacity: THEME_CONSTANTS.areaOpacity\n }\n },\n line: {\n style: {\n lineWidth: 2,\n lineCap: 'round',\n lineJoin: 'round'\n }\n },\n point: {\n style: {\n size: 8,\n stroke: { type: 'palette', key: 'backgroundColor' },\n lineWidth: 1,\n fillOpacity: 1\n }\n },\n word: {\n style: {\n fontSize: null\n }\n },\n fillingWord: {\n style: {\n fontSize: null\n }\n },\n sunburst: {\n style: {\n lineWidth: 1,\n stroke: { type: 'palette', key: 'backgroundColor' }\n }\n },\n circlePacking: {\n style: {\n lineWidth: 1,\n stroke: { type: 'palette', key: 'backgroundColor' }\n }\n },\n funnel3d: {\n style: {\n stroke: false\n }\n },\n barBackground: {\n visible: false,\n style: {\n fill: { type: 'palette', key: 'primaryFontColor', a: 0.06 }\n }\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/series/rangeColumn.ts"],"names":[],"mappings":";;;AAAA,yEAA6G;AAEhG,QAAA,WAAW,GAA4B;IAClD,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common/series/rangeColumn.ts"],"names":[],"mappings":";;;AAAA,yEAA6G;AAEhG,QAAA,WAAW,GAA4B;IAClD,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,uBAAuB,EAAE;SACxD;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,8BAAkB,CAAC,GAAG;SACjC;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,8BAAkB,CAAC,KAAK;SACnC;KACF;CACF,CAAC","file":"rangeColumn.js","sourcesContent":["import { minMaxPositionEnum, type IRangeColumnSeriesTheme } from '../../../../series/range-column/interface';\n\nexport const rangeColumn: IRangeColumnSeriesTheme = {\n label: {\n visible: false,\n offset: 5,\n position: 'inside',\n style: {\n fill: { type: 'palette', key: 'labelReverseFontColor' }\n },\n minLabel: {\n position: minMaxPositionEnum.end\n },\n maxLabel: {\n position: minMaxPositionEnum.start\n }\n }\n};\n"]}
|
|
@@ -12,31 +12,22 @@ exports.colorScheme = {
|
|
|
12
12
|
palette: {
|
|
13
13
|
backgroundColor: "#202226",
|
|
14
14
|
borderColor: "#404349",
|
|
15
|
-
shadowColor: "
|
|
16
|
-
hoverBackgroundColor: "#404349",
|
|
17
|
-
sliderRailColor: "#404349",
|
|
18
|
-
sliderHandleColor: "#202226",
|
|
19
|
-
sliderTrackColor: "#4284FF",
|
|
20
|
-
popupBackgroundColor: "#404349",
|
|
15
|
+
shadowColor: "#000000",
|
|
21
16
|
primaryFontColor: "#fdfdfd",
|
|
22
|
-
secondaryFontColor: "#
|
|
23
|
-
|
|
24
|
-
axisLabelFontColor: "#888c93",
|
|
17
|
+
secondaryFontColor: "#888c93",
|
|
18
|
+
axisFontColor: "#bbbdc3",
|
|
25
19
|
disableFontColor: "#55595f",
|
|
26
|
-
|
|
20
|
+
labelReverseFontColor: "#202226",
|
|
27
21
|
axisGridColor: "#404349",
|
|
28
22
|
axisDomainColor: "#4b4f54",
|
|
29
|
-
|
|
23
|
+
dataZoomHandlerStrokeColor: "#888c93",
|
|
24
|
+
dataZoomHandlerFillColor: "#202226",
|
|
25
|
+
dataZoomBackgroundColor: "#404349",
|
|
30
26
|
dataZoomChartColor: "#55595F",
|
|
31
|
-
|
|
27
|
+
dataZoomSelectedColor: "#4284FF",
|
|
32
28
|
scrollBarSliderColor: "#ffffff",
|
|
33
|
-
|
|
34
|
-
markLabelBackgroundColor: "#
|
|
35
|
-
markLineStrokeColor: "#bbbdc3",
|
|
36
|
-
dangerColor: "#eb4b4b",
|
|
37
|
-
warningColor: "#f0bd30",
|
|
38
|
-
successColor: "#14b267",
|
|
39
|
-
infoColor: "#4284ff"
|
|
29
|
+
tooltipBackgroundColor: "#404349",
|
|
30
|
+
markLabelBackgroundColor: "#f0bd30"
|
|
40
31
|
}
|
|
41
32
|
}
|
|
42
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/dark/color-scheme.ts"],"names":[],"mappings":";;;AACA,gEAAgE;AAGnD,QAAA,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/dark/color-scheme.ts"],"names":[],"mappings":";;;AACA,gEAAgE;AAGnD,QAAA,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,SAAS;YAGtB,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,aAAa,EAAE,SAAS;YAExB,gBAAgB,EAAE,SAAS;YAE3B,qBAAqB,EAAE,SAAS;YAGhC,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,0BAA0B,EAAE,SAAS;YAErC,wBAAwB,EAAE,SAAS;YAEnC,uBAAuB,EAAE,SAAS;YAElC,kBAAkB,EAAE,SAAS;YAE7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,SAAS;YAG/B,sBAAsB,EAAE,SAAS;YAGjC,wBAAwB,EAAE,SAAS;SACb;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: '#000000',\n\n /** 主要字色 */\n primaryFontColor: '#fdfdfd',\n /** 次要字色 */\n secondaryFontColor: '#888c93',\n /** 轴字色 */\n axisFontColor: '#bbbdc3',\n /** 禁用字色 */\n disableFontColor: '#55595f',\n /** 标签反转字色 */\n labelReverseFontColor: '#202226',\n\n /** 轴网格线颜色 */\n axisGridColor: '#404349',\n /** 轴线颜色 */\n axisDomainColor: '#4b4f54',\n\n /** 缩略轴滑块描边颜色 */\n dataZoomHandlerStrokeColor: '#888c93',\n /** 缩略轴滑块填充颜色 */\n dataZoomHandlerFillColor: '#202226',\n /** 缩略轴背景区域颜色 */\n dataZoomBackgroundColor: '#404349',\n /** 缩略轴图表区域颜色 */\n dataZoomChartColor: '#55595F',\n /** 缩略轴选择区域颜色 */\n dataZoomSelectedColor: '#4284FF',\n\n /** 滚动条滑块颜色 */\n scrollBarSliderColor: '#ffffff',\n\n /** 提示信息背景区域颜色 */\n tooltipBackgroundColor: '#404349',\n\n /** 标注标签背景颜色 */\n markLabelBackgroundColor: '#f0bd30'\n } as BuiltinColorPalette\n }\n};\n"]}
|
|
@@ -12,31 +12,22 @@ exports.colorScheme = {
|
|
|
12
12
|
palette: {
|
|
13
13
|
backgroundColor: "#ffffff",
|
|
14
14
|
borderColor: "#e3e5e8",
|
|
15
|
-
shadowColor: "
|
|
16
|
-
hoverBackgroundColor: "#f1f2f5",
|
|
17
|
-
sliderRailColor: "#f1f3f4",
|
|
18
|
-
sliderHandleColor: "#ffffff",
|
|
19
|
-
sliderTrackColor: "#0040ff",
|
|
20
|
-
popupBackgroundColor: "#ffffff",
|
|
15
|
+
shadowColor: "#21252c",
|
|
21
16
|
primaryFontColor: "#21252c",
|
|
22
17
|
secondaryFontColor: "#606773",
|
|
23
|
-
|
|
24
|
-
axisLabelFontColor: "#89909d",
|
|
18
|
+
axisFontColor: "#89909d",
|
|
25
19
|
disableFontColor: "#bcc1cb",
|
|
26
|
-
|
|
20
|
+
labelReverseFontColor: "#ffffff",
|
|
27
21
|
axisGridColor: "#f1f2f5",
|
|
28
22
|
axisDomainColor: "#d9dde4",
|
|
29
|
-
|
|
23
|
+
dataZoomHandlerStrokeColor: "#aeb5be",
|
|
24
|
+
dataZoomHandlerFillColor: "#ffffff",
|
|
25
|
+
dataZoomBackgroundColor: "#f1f3f4",
|
|
30
26
|
dataZoomChartColor: "#c9ced8",
|
|
31
|
-
|
|
27
|
+
dataZoomSelectedColor: "#0040ff",
|
|
32
28
|
scrollBarSliderColor: "#000000",
|
|
33
|
-
|
|
34
|
-
markLabelBackgroundColor: "#
|
|
35
|
-
markLineStrokeColor: "#606773",
|
|
36
|
-
dangerColor: "#e33232",
|
|
37
|
-
warningColor: "#ffc528",
|
|
38
|
-
successColor: "#07a35a",
|
|
39
|
-
infoColor: "#3073f2"
|
|
29
|
+
tooltipBackgroundColor: "#ffffff",
|
|
30
|
+
markLabelBackgroundColor: "#ffc528"
|
|
40
31
|
}
|
|
41
32
|
}
|
|
42
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/light/color-scheme.ts"],"names":[],"mappings":";;;AACA,gEAAgE;AAGnD,QAAA,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/light/color-scheme.ts"],"names":[],"mappings":";;;AACA,gEAAgE;AAGnD,QAAA,WAAW,GAAsB;IAC5C,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,OAAO,EAAE;YAEP,eAAe,EAAE,SAAS;YAE1B,WAAW,EAAE,SAAS;YAEtB,WAAW,EAAE,SAAS;YAGtB,gBAAgB,EAAE,SAAS;YAE3B,kBAAkB,EAAE,SAAS;YAE7B,aAAa,EAAE,SAAS;YAExB,gBAAgB,EAAE,SAAS;YAE3B,qBAAqB,EAAE,SAAS;YAGhC,aAAa,EAAE,SAAS;YAExB,eAAe,EAAE,SAAS;YAG1B,0BAA0B,EAAE,SAAS;YAErC,wBAAwB,EAAE,SAAS;YAEnC,uBAAuB,EAAE,SAAS;YAElC,kBAAkB,EAAE,SAAS;YAE7B,qBAAqB,EAAE,SAAS;YAGhC,oBAAoB,EAAE,SAAS;YAG/B,sBAAsB,EAAE,SAAS;YAGjC,wBAAwB,EAAE,SAAS;SACb;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: '#21252c',\n\n /** 主要字色 */\n primaryFontColor: '#21252c',\n /** 次要字色 */\n secondaryFontColor: '#606773',\n /** 轴字色 */\n axisFontColor: '#89909d',\n /** 禁用字色 */\n disableFontColor: '#bcc1cb',\n /** 标签反转字色 */\n labelReverseFontColor: '#ffffff',\n\n /** 轴网格线颜色 */\n axisGridColor: '#f1f2f5',\n /** 轴线颜色 */\n axisDomainColor: '#d9dde4',\n\n /** 缩略轴滑块描边颜色 */\n dataZoomHandlerStrokeColor: '#aeb5be',\n /** 缩略轴滑块填充颜色 */\n dataZoomHandlerFillColor: '#ffffff',\n /** 缩略轴背景区域颜色 */\n dataZoomBackgroundColor: '#f1f3f4',\n /** 缩略轴图表区域颜色 */\n dataZoomChartColor: '#c9ced8',\n /** 缩略轴选择区域颜色 */\n dataZoomSelectedColor: '#0040ff',\n\n /** 滚动条滑块颜色 */\n scrollBarSliderColor: '#000000',\n\n /** 提示信息背景区域颜色 */\n tooltipBackgroundColor: '#ffffff',\n\n /** 标注标签背景颜色 */\n markLabelBackgroundColor: '#ffc528'\n } as BuiltinColorPalette\n }\n};\n"]}
|
|
@@ -3,28 +3,19 @@ export type BuiltinColorPalette = IColorSchemeStruct['palette'] & {
|
|
|
3
3
|
backgroundColor: string;
|
|
4
4
|
borderColor: string;
|
|
5
5
|
shadowColor: string;
|
|
6
|
-
hoverBackgroundColor: string;
|
|
7
|
-
sliderRailColor: string;
|
|
8
|
-
sliderHandleColor: string;
|
|
9
|
-
sliderTrackColor: string;
|
|
10
|
-
popupBackgroundColor: string;
|
|
11
6
|
primaryFontColor: string;
|
|
12
7
|
secondaryFontColor: string;
|
|
13
|
-
|
|
14
|
-
axisLabelFontColor: string;
|
|
8
|
+
axisFontColor: string;
|
|
15
9
|
disableFontColor: string;
|
|
16
|
-
|
|
10
|
+
labelReverseFontColor: string;
|
|
17
11
|
axisGridColor: string;
|
|
18
12
|
axisDomainColor: string;
|
|
19
|
-
|
|
13
|
+
dataZoomHandlerStrokeColor: string;
|
|
14
|
+
dataZoomHandlerFillColor: string;
|
|
15
|
+
dataZoomBackgroundColor: string;
|
|
20
16
|
dataZoomChartColor: string;
|
|
21
|
-
|
|
17
|
+
dataZoomSelectedColor: string;
|
|
22
18
|
scrollBarSliderColor: string;
|
|
23
|
-
|
|
19
|
+
tooltipBackgroundColor: string;
|
|
24
20
|
markLabelBackgroundColor: string;
|
|
25
|
-
markLineStrokeColor: string;
|
|
26
|
-
dangerColor: string;
|
|
27
|
-
warningColor: string;
|
|
28
|
-
successColor: string;
|
|
29
|
-
infoColor: string;
|
|
30
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/color-scheme/builtin/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IColorSchemeStruct } from '../interface';\n\nexport type BuiltinColorPalette = IColorSchemeStruct['palette'] & {\n /** 背景色 */\n backgroundColor: string;\n /** 图表边框色 */\n borderColor: string;\n /** 默认阴影颜色 */\n shadowColor: string;\n
|
|
1
|
+
{"version":3,"sources":["../src/theme/color-scheme/builtin/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IColorSchemeStruct } from '../interface';\n\nexport type BuiltinColorPalette = IColorSchemeStruct['palette'] & {\n /** 背景色 */\n backgroundColor: string;\n /** 图表边框色 */\n borderColor: string;\n /** 默认阴影颜色 */\n shadowColor: string;\n\n /** 主要字色(图表标题、大数字) */\n primaryFontColor: string;\n /** 次要字色(图例、tooltip、数据标签) */\n secondaryFontColor: string;\n /** 轴字色 */\n axisFontColor: string;\n /** 禁用字色(非激活态字色) */\n disableFontColor: string;\n /** 标签反转字色 */\n labelReverseFontColor: string;\n\n /** 轴网格线颜色 */\n axisGridColor: string;\n /** 轴线颜色 */\n axisDomainColor: string;\n\n /** 缩略轴滑块描边颜色 */\n dataZoomHandlerStrokeColor: string;\n /** 缩略轴滑块填充颜色 */\n dataZoomHandlerFillColor: string;\n /** 缩略轴背景区域颜色 */\n dataZoomBackgroundColor: string;\n /** 缩略轴图表区域颜色 */\n dataZoomChartColor: string;\n /** 缩略轴选择区域颜色 */\n dataZoomSelectedColor: string;\n\n /** 滚动条滑块颜色 */\n scrollBarSliderColor: string;\n\n /** 提示信息背景区域颜色 */\n tooltipBackgroundColor: string;\n\n /** 标注标签背景颜色 */\n markLabelBackgroundColor: string;\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BuiltinColorPalette } from './builtin';
|
|
2
|
+
import type { ColorSchemeItem, IColorSchemeStruct } from './interface';
|
|
3
|
+
export declare const newTokenToLegacyToken: Record<keyof BuiltinColorPalette, string>;
|
|
4
|
+
export declare const legacyTokenToNewToken: Record<string, keyof BuiltinColorPalette>;
|
|
5
|
+
export declare function getUpgradedTokenValue(palette: IColorSchemeStruct['palette'], key: string): ColorSchemeItem;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function getUpgradedTokenValue(palette, key) {
|
|
4
|
+
const legacyKey = exports.newTokenToLegacyToken[key];
|
|
5
|
+
if (legacyKey && palette[legacyKey]) return palette[legacyKey];
|
|
6
|
+
if (palette[key]) return palette[key];
|
|
7
|
+
const newKey = exports.legacyTokenToNewToken[key];
|
|
8
|
+
return newKey ? palette[newKey] : void 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: !0
|
|
13
|
+
}), exports.getUpgradedTokenValue = exports.legacyTokenToNewToken = exports.newTokenToLegacyToken = void 0,
|
|
14
|
+
exports.newTokenToLegacyToken = {
|
|
15
|
+
primaryFontColor: "titleFontColor",
|
|
16
|
+
secondaryFontColor: "labelFontColor"
|
|
17
|
+
}, exports.legacyTokenToNewToken = {
|
|
18
|
+
titleFontColor: "primaryFontColor",
|
|
19
|
+
labelFontColor: "secondaryFontColor"
|
|
20
|
+
}, exports.getUpgradedTokenValue = getUpgradedTokenValue;
|
|
21
|
+
//# sourceMappingURL=legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/color-scheme/legacy.ts"],"names":[],"mappings":";;;AAQa,QAAA,qBAAqB,GAA8C;IAC9E,gBAAgB,EAAE,gBAAgB;IAClC,kBAAkB,EAAE,gBAAgB;CACrC,CAAC;AAEW,QAAA,qBAAqB,GAA8C;IAC9E,cAAc,EAAE,kBAAkB;IAClC,cAAc,EAAE,oBAAoB;CACrC,CAAC;AAEF,SAAgB,qBAAqB,CAAC,OAAsC,EAAE,GAAW;IAEvF,MAAM,SAAS,GAAG,6BAAqB,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,EAAE;QACnC,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;KAC3B;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;KACrB;IAED,MAAM,MAAM,GAAG,6BAAqB,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,MAAM,EAAE;QACV,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;KACxB;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,sDAiBC","file":"legacy.js","sourcesContent":["// FIXME: token 兼容策略,照目前的设计不应该硬编码。\n// 后续需要二选一:\n// - 主题模块指定唯一一套支持的 token(可以保留这段硬编码)\n// - 在默认主题中做声明式的兼容(需要删除这段硬编码,并在 IColorKey 中支持新属性)\n\nimport type { BuiltinColorPalette } from './builtin';\nimport type { ColorSchemeItem, IColorSchemeStruct } from './interface';\n\nexport const newTokenToLegacyToken: Record<keyof BuiltinColorPalette, string> = {\n primaryFontColor: 'titleFontColor',\n secondaryFontColor: 'labelFontColor'\n};\n\nexport const legacyTokenToNewToken: Record<string, keyof BuiltinColorPalette> = {\n titleFontColor: 'primaryFontColor',\n labelFontColor: 'secondaryFontColor'\n};\n\nexport function getUpgradedTokenValue(palette: IColorSchemeStruct['palette'], key: string): ColorSchemeItem {\n // 情况一:用户定义了包含旧 token 的新色板\n const legacyKey = newTokenToLegacyToken[key];\n if (legacyKey && palette[legacyKey]) {\n return palette[legacyKey];\n }\n // 情况二:默认情况,用户尝试取色(大部分情况下在此退出)\n if (palette[key]) {\n return palette[key];\n }\n // 情况三:用户没有取到颜色,判断用户是否在尝试用旧 token 取色\n const newKey = legacyTokenToNewToken[key];\n if (newKey) {\n return palette[newKey];\n }\n // 情况四:真的取不到颜色\n return undefined;\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.getColorSchemeBySeries = exports.transformColorSchemeToStandardStruct = exports.isProgressiveDataColorScheme = exports.isColorKey = exports.getActualColor = exports.queryColorFromColorScheme = exports.computeActualDataScheme = exports.getDataScheme = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), color_1 = require("../../util/color"), spec_1 = require("../../series/util/spec");
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), color_1 = require("../../util/color"), spec_1 = require("../../series/util/spec"), legacy_1 = require("./legacy");
|
|
8
8
|
|
|
9
9
|
function getDataScheme(colorScheme, seriesSpec) {
|
|
10
10
|
var _a;
|
|
@@ -33,10 +33,9 @@ function queryColorFromColorScheme(colorScheme, colorKey, seriesSpec) {
|
|
|
33
33
|
if (!scheme) return;
|
|
34
34
|
let color;
|
|
35
35
|
const {palette: palette} = scheme;
|
|
36
|
-
if ((0, vutils_1.isObject)(palette) && (color = null !== (_a = palette
|
|
36
|
+
if ((0, vutils_1.isObject)(palette) && (color = null !== (_a = (0, legacy_1.getUpgradedTokenValue)(palette, colorKey.key)) && void 0 !== _a ? _a : colorKey.default),
|
|
37
37
|
!color) return;
|
|
38
|
-
if (
|
|
39
|
-
vutils_1.isString)(color)) return color;
|
|
38
|
+
if ((0, vutils_1.isNil)(colorKey.a) && (0, vutils_1.isNil)(colorKey.l) || !(0, vutils_1.isString)(color)) return color;
|
|
40
39
|
let c = new color_1.Color(color);
|
|
41
40
|
if ((0, vutils_1.isValid)(colorKey.l)) {
|
|
42
41
|
const {r: r, g: g, b: b} = c.color, {h: h, s: s} = vutils_1.ColorUtil.rgbToHsl(r, g, b), rgb = vutils_1.ColorUtil.hslToRgb(h, s, colorKey.l), newColor = new color_1.Color(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);
|
|
@@ -75,10 +74,10 @@ function getColorSchemeBySeries(colorScheme, seriesSpec) {
|
|
|
75
74
|
var _a, _b;
|
|
76
75
|
const {type: seriesType} = null != seriesSpec ? seriesSpec : {};
|
|
77
76
|
let scheme;
|
|
78
|
-
if (seriesSpec
|
|
77
|
+
if (!seriesSpec || (0, vutils_1.isNil)(seriesType)) scheme = null == colorScheme ? void 0 : colorScheme.default; else {
|
|
79
78
|
const direction = (0, spec_1.getDirectionFromSeriesSpec)(seriesSpec);
|
|
80
79
|
scheme = null !== (_b = null !== (_a = null == colorScheme ? void 0 : colorScheme[`${seriesType}_${direction}`]) && void 0 !== _a ? _a : null == colorScheme ? void 0 : colorScheme[seriesType]) && void 0 !== _b ? _b : null == colorScheme ? void 0 : colorScheme.default;
|
|
81
|
-
}
|
|
80
|
+
}
|
|
82
81
|
return scheme;
|
|
83
82
|
}
|
|
84
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/color-scheme/util.ts"],"names":[],"mappings":";;;AAAA,
|
|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OAAO,CAAC;KAC/B;SAAM;QACL,MAAM,SAAS,GAAG,IAAA,iCAA0B,EAAC,UAAU,CAAC,CAAC;QACzD,MAAM,GAAG,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,GAAG,UAAU,IAAI,SAAS,EAAE,CAAC,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,UAAU,CAAC,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAC;KAC3G;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,wDAaC","file":"util.js","sourcesContent":["import { isArray, isFunction, isObject, isString, isValid, ColorUtil, isNil } from '@visactor/vutils';\nimport { Color } from '../../util/color';\nimport type {\n ColorScheme,\n ColorSchemeItem,\n IColorKey,\n IColorSchemeStruct,\n IProgressiveDataSchemeCase,\n IThemeColorScheme,\n ProgressiveDataScheme\n} from './interface';\nimport type { ISeriesSpec } from '../../typings';\nimport { getDirectionFromSeriesSpec } from '../../series/util/spec';\nimport { getUpgradedTokenValue } from './legacy';\n\n/**\n * 从色板中获取数据色板(在此步骤中替换语义色值)\n * @param colorScheme\n * @param seriesType\n * @returns\n */\nexport function getDataScheme(\n colorScheme?: IThemeColorScheme,\n seriesSpec?: ISeriesSpec\n): Array<ColorSchemeItem> | ProgressiveDataScheme<ColorSchemeItem> {\n if (!colorScheme) {\n return [];\n }\n const scheme = getColorSchemeBySeries(colorScheme, seriesSpec);\n if (!scheme || isArray(scheme)) {\n // 不带语义色板,直接输出\n return (scheme as Array<ColorSchemeItem> | ProgressiveDataScheme<ColorSchemeItem>) ?? [];\n } else if (isObject(scheme)) {\n // 带语义色板,转换颜色后输出\n const { dataScheme } = scheme as IColorSchemeStruct;\n if (!dataScheme) {\n return [];\n }\n // 渐进式色板的情况\n if (isProgressiveDataColorScheme(dataScheme)) {\n return dataScheme.map(item => ({\n ...item,\n scheme: item.scheme\n .map(color => {\n if (isColorKey(color)) {\n return queryColorFromColorScheme(colorScheme, color, seriesSpec);\n }\n return color;\n })\n .filter(isValid)\n }));\n }\n // 普通色板的情况\n return dataScheme\n .map(color => {\n if (isColorKey(color)) {\n return queryColorFromColorScheme(colorScheme, color, seriesSpec);\n }\n return color;\n })\n .filter(isValid);\n }\n return [];\n}\n\n/**\n * 计算最终数据色板(在此步骤中获得渐进式色板的最终色板)\n * @param colorScheme\n * @param seriesType\n * @returns\n */\nexport function computeActualDataScheme(\n dataScheme: Array<ColorSchemeItem> | ProgressiveDataScheme<ColorSchemeItem>,\n colorDomain: any[]\n): Array<ColorSchemeItem> {\n if (isProgressiveDataColorScheme(dataScheme)) {\n return (\n dataScheme.find(item => {\n if (isValid(item.isAvailable)) {\n if (isFunction(item.isAvailable)) {\n return item.isAvailable(colorDomain);\n }\n return !!item.isAvailable;\n } else if (isValid(item.maxDomainLength)) {\n return colorDomain?.length <= item.maxDomainLength;\n }\n return true;\n })?.scheme ?? dataScheme[dataScheme.length - 1].scheme\n );\n }\n return dataScheme;\n}\n\n/**\n * 根据色板和色值索引生成颜色\n * @param colorScheme\n * @param colorKey\n * @param seriesType\n * @returns\n */\nexport function queryColorFromColorScheme(\n colorScheme: IThemeColorScheme,\n colorKey: IColorKey,\n seriesSpec?: ISeriesSpec\n): ColorSchemeItem | undefined {\n const scheme = getColorSchemeBySeries(colorScheme, seriesSpec);\n if (!scheme) {\n return undefined;\n }\n let color;\n const { palette } = scheme as IColorSchemeStruct;\n if (isObject(palette)) {\n color = getUpgradedTokenValue(palette, colorKey.key) ?? colorKey.default;\n }\n if (!color) {\n return undefined;\n }\n if ((isNil(colorKey.a) && isNil(colorKey.l)) || !isString(color)) {\n return color;\n }\n let c = new Color(color);\n if (isValid(colorKey.l)) {\n const { r, g, b } = c.color;\n const { h, s } = ColorUtil.rgbToHsl(r, g, b);\n const rgb = ColorUtil.hslToRgb(h, s, colorKey.l);\n const newColor = new Color(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);\n newColor.setOpacity(c.color.opacity);\n c = newColor;\n }\n if (isValid(colorKey.a)) {\n c.setOpacity(colorKey.a);\n }\n return c.toRGBA();\n}\n\n/** 查询语义化颜色 */\nexport const getActualColor = (value: any, colorScheme?: IThemeColorScheme, seriesSpec?: ISeriesSpec) => {\n if (isColorKey(value)) {\n if (colorScheme) {\n const color = queryColorFromColorScheme(colorScheme, value, seriesSpec);\n if (color) {\n return color;\n }\n }\n }\n return value;\n};\n\nexport function isColorKey(obj: any): obj is IColorKey {\n return isObject(obj) && (obj as IColorKey).type === 'palette' && !!(obj as IColorKey).key;\n}\n\nexport function isProgressiveDataColorScheme<T>(obj: any): obj is ProgressiveDataScheme<T> {\n if (!isArray(obj) || obj.length === 0) {\n return false;\n }\n return obj.every(item => {\n return isValid((item as IProgressiveDataSchemeCase<T>).scheme);\n });\n}\n\n/** 将色板转化为标准形式 */\nexport function transformColorSchemeToStandardStruct(colorScheme: ColorScheme): IColorSchemeStruct {\n if (isArray(colorScheme)) {\n return {\n dataScheme: colorScheme\n };\n }\n return colorScheme;\n}\n\nexport function getColorSchemeBySeries(\n colorScheme?: IThemeColorScheme,\n seriesSpec?: ISeriesSpec\n): ColorScheme | undefined {\n const { type: seriesType } = seriesSpec ?? {};\n let scheme: ColorScheme | undefined;\n if (!seriesSpec || isNil(seriesType)) {\n scheme = colorScheme?.default;\n } else {\n const direction = getDirectionFromSeriesSpec(seriesSpec);\n scheme = colorScheme?.[`${seriesType}_${direction}`] ?? colorScheme?.[seriesType] ?? colorScheme?.default;\n }\n return scheme;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IPointLike } from '@visactor/vutils';
|
|
2
2
|
import type { IComponent } from '../../../interface';
|
|
3
|
-
import type { IDataPointSpec, IMarkerSpec
|
|
3
|
+
import type { IDataPointSpec, IMarkerSpec } from '../../interface';
|
|
4
4
|
import type { IMarkPointTheme } from './theme';
|
|
5
5
|
export type IMarkPoint = IComponent;
|
|
6
|
-
export type IMarkPointSpec = IMarkerSpec & (IMarkPointCoordinateSpec | IMarkPointPositionsSpec) & IMarkPointTheme
|
|
6
|
+
export type IMarkPointSpec = IMarkerSpec & (IMarkPointCoordinateSpec | IMarkPointPositionsSpec) & IMarkPointTheme;
|
|
7
7
|
export type IMarkPointCoordinateSpec = {
|
|
8
8
|
coordinates: IDataPointSpec;
|
|
9
9
|
relativeRelativeSeriesIndex?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/marker/mark-point/interface/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IComponent } from '../../../interface';\nimport type { IDataPointSpec, IMarkerSpec
|
|
1
|
+
{"version":3,"sources":["../src/component/marker/mark-point/interface/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IComponent } from '../../../interface';\nimport type { IDataPointSpec, IMarkerSpec } from '../../interface';\nimport type { IMarkPointTheme } from './theme';\n\nexport type IMarkPoint = IComponent;\n\nexport type IMarkPointSpec = IMarkerSpec &\n (\n | IMarkPointCoordinateSpec // 标注目标:数据元素\n | IMarkPointPositionsSpec\n ) &\n IMarkPointTheme; // 标注目标:任意位置\n\nexport type IMarkPointCoordinateSpec = {\n /**\n * 指定数据点的参考线。基于指定数据点进行参考线的绘制,可以对数据点进行数据处理\n */\n coordinates: IDataPointSpec;\n /**\n * 被标注数据关联的series\n */\n relativeRelativeSeriesIndex?: number;\n relativeRelativeSeriesId?: string;\n};\n\n/**\n * 指定坐标点的参考线。基于指定坐标进行参考线的绘制\n */\nexport type IMarkPointPositionsSpec = {\n position: IPointLike;\n};\n"]}
|
|
@@ -18,20 +18,20 @@ export interface IItemContent extends IMarkerRef {
|
|
|
18
18
|
style?: IRichTextGraphicAttribute;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
export type IItemLine
|
|
21
|
+
export type IItemLine = {
|
|
22
22
|
type?: 'type-s' | 'type-do' | 'type-po' | 'type-op';
|
|
23
23
|
visible?: boolean;
|
|
24
24
|
decorativeLine?: {
|
|
25
25
|
visible?: boolean;
|
|
26
26
|
length?: number;
|
|
27
27
|
};
|
|
28
|
-
startSymbol?:
|
|
29
|
-
endSymbol?:
|
|
28
|
+
startSymbol?: IMarkerSymbol;
|
|
29
|
+
endSymbol?: IMarkerSymbol;
|
|
30
30
|
line?: {
|
|
31
31
|
style?: Omit<ILineMarkSpec, 'visible'>;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export interface IMarkPointTheme
|
|
35
|
-
itemLine?: IItemLine
|
|
34
|
+
export interface IMarkPointTheme {
|
|
35
|
+
itemLine?: IItemLine;
|
|
36
36
|
itemContent?: IItemContent;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/marker/mark-point/interface/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IImageGraphicAttribute, IRichTextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IMarkPointItemPosition } from '@visactor/vrender-components';\nimport type { ILineMarkSpec, ISymbolMarkSpec } from '../../../../typings';\nimport type { IMarkerLabelSpec, IMarkerRef, IMarkerSymbol } from '../../interface';\n\nexport interface IItemContent extends IMarkerRef {\n /**\n * 标注类型\n */\n type?: 'symbol' | 'text' | 'image' | 'richText';\n /**\n * 标注内容相对于定位点的位置\n */\n position?: IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbol?: {\n style?: ISymbolMarkSpec;\n };\n /**\n * type为image时, image的样式\n */\n image?: {\n style?: IImageGraphicAttribute;\n };\n /**\n * type为text时, text的样式\n */\n text?: IMarkerLabelSpec;\n /**\n * type为rich text时, rich text的样式\n */\n richText?: {\n style?: IRichTextGraphicAttribute;\n };\n}\n\nexport type IItemLine
|
|
1
|
+
{"version":3,"sources":["../src/component/marker/mark-point/interface/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IImageGraphicAttribute, IRichTextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IMarkPointItemPosition } from '@visactor/vrender-components';\nimport type { ILineMarkSpec, ISymbolMarkSpec } from '../../../../typings';\nimport type { IMarkerLabelSpec, IMarkerRef, IMarkerSymbol } from '../../interface';\n\nexport interface IItemContent extends IMarkerRef {\n /**\n * 标注类型\n */\n type?: 'symbol' | 'text' | 'image' | 'richText';\n /**\n * 标注内容相对于定位点的位置\n */\n position?: IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbol?: {\n style?: ISymbolMarkSpec;\n };\n /**\n * type为image时, image的样式\n */\n image?: {\n style?: IImageGraphicAttribute;\n };\n /**\n * type为text时, text的样式\n */\n text?: IMarkerLabelSpec;\n /**\n * type为rich text时, rich text的样式\n */\n richText?: {\n style?: IRichTextGraphicAttribute;\n };\n}\n\nexport type IItemLine = {\n /** TODO:'type-opo' */\n /**\n * 引导线类型\n * 'type-s'表示起点和终点直接连线; 'type-do'表示包含一个折点,且折点x坐标为起点到终点的 1/2 x坐标,折点y坐标为起点y坐标;'type-op' 表示包含一个折点,且折点x坐标为起点x坐标,折点y坐标为终点y坐标;'type-po' 表示包含一个折点,且折点x坐标为终点x坐标,折点y坐标为起点y坐标\n * 引导线类型的具体形式参考:https://journals.sagepub.com/doi/10.1177/1473871618799500\n */\n type?: 'type-s' | 'type-do' | 'type-po' | 'type-op';\n /**\n * 引导线可见性\n */\n visible?: boolean;\n /**\n * 垂直于引导线的装饰线,参考案例: https://observablehq.com/@mikelotis/edmonton-population-history-line-chart\n */\n decorativeLine?: {\n /**\n * 装饰线可见性\n */\n visible?: boolean;\n /**\n * 装饰线的长度\n */\n length?: number;\n };\n /**\n * 引导线起点symbol样式\n */\n startSymbol?: IMarkerSymbol;\n /**\n * 引导线终点symbol样式\n */\n endSymbol?: IMarkerSymbol;\n /**\n * 引导线样式\n */\n line?: {\n style?: Omit<ILineMarkSpec, 'visible'>;\n };\n};\n\nexport interface IMarkPointTheme {\n /**\n * 标注引导线\n */\n itemLine?: IItemLine;\n\n /**\n * 标注内容\n */\n itemContent?: IItemContent;\n}\n"]}
|
|
@@ -51,12 +51,14 @@ export class ContentColumnModel extends BaseTooltipModel {
|
|
|
51
51
|
if ("key-box" === this.className) {
|
|
52
52
|
const {key: key, isKeyAdaptive: isKeyAdaptive} = line;
|
|
53
53
|
childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign({
|
|
54
|
-
height: getPixelPropertyStr(contentAttributes[i].height)
|
|
54
|
+
height: getPixelPropertyStr(contentAttributes[i].height),
|
|
55
|
+
overflowWrap: "normal"
|
|
55
56
|
}, tooltipStyle.keyColumn.common), null === (_a = tooltipStyle.keyColumn.items) || void 0 === _a ? void 0 : _a[i]));
|
|
56
57
|
isString(key) && "" !== (null === (_b = null == key ? void 0 : key.trim) || void 0 === _b ? void 0 : _b.call(key)) || isNumber(key) || childStyle.visibility ? childStyle.visibility = "visible" : childStyle.visibility = "hidden",
|
|
57
58
|
this.children[i].setStyle(childStyle);
|
|
58
59
|
} else "value-box" === this.className ? (childStyle = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign({
|
|
59
|
-
height: getPixelPropertyStr(contentAttributes[i].height)
|
|
60
|
+
height: getPixelPropertyStr(contentAttributes[i].height),
|
|
61
|
+
overflowWrap: "normal"
|
|
60
62
|
}, tooltipStyle.valueColumn.common), null === (_c = tooltipStyle.valueColumn.items) || void 0 === _c ? void 0 : _c[i])),
|
|
61
63
|
this.children[i].setStyle(childStyle)) : "shape-box" === this.className && (childStyle = mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({
|
|
62
64
|
height: getPixelPropertyStr(contentAttributes[i].height + contentAttributes[i].spaceRow)
|
|
@@ -1 +1 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KAAa;;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;QACpD,MAAM,WAAW,mCACZ,YAAY,CAAC,WAAW,GACxB,MAAA,YAAY,CAAC,WAAW,CAAC,KAAK,0CAAG,KAAK,CAAC,CAC3C,CAAC;QACF,MAAM,SAAS,mCACV,YAAY,CAAC,SAAS,GACtB,MAAA,YAAY,CAAC,SAAS,CAAC,KAAK,0CAAG,KAAK,CAAC,CACzC,CAAC;QACF,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,IAAI,EAAE,WAAW,CAAC,KAAK;YACvB,IAAI,EAAE,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU;YACvC,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,SAAS,EAAE,SAAS,MAAA,MAAA,SAAS,CAAC,UAAU,mCAAI,SAAS,CAAC,QAAQ,mCAAI,MAAM,MAAM,MAAA,WAAW,CAAC,KAAK,mCAAI,KAAK,QAAQ;SAC9F,CAAC;IACvB,CAAC;CACF","file":"content-column-model.js","sourcesContent":["import { isNumber, isString, toNumber } from '@visactor/vutils';\nimport {\n defaultKeyStyle,\n defaultContentColumnStyle,\n defaultValueStyle,\n defaultAdaptiveKeyStyle,\n defaultShapeStyle\n} from './style-constants';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport type { ITooltipModelOption } from './interface';\nimport type { IShapeSvgOption } from './shape-model';\n// eslint-disable-next-line no-duplicate-imports\nimport { ShapeModel } from './shape-model';\nimport { TextModel } from './text-model';\nimport { TOOLTIP_EMPTY_STRING } from '../../constants';\nimport { getPixelPropertyStr } from '../util';\nimport type { IToolTipLineActual } from '../../../../../typings';\nimport { mergeSpec } from '../../../../../util/spec/merge-spec';\n\nexport type ContentColumnType = 'shape-box' | 'key-box' | 'value-box';\n\nexport class ContentColumnModel extends BaseTooltipModel {\n readonly className: ContentColumnType;\n\n constructor(\n parent: BaseTooltipModel | HTMLElement,\n option: ITooltipModelOption,\n className: ContentColumnType,\n childIndex?: number\n ) {\n super(parent, option, childIndex);\n this.className = className;\n }\n\n init(): void {\n if (!this.product) {\n this.product = this.createElement('div', [this.className]);\n }\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n\n if (this.className === 'shape-box' && !renderContent.some(c => c.hasShape && c.shapeType)) {\n // 当有一行配有形状的时候,其他行要对齐。如果没有一行配有形状,则删除所有的行\n Object.keys(this.children).forEach(key => {\n const i = toNumber(key);\n this.children[i].release();\n delete this.children[i];\n });\n } else {\n // 删除多余的行\n Object.keys(this.children).forEach(key => {\n const i = toNumber(key);\n if (i >= renderContent.length) {\n this.children[i].release();\n delete this.children[i];\n }\n });\n // 新增没有的行\n for (let i = 0; i < renderContent.length; i++) {\n if (!this.children[i]) {\n if (this.className === 'key-box' || this.className === 'value-box') {\n const text = new TextModel(this.product!, this._option, i);\n text.init([this.className.substring(0, this.className.indexOf('-'))], undefined, 'div');\n this.children[i] = text;\n } else if (this.className === 'shape-box') {\n const shape = new ShapeModel(this.product!, this._option, i);\n shape.init(['shape'], undefined, 'div');\n this.children[i] = shape;\n }\n }\n }\n }\n }\n\n setStyle() {\n const tooltipStyle = this._option.getTooltipStyle();\n\n super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));\n\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n const contentAttributes = this._option.getTooltipAttributes()?.content ?? [];\n renderContent.forEach((line, i) => {\n let childStyle: any = {};\n if (this.className === 'key-box') {\n const { key, isKeyAdaptive } = line;\n childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height),\n ...tooltipStyle.keyColumn.common,\n ...tooltipStyle.keyColumn.items?.[i]\n });\n const hasContent = (isString(key) && key?.trim?.() !== '') || isNumber(key);\n if (!hasContent && !childStyle.visibility) {\n childStyle.visibility = 'hidden';\n } else {\n childStyle.visibility = 'visible';\n }\n (this.children[i] as TextModel).setStyle(childStyle);\n } else if (this.className === 'value-box') {\n childStyle = mergeSpec({}, defaultValueStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height),\n ...tooltipStyle.valueColumn.common,\n ...tooltipStyle.valueColumn.items?.[i]\n });\n (this.children[i] as TextModel).setStyle(childStyle);\n } else if (this.className === 'shape-box') {\n childStyle = mergeSpec({}, defaultShapeStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height + contentAttributes[i].spaceRow),\n ...tooltipStyle.shapeColumn.common,\n ...tooltipStyle.shapeColumn.items?.[i]\n });\n (this.children[i] as ShapeModel)?.setStyle(childStyle, this._getShapeSvgOption(line, i));\n }\n });\n }\n\n setContent(): void {\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n const contentAttributes = this._option.getTooltipAttributes()?.content ?? [];\n renderContent.forEach((line, i) => {\n let childContent: any;\n if (this.className === 'key-box') {\n const keyContent = line.key;\n if ((isString(keyContent) && keyContent?.trim?.() !== '') || isNumber(keyContent)) {\n childContent = keyContent;\n } else {\n childContent = TOOLTIP_EMPTY_STRING;\n }\n (this.children[i] as TextModel)?.setContent(childContent, contentAttributes[i].key?.multiLine);\n } else if (this.className === 'value-box') {\n const valueContent = line.value;\n if ((isString(valueContent) && valueContent?.trim?.() !== '') || isNumber(valueContent)) {\n childContent = valueContent;\n } else {\n childContent = TOOLTIP_EMPTY_STRING;\n }\n (this.children[i] as TextModel)?.setContent(childContent, contentAttributes[i].value?.multiLine);\n } else if (this.className === 'shape-box') {\n childContent = this._getShapeSvgOption(line, i);\n this.children[i]?.setContent(childContent);\n }\n });\n }\n\n protected _getContentColumnStyle() {\n const tooltipStyle = this._option.getTooltipStyle();\n\n switch (this.className) {\n case 'shape-box':\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n return {\n ...tooltipStyle.shapeColumn,\n ...(this.className === 'shape-box' && !renderContent.some(c => c.hasShape && c.shapeType)\n ? { display: 'none' }\n : {})\n };\n case 'key-box':\n return tooltipStyle.keyColumn;\n case 'value-box':\n return tooltipStyle.valueColumn;\n }\n }\n\n protected _getShapeSvgOption(line: IToolTipLineActual, index: number): IShapeSvgOption {\n const tooltipStyle = this._option.getTooltipStyle();\n const shapeColumn = {\n ...tooltipStyle.shapeColumn,\n ...tooltipStyle.shapeColumn.items?.[index]\n };\n const keyColumn = {\n ...tooltipStyle.keyColumn,\n ...tooltipStyle.keyColumn.items?.[index]\n };\n return {\n hasShape: line.hasShape,\n symbolType: line.shapeType,\n size: shapeColumn.width,\n fill: line.shapeFill ?? line.shapeColor,\n stroke: line.shapeStroke,\n lineWidth: line.shapeLineWidth,\n hollow: line.shapeHollow,\n marginTop: `calc((${keyColumn.lineHeight ?? keyColumn.fontSize ?? '18px'} - ${shapeColumn.width ?? '8px'}) / 2)`\n } as IShapeSvgOption;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/component/tooltip/handler/dom/model/content-column-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAIhE,MAAM,OAAO,kBAAmB,SAA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AW;YACxB,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,SAAS,EAAE,SAAS,MAAA,MAAA,SAAS,CAAC,UAAU,mCAAI,SAAS,CAAC,QAAQ,mCAAI,MAAM,MAAM,MAAA,WAAW,CAAC,KAAK,mCAAI,KAAK,QAAQ;SAC9F,CAAC;IACvB,CAAC;CACF","file":"content-column-model.js","sourcesContent":["import { isNumber, isString, toNumber } from '@visactor/vutils';\nimport {\n defaultKeyStyle,\n defaultContentColumnStyle,\n defaultValueStyle,\n defaultAdaptiveKeyStyle,\n defaultShapeStyle\n} from './style-constants';\nimport { BaseTooltipModel } from './base-tooltip-model';\nimport type { ITooltipModelOption } from './interface';\nimport type { IShapeSvgOption } from './shape-model';\n// eslint-disable-next-line no-duplicate-imports\nimport { ShapeModel } from './shape-model';\nimport { TextModel } from './text-model';\nimport { TOOLTIP_EMPTY_STRING } from '../../constants';\nimport { getPixelPropertyStr } from '../util';\nimport type { IToolTipLineActual } from '../../../../../typings';\nimport { mergeSpec } from '../../../../../util/spec/merge-spec';\n\nexport type ContentColumnType = 'shape-box' | 'key-box' | 'value-box';\n\nexport class ContentColumnModel extends BaseTooltipModel {\n readonly className: ContentColumnType;\n\n constructor(\n parent: BaseTooltipModel | HTMLElement,\n option: ITooltipModelOption,\n className: ContentColumnType,\n childIndex?: number\n ) {\n super(parent, option, childIndex);\n this.className = className;\n }\n\n init(): void {\n if (!this.product) {\n this.product = this.createElement('div', [this.className]);\n }\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n\n if (this.className === 'shape-box' && !renderContent.some(c => c.hasShape && c.shapeType)) {\n // 当有一行配有形状的时候,其他行要对齐。如果没有一行配有形状,则删除所有的行\n Object.keys(this.children).forEach(key => {\n const i = toNumber(key);\n this.children[i].release();\n delete this.children[i];\n });\n } else {\n // 删除多余的行\n Object.keys(this.children).forEach(key => {\n const i = toNumber(key);\n if (i >= renderContent.length) {\n this.children[i].release();\n delete this.children[i];\n }\n });\n // 新增没有的行\n for (let i = 0; i < renderContent.length; i++) {\n if (!this.children[i]) {\n if (this.className === 'key-box' || this.className === 'value-box') {\n const text = new TextModel(this.product!, this._option, i);\n text.init([this.className.substring(0, this.className.indexOf('-'))], undefined, 'div');\n this.children[i] = text;\n } else if (this.className === 'shape-box') {\n const shape = new ShapeModel(this.product!, this._option, i);\n shape.init(['shape'], undefined, 'div');\n this.children[i] = shape;\n }\n }\n }\n }\n }\n\n setStyle() {\n const tooltipStyle = this._option.getTooltipStyle();\n\n super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));\n\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n const contentAttributes = this._option.getTooltipAttributes()?.content ?? [];\n renderContent.forEach((line, i) => {\n let childStyle: any = {};\n if (this.className === 'key-box') {\n const { key, isKeyAdaptive } = line;\n childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height),\n overflowWrap: 'normal', // 覆盖外界对此属性的预先配置\n ...tooltipStyle.keyColumn.common,\n ...tooltipStyle.keyColumn.items?.[i]\n } as Partial<CSSStyleDeclaration>);\n const hasContent = (isString(key) && key?.trim?.() !== '') || isNumber(key);\n if (!hasContent && !childStyle.visibility) {\n childStyle.visibility = 'hidden';\n } else {\n childStyle.visibility = 'visible';\n }\n (this.children[i] as TextModel).setStyle(childStyle);\n } else if (this.className === 'value-box') {\n childStyle = mergeSpec({}, defaultValueStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height),\n overflowWrap: 'normal', // 覆盖外界对此属性的预先配置\n ...tooltipStyle.valueColumn.common,\n ...tooltipStyle.valueColumn.items?.[i]\n } as Partial<CSSStyleDeclaration>);\n (this.children[i] as TextModel).setStyle(childStyle);\n } else if (this.className === 'shape-box') {\n childStyle = mergeSpec({}, defaultShapeStyle, {\n height: getPixelPropertyStr(contentAttributes[i].height + contentAttributes[i].spaceRow),\n ...tooltipStyle.shapeColumn.common,\n ...tooltipStyle.shapeColumn.items?.[i]\n });\n (this.children[i] as ShapeModel)?.setStyle(childStyle, this._getShapeSvgOption(line, i));\n }\n });\n }\n\n setContent(): void {\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n const contentAttributes = this._option.getTooltipAttributes()?.content ?? [];\n renderContent.forEach((line, i) => {\n let childContent: any;\n if (this.className === 'key-box') {\n const keyContent = line.key;\n if ((isString(keyContent) && keyContent?.trim?.() !== '') || isNumber(keyContent)) {\n childContent = keyContent;\n } else {\n childContent = TOOLTIP_EMPTY_STRING;\n }\n (this.children[i] as TextModel)?.setContent(childContent, contentAttributes[i].key?.multiLine);\n } else if (this.className === 'value-box') {\n const valueContent = line.value;\n if ((isString(valueContent) && valueContent?.trim?.() !== '') || isNumber(valueContent)) {\n childContent = valueContent;\n } else {\n childContent = TOOLTIP_EMPTY_STRING;\n }\n (this.children[i] as TextModel)?.setContent(childContent, contentAttributes[i].value?.multiLine);\n } else if (this.className === 'shape-box') {\n childContent = this._getShapeSvgOption(line, i);\n this.children[i]?.setContent(childContent);\n }\n });\n }\n\n protected _getContentColumnStyle() {\n const tooltipStyle = this._option.getTooltipStyle();\n\n switch (this.className) {\n case 'shape-box':\n const renderContent = this._option.getTooltipActual()?.content ?? [];\n return {\n ...tooltipStyle.shapeColumn,\n ...(this.className === 'shape-box' && !renderContent.some(c => c.hasShape && c.shapeType)\n ? { display: 'none' }\n : {})\n };\n case 'key-box':\n return tooltipStyle.keyColumn;\n case 'value-box':\n return tooltipStyle.valueColumn;\n }\n }\n\n protected _getShapeSvgOption(line: IToolTipLineActual, index: number): IShapeSvgOption {\n const tooltipStyle = this._option.getTooltipStyle();\n const shapeColumn = {\n ...tooltipStyle.shapeColumn,\n ...tooltipStyle.shapeColumn.items?.[index]\n };\n const keyColumn = {\n ...tooltipStyle.keyColumn,\n ...tooltipStyle.keyColumn.items?.[index]\n };\n return {\n hasShape: line.hasShape,\n symbolType: line.shapeType,\n size: shapeColumn.width,\n fill: line.shapeFill ?? line.shapeColor,\n stroke: line.shapeStroke,\n lineWidth: line.shapeLineWidth,\n hollow: line.shapeHollow,\n marginTop: `calc((${keyColumn.lineHeight ?? keyColumn.fontSize ?? '18px'} - ${shapeColumn.width ?? '8px'}) / 2)`\n } as IShapeSvgOption;\n }\n}\n"]}
|
|
@@ -77,8 +77,8 @@ function getLabelStyle(labelStyle, defaultStyle) {
|
|
|
77
77
|
return styleObj.fontFamily = labelFont, styleObj.fontSize = getPixelPropertyStr(labelFontSize),
|
|
78
78
|
styleObj.color = labelColor, styleObj.textAlign = textAlign, styleObj.lineHeight = getPixelPropertyStr(lineHeight),
|
|
79
79
|
styleObj.fontWeight = fontWeight, styleObj.whiteSpace = multiLine ? "initial" : "nowrap",
|
|
80
|
-
styleObj.wordBreak = wordBreak
|
|
81
|
-
styleObj;
|
|
80
|
+
styleObj.wordBreak = multiLine ? null != wordBreak ? wordBreak : "break-word" : "normal",
|
|
81
|
+
styleObj.maxWidth = getPixelPropertyStr(maxWidth), styleObj;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
function getShapeStyle(shapeStyle, defaultStyle) {
|