antvis / S2

⚡️ A practical visualization library for tabular analysis.

Home Page:https://s2.antv.antgroup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛当设置文本自动换行时,设置单元格高度无效

Gxyrious opened this issue · comments

🏷 Version

Package Version
@antv/s2 2.0.0-next.15
@antv/s2-react
@antv/s2-vue

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

当设置文本自动换行,调整单元格高度无法生效,希望后者优先级高于自动换行,从而可以让这个表格不同区域展示不同内容。感觉应该算是个bug?

比如有这种场景:在明细表里设置第一行的高度并且希望它展示的是S2的图,而且把第一行frozen起来,frozen: { rowCount: 1, },,作为整个列数据的可视化,除了第一行之外的单元格都是文本,有多行换行的需求。

⌨️ Code Snapshots

比如这个示例https://s2.antv.antgroup.com/zh/examples/layout/custom/#custom-table-size,修改其s2Options:

  • 不设置自动换行,wordWrap = false
const s2Options: S2Options = {
  width: 600,
  height: 480,
  style: {
    dataCell: {},
    rowCell: {
      heightByField: {
        '0': 40,
        '1': 130,
        '3': 60,
        '10': 80,
        '15': 20,
      },
    },
  },
};

图片

  • 设置自动换行,指定行的高度就无效了
const s2Options: S2Options = {
  width: 600,
  height: 480,
  style: {
    dataCell: {
      maxLines: 4,
      wordWrap: true,
      textOverflow: 'ellipsis',
    },
    rowCell: {
      heightByField: {
        '0': 40,
        '1': 130,
        '3': 60,
        '10': 80,
        '15': 20,
      },
    },
  },
};

图片

😊 Expected Behavior

指定了高度的单元格不受文本自动换行的影响

  • 这是没有开启自动换行时达到的效果,希望开启后仍能保持,第一行的图来自官网示例
    图片

😅 Current Behavior

指定单元格高度的行为无效

💻 System information

Environment Info
System
Browser

你好 @Gxyrious,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.

Hello, @Gxyrious, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.

🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.17 🎉

The release is available on:

Your semantic-release bot 📦🚀