forked from github/dataease
feat: 词云图字体大小区间调整
This commit is contained in:
parent
2ffce2cebd
commit
b8eff71779
@ -146,7 +146,8 @@ export const DEFAULT_SIZE = {
|
||||
mapLineAnimate: true,
|
||||
mapLineAnimateDuration: 3,
|
||||
mapLineAnimateInterval: 1,
|
||||
mapLineAnimateTrailLength: 1
|
||||
mapLineAnimateTrailLength: 1,
|
||||
wordSizeRange: [8, 32]
|
||||
}
|
||||
export const DEFAULT_SUSPENSION = {
|
||||
show: true
|
||||
|
@ -1746,7 +1746,8 @@ export const TYPE_CONFIGS = [
|
||||
properties: [
|
||||
'color-selector',
|
||||
'tooltip-selector-ant-v',
|
||||
'title-selector-ant-v'
|
||||
'title-selector-ant-v',
|
||||
'size-selector-ant-v'
|
||||
],
|
||||
propertyInner: {
|
||||
'color-selector': [
|
||||
@ -1754,6 +1755,9 @@ export const TYPE_CONFIGS = [
|
||||
'custom',
|
||||
'alpha'
|
||||
],
|
||||
'size-selector-ant-v': [
|
||||
'wordSizeRange'
|
||||
],
|
||||
'tooltip-selector-ant-v': [
|
||||
'show',
|
||||
'textStyle'
|
||||
|
@ -12,6 +12,14 @@ export function baseWordCloudOptionAntV(plot, container, chart, action) {
|
||||
const tooltip = getTooltip(chart)
|
||||
// data
|
||||
const data = chart.data.data
|
||||
// size
|
||||
let wordSizeRange = [8, 32]
|
||||
if (chart.customAttr) {
|
||||
const customAttr = JSON.parse(chart.customAttr)
|
||||
if (customAttr?.size?.wordSizeRange) {
|
||||
wordSizeRange = customAttr?.size?.wordSizeRange
|
||||
}
|
||||
}
|
||||
// options
|
||||
const options = {
|
||||
theme: theme,
|
||||
@ -21,7 +29,7 @@ export function baseWordCloudOptionAntV(plot, container, chart, action) {
|
||||
colorField: 'field',
|
||||
wordStyle: {
|
||||
fontFamily: 'Verdana',
|
||||
fontSize: [8, 32],
|
||||
fontSize: wordSizeRange,
|
||||
rotation: [0, 0],
|
||||
padding: 6
|
||||
},
|
||||
|
@ -1365,6 +1365,21 @@
|
||||
@change="changeBarSizeCase('mapLineAnimateTrailLength')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- word-cloud start -->
|
||||
<el-form-item
|
||||
v-show="showProperty('wordSizeRange') "
|
||||
:label="$t('chart.text_fontsize')"
|
||||
class="form-item form-item-slider"
|
||||
>
|
||||
<el-slider
|
||||
v-model="sizeForm.wordSizeRange"
|
||||
:min="1"
|
||||
:max="100"
|
||||
range
|
||||
@change="changeBarSizeCase('wordSizeRange')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- word-cloud end -->
|
||||
</div>
|
||||
</el-form>
|
||||
<!--flow-map-end-->
|
||||
@ -1574,8 +1589,9 @@ export default {
|
||||
this.sizeForm.mapLineAnimateInterval = this.sizeForm.mapLineAnimateInterval !== undefined ? this.sizeForm.mapLineAnimateInterval : DEFAULT_SIZE.mapLineAnimateInterval
|
||||
this.sizeForm.mapLineAnimateTrailLength = this.sizeForm.mapLineAnimateTrailLength !== undefined ? this.sizeForm.mapLineAnimateTrailLength : DEFAULT_SIZE.mapLineAnimateTrailLength
|
||||
if (this.sizeForm.gaugeAxisLine === null || this.sizeForm.gaugeAxisLine === undefined) {
|
||||
this.sizeForm.gaugeAxisLine = DEFAULT_SIZE.gaugeAxisLine
|
||||
this.sizeForm.gaugeAxisLine = DEFAULT_SIZE.gaugeAxisLin
|
||||
}
|
||||
this.sizeForm.wordSizeRange = this.sizeForm !== undefined ? this.sizeForm.wordSizeRange : DEFAULTSIZE.wordSizeRange
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user