官网字体图标首次加载不显示
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
浏览器禁用缓存情况下,首次加载@antv/graphin-icons提供的字体时,图标不显示,缩放或鼠标悬停一下后,图标出现
**To Reproduce**
- 禁用浏览器缓存
- 刷新页面
- 图标显示为空
- 缩放画布或鼠标悬浮到节点上,图表显示出来
开启缓存的情况下,除第一次外,无上述情况
**Expected behavior**
图标正常加载出来
**Desktop (please complete the following information):**
- OS: [Mac OS]
- Browser [chrome]
- Version [chrome 90.0.4430.93]
**Additional context**
字体加载时机的问题,从network里可以看出,字体文件`at.alicdn.com/t/font_1522921_m3irqw8ynx.woff2`请求顺序靠后
临时解决办法为,绘制之前,在页面标签内预先使用一个字体,例
```
`
```
附版本信息
```
"@antv/graphin": "^2.0.6",
"@antv/graphin-icons": "^1.0.0",
```
Contributor guide
Research direction
Reproduce the issue in Chrome with caching disabled, using the @antv/graphin 2.0.6 and @antv/graphin-icons 1.0.0 versions described. Inspect when the graphin font request occurs relative to the initial icon render; done means the icons appear on the first page load without zooming or hovering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100