-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
TextBlock.html
1097 lines (1095 loc) · 65 KB
/
TextBlock.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TextBlock | GoJS API</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../assets/css/bootstrap.min.css">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<!-- non-fixed navbar -->
<nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top">
<div class="container-fluid">
<div class="navbar-header">
<div class="navheader-container">
<div class="navheader-collapse" data-toggle="collapse" data-target="#navbar">
<a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="../../index.html">Home</a></li>
<li><a href="../../learn/index.html">Learn</a></li>
<li><a href="../../samples/index.html">Samples</a></li>
<li><a href="../../intro/index.html">Intro</a></li>
<li><a href="../../api/index.html" target="api">API</a></li>
<li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li>
<li><a href="../../download.html">Download</a></li>
<li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li>
<li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li>
<li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li>
<li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="tsd-page-header">
<div class="tsd-page-toolbar">
<div class="container-fluid plr15">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">GoJS API</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container-fluid plr15">
<div class="top-copyright">
<!--<b>GoJS</b>® Diagramming Components<br/>version <br/>version 2.1.8 for TypeScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>-->
<b>GoJS</b>® Diagramming Components<br/>version 2.1.8<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>
</div>
<div>
<h1>Class TextBlock</h1>
</div>
</div>
</div>
</div>
</header>
<div class="container-fluid container-main plr15">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="GraphObject.html" class="tsd-signature-type">GraphObject</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">TextBlock</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<p>A TextBlock is a <a href="GraphObject.html">GraphObject</a> that displays a <a href="TextBlock.html#text">text</a> string in a given <a href="TextBlock.html#font">font</a>.</p>
<p>The size and appearance of the text is specified by <a href="TextBlock.html#font">font</a>,
which takes a well-formed CSS string as its value.
The order of the CSS properties given is important for cross-browser compatibility,
and should be given in this order:</p>
<p><em>"font-style font-variant font-weight font-size font-family"</em></p>
<p>For example, "Italic small-caps bold 32px Georgia, Serif" is a valid font string
using every CSS font property. Note that not all browsers may support every property.</p>
<p>Text is drawn using the <a href="TextBlock.html#stroke">stroke</a> brush, which may be any CSS color string or a <a href="Brush.html">Brush</a>.</p>
<p>Some created TextBlocks:</p>
<pre><code class="hljs js"><span class="hljs-keyword">var</span> $ = go.GraphObject.make; <span class="hljs-comment">// for conciseness in defining GraphObjects</span>
<span class="hljs-comment">// A TextBlock with text and stroke properties set:</span>
$(go.TextBlock, { <span class="hljs-attr">text</span>: <span class="hljs-string">"Hello World"</span>, <span class="hljs-attr">stroke</span>: <span class="hljs-string">"gray"</span> })
<span class="hljs-comment">// Alternatively:</span>
$(go.TextBlock, <span class="hljs-string">"Hello World"</span>, { <span class="hljs-attr">stroke</span>: <span class="hljs-string">"gray"</span> })</code></pre>
<p>TextBlocks typically receive a natural size based on their text and font strings,
but often a width is given in order to cause the text to wrap at a certain place.
In order for wrapping to occur, the <a href="TextBlock.html#wrap">wrap</a> property must not be <a href="TextBlock.html#static-None">TextBlock.None</a>.</p>
<p>TextBlocks can be edited by users using the <a href="TextEditingTool.html">TextEditingTool</a>.
The <a href="HTMLInfo.html">HTMLInfo</a> that a given TextBlock uses as its text editor can be customized
by setting the <a href="TextBlock.html#textEditor">textEditor</a> property. For an example of custom text editing tool use,
see the <a href="../../samples/customTextEditingTool.html">Custom TextEditingTool Sample</a>.</p>
<p class="boxread">
For examples of TextBlock possibilities and functionality,
see the <a href="../../intro/textBlocks.html">Introduction page on TextBlocks</a>.
</div>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="TextBlock.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#choices" class="tsd-kind-icon">choices</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#editable" class="tsd-kind-icon">editable</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#errorFunction" class="tsd-kind-icon">error<wbr>Function</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#flip" class="tsd-kind-icon">flip</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#font" class="tsd-kind-icon">font</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#graduatedEnd" class="tsd-kind-icon">graduated<wbr>End</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#graduatedFunction" class="tsd-kind-icon">graduated<wbr>Function</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#graduatedSkip" class="tsd-kind-icon">graduated<wbr>Skip</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#graduatedStart" class="tsd-kind-icon">graduated<wbr>Start</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#interval" class="tsd-kind-icon">interval</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#isMultiline" class="tsd-kind-icon">is<wbr>Multiline</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#isStrikethrough" class="tsd-kind-icon">is<wbr>Strikethrough</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#isUnderline" class="tsd-kind-icon">is<wbr>Underline</a></li>
<li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="TextBlock.html#lineCount" class="tsd-kind-icon">line<wbr>Count</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#maxLines" class="tsd-kind-icon">max<wbr>Lines</a></li>
<li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="TextBlock.html#naturalBounds" class="tsd-kind-icon">natural<wbr>Bounds</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#overflow" class="tsd-kind-icon">overflow</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#stroke" class="tsd-kind-icon">stroke</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#text" class="tsd-kind-icon">text</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#textAlign" class="tsd-kind-icon">text<wbr>Align</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#textEdited" class="tsd-kind-icon">text<wbr>Edited</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#textEditor" class="tsd-kind-icon">text<wbr>Editor</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#textValidation" class="tsd-kind-icon">text<wbr>Validation</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#verticalAlignment" class="tsd-kind-icon">vertical<wbr>Alignment</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="TextBlock.html#wrap" class="tsd-kind-icon">wrap</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-getBaseline" class="tsd-kind-icon">get<wbr>Baseline</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-getUnderline" class="tsd-kind-icon">get<wbr>Underline</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-setBaseline" class="tsd-kind-icon">set<wbr>Baseline</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-setUnderline" class="tsd-kind-icon">set<wbr>Underline</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Constants</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-None" class="tsd-kind-icon">None</a></li>
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-OverflowClip" class="tsd-kind-icon">Overflow<wbr>Clip</a></li>
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-OverflowEllipsis" class="tsd-kind-icon">Overflow<wbr>Ellipsis</a></li>
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-WrapBreakAll" class="tsd-kind-icon">Wrap<wbr>Break<wbr>All</a></li>
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-WrapDesiredSize" class="tsd-kind-icon">Wrap<wbr>Desired<wbr>Size</a></li>
<li class="tsd-kind-constant tsd-parent-kind-class tsd-is-static"><a href="TextBlock.html#static-WrapFit" class="tsd-kind-icon">Wrap<wbr>Fit</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>
constructor
</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Text<wbr>Block<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>A newly constructed <a href="TextBlock.html">TextBlock</a> has no string to show; if it did,
it would draw the text, wrapping if needed, in the default font using a black stroke.</p>
</div>
<h4 class="tsd-returns-title">Returns <a href="TextBlock.html" class="tsd-signature-type">TextBlock</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="choices" class="tsd-anchor"></a>
<h3>
choices
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the an array of possible choices for a custom <a href="TextEditingTool.html">TextEditingTool</a>.
The value must be an array of strings.</p>
<p>The default value is null.
For example usage, see the <a href="../../samples/customTextEditingTool.html">Custom TextEditingTool Sample</a>.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="editable" class="tsd-anchor"></a>
<h3>
editable
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether or not this TextBlock allows in-place editing of the <a href="TextBlock.html#text">text</a>
string by the user with the help of the <a href="TextEditingTool.html">TextEditingTool</a>.
The default is false.</p>
<p>See also <a href="Part.html#textEditable">Part.textEditable</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="errorFunction" class="tsd-anchor"></a>
<h3>
error<wbr>Function
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">tool</span><span class="tsd-signature-symbol">: </span><a href="TextEditingTool.html" class="tsd-signature-type">TextEditingTool</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">oldString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">newString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the function to call if a text edit made with the <a href="TextEditingTool.html">TextEditingTool</a> is invalid.
The default is null.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="flip" class="tsd-anchor"></a>
<h3>
flip
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets how the TextBlock is displayed: Either normally or with a Horizontal or Vertical flip or both.</p>
<p>Possible values are <a href="GraphObject.html#static-None">GraphObject.None</a>, <a href="GraphObject.html#static-FlipHorizontal">GraphObject.FlipHorizontal</a>, <a href="GraphObject.html#static-FlipVertical">GraphObject.FlipVertical</a>, or <a href="GraphObject.html#static-FlipBoth">GraphObject.FlipBoth</a>.
The default is <a href="GraphObject.html#static-None">GraphObject.None</a>.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="font" class="tsd-anchor"></a>
<h3>
font
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the current font settings.
The font property must be a valid CSS string describing a font.
The font string can accept several CSS properties but they must be
in a specific order in order to render correctly across all browsers:</p>
<p><code>"font-style font-variant font-weight font-size font-family"</code></p>
<p>For example, <code>"Italic small-caps bold 32px Georgia, Serif"</code> is a valid font string
using every CSS font property. Not every browser can render every font option.
For more information about CSS font syntax, see <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font">CSS fonts (mozilla.org)</a>.</p>
<p>If your Node sizes depend on TextBlocks, it is best to ensure any custom fonts you are using are finished loading before you load your Diagram.
This will ensure nodes are sized appropriately for the initial Diagram layout.</p>
<p>The default font is "13px sans-serif".</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedEnd" class="tsd-anchor"></a>
<h3>
graduated<wbr>End
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the fractional distance along the main shape of a "Graduated" <a href="Panel.html">Panel</a> at which this kind of tick text should end.
The default is 1; the value should range from 0 to 1.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedFunction" class="tsd-anchor"></a>
<h3>
graduated<wbr>Function
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the function to convert from a value along a "Graduated" <a href="Panel.html">Panel</a> to a string.
The default returns a string representing the value rounded to at most 2 decimals.</p>
<p>The function takes a number argument, a value between <a href="Panel.html#graduatedMin">Panel.graduatedMin</a> and <a href="Panel.html#graduatedMax">Panel.graduatedMax</a>.
The function will return a string, the text that will appear at the value of the argument.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedSkip" class="tsd-anchor"></a>
<h3>
graduated<wbr>Skip
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the function to determine which values along a "Graduated" <a href="Panel.html">Panel</a> will be skipped.
The default is null and doesn't skip any text labels.</p>
<p>The function takes a number argument, a value between <a href="Panel.html#graduatedMin">Panel.graduatedMin</a> and <a href="Panel.html#graduatedMax">Panel.graduatedMax</a>.
The function will return a boolean, whether the text label will be skipped at the value of the argument.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedStart" class="tsd-anchor"></a>
<h3>
graduated<wbr>Start
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the fractional distance along the main shape of a "Graduated" <a href="Panel.html">Panel</a> at which this text should start.
The default is 0; the value should range from 0 to 1.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="interval" class="tsd-anchor"></a>
<h3>
interval
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets how frequently this text should be drawn within a "Graduated" <a href="Panel.html">Panel</a>,
in multiples of the <a href="Panel.html#graduatedTickUnit">Panel.graduatedTickUnit</a>.
The default is 1. Any new value must be a positive integer.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isMultiline" class="tsd-anchor"></a>
<h3>
is<wbr>Multiline
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether or not the text displays multiple lines or embedded newlines.
If this is false, all characters including and after the first newline will be omitted.
The default is true.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#maxLines">maxLines</a></p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isStrikethrough" class="tsd-anchor"></a>
<h3>
is<wbr>Strikethrough
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether or not the text has a strikethrough line (line-through).
The default is false.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#isUnderline">isUnderline</a></p>
</dd>
<dt>since</dt>
<dd><p>1.2</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isUnderline" class="tsd-anchor"></a>
<h3>
is<wbr>Underline
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether or not the text is underlined.
The default is false.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#isStrikethrough">isStrikethrough</a></p>
</dd>
<dt>since</dt>
<dd><p>1.2</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class">
<a name="lineCount" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagReadOnly">Read-only</span>
line<wbr>Count
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This read-only property returns the total number of lines in this TextBlock, including lines created
from embedded newlines (<code>\n</code>), <a href="TextBlock.html#wrap">wrap</a>ping, and <a href="TextBlock.html#maxLines">maxLines</a>.</p>
<p>This value may be meaningless before the TextBlock is measured.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="maxLines" class="tsd-anchor"></a>
<h3>
max<wbr>Lines
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the maximum number of lines that this TextBlock can display.
Value must be a greater than zero whole number or <code>Infinity</code>.
The default is <code>Infinity</code>.</p>
<p>Modifying this value may modify the computed height of the TextBlock.
If maxLines is set, the value of <a href="TextBlock.html#lineCount">lineCount</a> will never be larger than maxLines.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#isMultiline">isMultiline</a></p>
</dd>
<dt>since</dt>
<dd><p>1.5</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class">
<a name="naturalBounds" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagOverride">Override</span>
<span class="tsd-flag ts-flagReadOnly">Read-only</span>
natural<wbr>Bounds
<span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type">Rect</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This read-only property returns the natural bounds of this TextBlock in local coordinates,
as determined by its <a href="TextBlock.html#font">font</a> and <a href="TextBlock.html#text">text</a> string, and optionally its <a href="GraphObject.html#desiredSize">desiredSize</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="overflow" class="tsd-anchor"></a>
<h3>
overflow
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets how text that is too long to display should be handled.</p>
<p>Possible values are <a href="TextBlock.html#static-OverflowClip">TextBlock.OverflowClip</a> and <a href="TextBlock.html#static-OverflowEllipsis">TextBlock.OverflowEllipsis</a>.
For OverflowEllipsis to work, you must constrain the available size of the TextBlock in some way,
such as setting <a href="TextBlock.html#wrap">wrap</a> to <a href="TextBlock.html#static-None">TextBlock.None</a>,
or limiting the number of lines with <a href="TextBlock.html#maxLines">maxLines</a> or a height constraint.</p>
<p>The default value is <a href="TextBlock.html#static-OverflowClip">TextBlock.OverflowClip</a>.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#wrap">wrap</a></p>
</dd>
<dt>since</dt>
<dd><p>1.4</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="stroke" class="tsd-anchor"></a>
<h3>
stroke
<span class="tsd-signature-symbol">: </span><a href="../index.html#BrushLike" class="tsd-signature-type">BrushLike</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="Brush.html">Brush</a> or string that describes the stroke (color) of the text that is drawn.</p>
<p>The default value is <code>"black"</code>.
Any valid CSS string can specify a solid color, and the <a href="Brush.html">Brush</a>
class can be used to specify a gradient or pattern.
More information about the syntax of CSS color strings is available at:
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">CSS colors (mozilla.org)</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="text" class="tsd-anchor"></a>
<h3>
text
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the TextBlock's text string. The default is an empty string.
The text of a TextBlock, along with the values of <a href="TextBlock.html#font">font</a>, <a href="TextBlock.html#wrap">wrap</a>,
<a href="TextBlock.html#isMultiline">isMultiline</a> and sizing restrictions are what naturally determine
the size of the TextBlock.</p>
<p>The text in textblocks can include manual line-breaks by using the character escape, <code>\n</code>.</p>
<p>Leading and trailing whitespace is eliminated in each line of TextBlock text.</p>
<p>If <a href="TextBlock.html#editable">editable</a> is set to true, users can edit textblocks with the <a href="TextEditingTool.html">TextEditingTool</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="textAlign" class="tsd-anchor"></a>
<h3>
text<wbr>Align
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"left"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"right"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"start"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"end"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"center"</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the alignment location in the TextBlock's given space.
The only possible values are <code>"start"</code>, <code>"end"</code>, <code>"left"</code>, <code>"right"</code>, and <code>"center"</code>.
Any other value is invalid.</p>
<p>This property is most pertinent when the TextBlock has multiple lines of text,
or when the TextBlock is given a size that differs from the text's natural size (such as with <a href="GraphObject.html#desiredSize">desiredSize</a>).</p>
<p>In left-to-right writing systems, <code>"start"</code> and <code>"left"</code> are synonymous, as are <code>"end"</code> and <code>"right"</code>.</p>
<p>The default is <code>"start"</code>.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#verticalAlignment">verticalAlignment</a></p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="textEdited" class="tsd-anchor"></a>
<h3>
text<wbr>Edited
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">thisTextBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">oldString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">newString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the function that is called after the TextBlock's text has been edited by the <a href="TextEditingTool.html">TextEditingTool</a>.</p>
<ul>
<li>The first argument is a reference to this TextBlock.</li>
<li>The second argument is the previous text, before editing.</li>
<li>The third argument is the current text, which is also TextBlock.text.</li>
</ul>
<pre><code class="hljs js"><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">textBlock, previousText, currentText</span>)</span></code></pre>
<p>The default value is null -- no function is called.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="textEditor" class="tsd-anchor"></a>
<h3>
text<wbr>Editor
<span class="tsd-signature-symbol">: </span><a href="HTMLInfo.html" class="tsd-signature-type">HTMLInfo</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the HTMLInfo that this TextBlock uses as its text editor in the TextEditingTool.
If null, the TextBlock will use the default text editor of the <a href="TextEditingTool.html">TextEditingTool</a>.
The default is null.
The value should be set to an instance of <a href="HTMLInfo.html">HTMLInfo</a>.</p>
<p>As of 2.0 setting this to an HTML Element is no longer supported.</p>
<p>For example usage, see the <a href="../../samples/customTextEditingTool.html">Custom TextEditingTool Sample</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="textValidation" class="tsd-anchor"></a>
<h3>
text<wbr>Validation
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">thisTextBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">oldString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">newString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the predicate that determines whether or not a user-edited string of text is valid.
If this is non-null, the predicate is called in addition to any <a href="TextEditingTool.html#textValidation">TextEditingTool.textValidation</a> predicate.
See <a href="TextEditingTool.html#isValidText">TextEditingTool.isValidText</a> for more details.</p>
<pre><code class="hljs js"><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">textBlock, oldString, newString</span>)</span></code></pre>
<p>The default predicate is null, which is equivalent to simply returning true.</p>
<p>The function, if supplied, must not have any side-effects, and must return true or false.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextEditingTool.html#textValidation">TextEditingTool.textValidation</a></p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="verticalAlignment" class="tsd-anchor"></a>
<h3>
vertical<wbr>Alignment
<span class="tsd-signature-symbol">: </span><a href="Spot.html" class="tsd-signature-type">Spot</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the vertical alignment <a href="Spot.html">Spot</a> of this TextBlock, used when
the TextBlock has more available vertical space than it needs to draw all lines.</p>
<p>The default value is <a href="Spot.html#static-Top">Spot.Top</a>, which aligns the TextBlock to the top of its available space.</p>
<p>The <a href="TextBlock.html#textAlign">textAlign</a> is often used along with this property to specify
where the should be positioned in its available space.</p>
<p>This does not affect TextBlock coordinates or bounds, it only affects where text is drawn within the given area.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#textAlign">textAlign</a></p>
</dd>
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="wrap" class="tsd-anchor"></a>
<h3>
wrap
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets whether the text should be wrapped if it is too long to fit on one line.</p>
<p>Possible values are <a href="TextBlock.html#static-WrapDesiredSize">TextBlock.WrapDesiredSize</a>, <a href="TextBlock.html#static-WrapFit">TextBlock.WrapFit</a>, <a href="TextBlock.html#static-WrapBreakAll">TextBlock.WrapBreakAll</a>,
and <a href="TextBlock.html#static-None">TextBlock.None</a>.</p>
<p>The default value is <a href="TextBlock.html#static-WrapDesiredSize">TextBlock.WrapDesiredSize</a>.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="TextBlock.html#overflow">overflow</a></p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-getBaseline" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
get<wbr>Baseline
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">get<wbr>Baseline<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets the function that, given the TextBlock and numerical text height, computes the position to draw the baseline of a line of text in all TextBlocks.
By default this is null and default behavior returns <code>(textHeight * 0.75)</code>.</p>
<p>Note: This affects drawing only, and does not change TextBlock measurement calculations.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">null</span>
</h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-getUnderline" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
get<wbr>Underline
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">get<wbr>Underline<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets the function that, given the TextBlock and numerical text height, computes the position to draw the underline of a line of text in all TextBlocks.
By default this is null and default behavior returns <code>(textHeight * 0.75)</code>.</p>
<p>Note: This affects drawing only, and does not change TextBlock measurement calculations.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>
<span class="tsd-signature-symbol"> | </span>
<span class="tsd-signature-type">null</span>
</h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-setBaseline" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
set<wbr>Baseline
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">set<wbr>Baseline<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Sets the function that, given the TextBlock and numerical text height, computes the position to draw the baseline of a line of text in all TextBlocks.</p>
<p>Note: This affects drawing only, and does not change TextBlock measurement calculations.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-setUnderline" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
set<wbr>Underline
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">set<wbr>Underline<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Sets the function that, given the TextBlock and numerical text height, computes the position to draw the underline of a line of text in all TextBlocks.</p>
<p>Note: This affects drawing only, and does not change TextBlock measurement calculations.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>value: <span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">textBlock</span><span class="tsd-signature-symbol">: </span><a href="TextBlock.html" class="tsd-signature-type">TextBlock</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">textHeight</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constants</h2>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-None" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagOverride">Override</span>
None
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used as a value for <a href="TextBlock.html#wrap">TextBlock.wrap</a>, the TextBlock will not wrap its text.</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-OverflowClip" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
Overflow<wbr>Clip
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used as the default value for <a href="TextBlock.html#overflow">TextBlock.overflow</a>: if the width is too small to display all text,
the TextBlock will clip.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.4</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-OverflowEllipsis" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
Overflow<wbr>Ellipsis
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used as a value for <a href="TextBlock.html#overflow">TextBlock.overflow</a>: if the width is too small to display all text,
the TextBlock will display an ellipsis.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.4</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-WrapBreakAll" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
Wrap<wbr>Break<wbr>All
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used a a value for <a href="TextBlock.html#wrap">TextBlock.wrap</a>, the TextBlock will attempt to wrap at each character, allowing
breaks within "words."</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-WrapDesiredSize" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
Wrap<wbr>Desired<wbr>Size
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used as the default value for <a href="TextBlock.html#wrap">TextBlock.wrap</a>, the TextBlock will wrap text and the width of
the TextBlock will be the desiredSize's width, if any.</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-constant tsd-parent-kind-class tsd-is-static">
<a name="static-WrapFit" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
Wrap<wbr>Fit
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<div class="tsd-comment tsd-typography">
<p>Used as a value for <a href="TextBlock.html#wrap">TextBlock.wrap</a>, the TextBlock will wrap text, making the width of
the TextBlock equal to the width of the longest line.</p>
</div>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../index.html"><em>GoJS <wbr>Class <wbr>Index</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class">
<a href="TextBlock.html" class="tsd-kind-icon">Text<wbr>Block</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="TextBlock.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#choices" class="tsd-kind-icon">choices</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#editable" class="tsd-kind-icon">editable</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#errorFunction" class="tsd-kind-icon">error<wbr>Function</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#flip" class="tsd-kind-icon">flip</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#font" class="tsd-kind-icon">font</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#graduatedEnd" class="tsd-kind-icon">graduated<wbr>End</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#graduatedFunction" class="tsd-kind-icon">graduated<wbr>Function</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#graduatedSkip" class="tsd-kind-icon">graduated<wbr>Skip</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#graduatedStart" class="tsd-kind-icon">graduated<wbr>Start</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#interval" class="tsd-kind-icon">interval</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#isMultiline" class="tsd-kind-icon">is<wbr>Multiline</a>
</li>
<li class=" tsd-kind-accessor tsd-parent-kind-class">
<a href="TextBlock.html#isStrikethrough" class="tsd-kind-icon">is<wbr>Strikethrough</a>
</li>