diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 510767a054..440564faae 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1107,7 +1107,9 @@ export default { add_condition: '添加条件', chart_quadrant: '象限图', quadrant: '象限', - font_size: '字号' + font_size: '字号', + word_size_range: '字号区间', + word_spacing: '文字间隔' }, dataset: { scope_edit: '仅编辑时生效', diff --git a/core/core-frontend/src/models/chart/chart-attr.d.ts b/core/core-frontend/src/models/chart/chart-attr.d.ts index 368903c713..681f8776fa 100644 --- a/core/core-frontend/src/models/chart/chart-attr.d.ts +++ b/core/core-frontend/src/models/chart/chart-attr.d.ts @@ -542,6 +542,14 @@ declare interface ChartMiscAttr { * 指标/文本卡垂直位置 */ vPosition: 'top' | 'center' | 'bottom' + /** + * 词云图字体大小区间 + */ + wordSizeRange: [number, number] + /** + * 词云图文字间距 + */ + wordSpacing: number } /** * 动态极值配置 diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index 80a846696a..59020c9cc2 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -121,7 +121,9 @@ export const customAttrTrans = { 'valueFontSize', 'spaceSplit', // 间隔 'scatterSymbolSize', // 气泡大小,散点图 - 'radarSize' // 雷达占比 + 'radarSize', // 雷达占比 + 'wordSizeRange', + 'wordSpacing' ], label: ['fontSize'], tooltip: ['fontSize'], @@ -278,6 +280,13 @@ export const mobileSpecialProps = { } export function getScaleValue(propValue, scale) { + if (propValue instanceof Array) { + propValue.forEach((v, i) => { + const val = Math.round(v * scale) + propValue[i] = val > 1 ? val : 1 + }) + return propValue + } const propValueTemp = Math.round(propValue * scale) return propValueTemp > 1 ? propValueTemp : 1 } diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue index f67134680b..1da18464d6 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue @@ -1,19 +1,16 @@