AbimannanMuthusamy / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Multiline string in labels #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, Simon!

I am using you library to visualize something like task flow 
http://dl.dropbox.com/u/1383480/work/2010-10-20_120556.png
As you can see sometimes labels are very long

It would be nice if labels can be drawn in multiple lines
 when they contain '\n' characters

maybe this will give you a clue how to render text in multiple lines
http://gist.github.com/366054

Original issue reported on code.google.com by astro64m@googlemail.com on 20 Oct 2010 at 8:10

GoogleCodeExporter commented 9 years ago
i knew someone would ask for this ;)

it's a good idea.  will look into it.  thanks for the link!

Original comment by simon.po...@gmail.com on 20 Oct 2010 at 8:58

GoogleCodeExporter commented 9 years ago
this is supported in 1.2.4-RC1 now.  as per the example link you sent, labels 
are split by "\n".  rotation is not supported and neither is a custom line 
height.

you'd have to include the dev scripts to use this right now:

<script type="text/javascript" 
src="BASE/js/1.2.4/jsPlumb-1.2.4-RC1.js"></script>
<script type="text/javascript" 
src="BASE/js/1.2.4/jsPlumb-defaults-1.2.4-RC1.js"></script>
<script type="text/javascript" 
src="BASE/js/1.2.4/jquery.jsPlumb-1.2.4-RC1.js"></script>
<script type="text/javascript" src="BASE/js/1.2.4/jsBezier-0.1.js"></script>

Original comment by simon.po...@gmail.com on 21 Oct 2010 at 9:24

GoogleCodeExporter commented 9 years ago
Thanks, Simon, I tried dev scripts, one problem remains:
I think, you should use "\\n" instead of "\n" here:
http://code.google.com/p/jsplumb/source/browse/trunk/js/1.2.4/jsPlumb-defaults-1
.2.4-RC1.js?spec=svn618&r=618#629

Original comment by astro64m@googlemail.com on 24 Oct 2010 at 9:01

GoogleCodeExporter commented 9 years ago
It was my error, everything works

however I have another suggestion: do you mind to split by \r\n too?
 .split(/\r\n|\n/);

Original comment by astro64m@googlemail.com on 24 Oct 2010 at 9:08

GoogleCodeExporter commented 9 years ago
hey..i only just saw your comment...i released 1.2.4 tonight.  will reopen and 
target 1.2.5.

Original comment by simon.po...@gmail.com on 27 Nov 2010 at 1:17

GoogleCodeExporter commented 9 years ago
this fix is in 1.2.5-RC1 now.  you'll have to use the dev scripts until i 
release 1.2.5:

<script type="text/javascript" 
src="BASE/js/1.2.5/jsPlumb-1.2.5-RC1.js"></script>
<script type="text/javascript" 
src="BASE/js/1.2.5/jsPlumb-defaults-1.2.5-RC1.js"></script>
<script type="text/javascript" 
src="BASE/js/1.2.5/jquery.jsPlumb-1.2.5-RC1.js"></script>
<script type="text/javascript" src="BASE/js/1.2.5/jsBezier-0.1.js"></script>

Original comment by simon.po...@gmail.com on 30 Nov 2010 at 2:34

GoogleCodeExporter commented 9 years ago
1.2.5 released recently. this issue closed.

Original comment by simon.po...@gmail.com on 8 Dec 2010 at 4:24