How to wrap lengthy text in JointJs Rectangle

安稳与你 提交于 2019-12-12 03:18:50

问题


Can anyone tell me how to wrap lengthy text inside rectangle in JointJS.

Thanks in advance


回答1:


You can use either "TextBlock" or if you trying to create a custom element you can write like this

joint.shapes.devs.testModel = joint.shapes.basic.TextBlock.extend( {

markup: ['<g class="rotatable"><g class="scalable"><rect class="body"/><rect class="leftthick"/></g>',
         joint.env.test('svgforeignobject') ? '<foreignObject class="fobj"><body xmlns="http://www.w3.org/1999/xhtml"><div class="content"/></body></foreignObject>' : '<text class="content"/>',
         '<image/><text class="label"/><g class="inPorts"/><g class="outPorts"/>',            
        '</g>'].join(''),

defaults: joint.util.deepSupplement({


来源:https://stackoverflow.com/questions/32887992/how-to-wrap-lengthy-text-in-jointjs-rectangle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!