VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
1.01k stars 72 forks source link

[Bug] word cloud render empty after setting `maskShape:triangle` #3359

Closed youngwinds closed 1 week ago

youngwinds commented 3 weeks ago

Version

1.2.6

Link to Minimal Reproduction

none

Steps to Reproduce

const spec = {
  "type": "wordCloud",
  "nameField": "241028211750015",
  "fontSizeRange": [
    10,
    50
  ],
  "fontWeightRange": [
    400,
    400
  ],
  "random": false,
  "wordCloudConfig": {
    "zoomToFit": {
      "shrink": true,
      "enlarge": true,
      "fontSizeLimitMin": 5
    }
  },
  "word": {
    "padding": 0,
    "state": {
      "hover": {
        "cursor": "pointer",
        "fillOpacity": 0.8,
        "stroke": "#58595B",
        "lineWidth": 1,
        "zIndex": 500
      },
      "selected": {
        "cursor": "pointer",
        "fillOpacity": 1,
        "stroke": "#58595B",
        "lineWidth": 1
      },
      "selected_reverse": {
        "fillOpacity": 0.3,
        "lineWidth": 0.3
      }
    }
  },
  "padding": 0,
  "maskShape": "triangle",
  "data": [
    {
      "id": "data",
      "values": [
        {
          "241028211750015": "华东"
        },
        {
          "241028211750015": "西南"
        },
        {
          "241028211750015": "中南"
        },
        {
          "241028211750015": "西北"
        },
        {
          "241028211750015": "东北"
        },
        {
          "241028211750015": "华北"
        }
      ],
      "fields": {
        "241028211750015": {
          "alias": "地区"
        }
      }
    }
  ],
  "seriesField": "241028211750015",
  "color": {
    "field": "241028211750015",
    "type": "ordinal",
    "range": [
      "#009db5",
      "#f2b823",
      "#eb7006",
      "#1f5273",
      "#3da241",
      "#77bfc8"
    ],
    "specified": {}
  },
  "hover": {
    "enable": true
  },
  "select": {
    "enable": true
  },
  "tooltip": {
    "handler": {}
  },
  "region": [
    {
      "clip": true
    }
  ],
  "background": "rgba(255, 255, 255, 0)",
  "animation": false,
  "hash": "ee00a4a4ddf16da3835daa7b49469019"
}

Current Behavior

none

Expected Behavior

none

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

xile611 commented 1 week ago

fixed in 1.12.11