-
Notifications
You must be signed in to change notification settings - Fork 1
/
tables.html
1107 lines (1075 loc) · 152 KB
/
tables.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 xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.433">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Deepansh Khurana">
<title>Tables for Personal Finance (Ebenezer)</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
<script src="tables_files/libs/clipboard/clipboard.min.js"></script>
<script src="tables_files/libs/quarto-html/quarto.js"></script>
<script src="tables_files/libs/quarto-html/popper.min.js"></script>
<script src="tables_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="tables_files/libs/quarto-html/anchor.min.js"></script>
<link href="tables_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="tables_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="tables_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="tables_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="tables_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script src="tables_files/libs/core-js-2.5.3/shim.min.js"></script>
<script src="tables_files/libs/react-18.2.0/react.min.js"></script>
<script src="tables_files/libs/react-18.2.0/react-dom.min.js"></script>
<script src="tables_files/libs/reactwidget-1.0.0/react-tools.js"></script>
<script src="tables_files/libs/htmlwidgets-1.6.4/htmlwidgets.js"></script>
<link href="tables_files/libs/reactable-0.4.4/reactable.css" rel="stylesheet">
<script src="tables_files/libs/reactable-binding-0.4.4/reactable.js"></script>
<link href="tables_files/libs/font-awesome-6.4.2/css/all.min.css" rel="stylesheet">
<link href="tables_files/libs/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet">
</head>
<body class="fullcontent">
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Tables for Personal Finance (Ebenezer)</h1>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-contents">
<p>Deepansh Khurana </p>
</div>
</div>
</div>
</header>
<div style="text-align: justify;">
<p>When I made the <a href="https://github.com/DeepanshKhurana/Hrafnagud-Dynamo" title="Hrafnagud-Dynamo">Hrafnagud</a> project I recently talked about at <strong>ShinyConf</strong> (and am about to talk about at <strong>useR!</strong> in July and <strong>EARL</strong> in September), I also made several apps for myself to consume each API. The app and API for tracking my finances is called <strong>Ebenezer</strong>, named after the miserly Scrooge. My goal was to take each kind of financial instrument and make a table that fits well for it. Bonds work differently than Equity stocks, for example, and therefore, should be represented differently. The result was the following tables, which are now a part and parcel of my application.</p>
</div>
<section id="key-features" class="level4">
<h4 class="anchored" data-anchor-id="key-features">Key Features</h4>
<div style="text-align: justify;">
<p>One of the key features of these tables are the way the colors are assigned automatically. This is done using a <em>get_css_class()</em> function which basically assigns the different colors and highlights wherever required.</p>
<p>Another important bit is how the tables themselves are constructed. Processing functions are written in the <em>cell</em> parameter of the <em>reactable()</em> call. The function then takes up a concatenated string and builds up a <em>div</em> structure that is styled with a custom scss file.</p>
</div>
</section>
<section id="setup" class="level2">
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
<p>Here we setup some libraries, functions and load the dataframes for these examples.</p>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(dplyr))</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(glue))</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(lubridate))</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(reactable))</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(reactablefmtr))</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>(<span class="fu">library</span>(shiny))</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="fu">source</span>(<span class="st">"utils/data_formatting.R"</span>)</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a>files <span class="ot"><-</span> <span class="fu">list.files</span>(<span class="st">"data"</span>, <span class="st">"*.csv"</span>)</span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>paths <span class="ot"><-</span> <span class="fu">paste</span>(<span class="st">"data"</span>, files, <span class="at">sep =</span> <span class="st">"/"</span>)</span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a>data <span class="ot"><-</span> <span class="fu">lapply</span>(</span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> paths,</span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> read.csv</span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a><span class="fu">names</span>(data) <span class="ot"><-</span> <span class="fu">gsub</span>(<span class="st">".csv"</span>, <span class="st">""</span>, files)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>Now that the data is loaded, we can take each table at a time.</p>
<section id="ticker" class="level3">
<h3 class="anchored" data-anchor-id="ticker">Ticker</h3>
<div style="text-align: justify;">
<p>The ticker is a simple table that needs a few key pieces of information. The most important out of which is the correct semantic colour for rise and fall of a stock.</p>
<p><strong>Note:</strong> While I usually consume this data from a custom API, for the sake of illustration and reproducibility, I have included a static file here as a .csv.</p>
<p>Let’s try to make a Ticker Table.</p>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>ticker_data <span class="ot"><-</span> data<span class="sc">$</span>ticker_data</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(ticker_data) <span class="ot"><-</span> <span class="fu">c</span>(</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"Code"</span>, <span class="st">"Stock"</span>, <span class="st">"Price"</span>, <span class="st">"Change"</span>, <span class="st">"Percent"</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a>ticker_data<span class="sc">$</span>Stock <span class="ot"><-</span> <span class="fu">paste</span>(</span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a> ticker_data<span class="sc">$</span>Code,</span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a> ticker_data<span class="sc">$</span>Stock,</span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a>ticker_data<span class="sc">$</span>Price <span class="ot"><-</span></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste</span>(ticker_data<span class="sc">$</span>Price,</span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a> ticker_data<span class="sc">$</span>Change,</span>
<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a> ticker_data<span class="sc">$</span>Percent,</span>
<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a>ticker_data <span class="ot"><-</span> ticker_data[, <span class="fu">c</span>(<span class="st">"Stock"</span>, <span class="st">"Price"</span>)] <span class="sc">|></span></span>
<span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">na.omit</span>()</span>
<span id="cb2-22"><a href="#cb2-22" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-23"><a href="#cb2-23" aria-hidden="true" tabindex="-1"></a><span class="fu">reactable</span>(</span>
<span id="cb2-24"><a href="#cb2-24" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> ticker_data,</span>
<span id="cb2-25"><a href="#cb2-25" aria-hidden="true" tabindex="-1"></a> <span class="at">pagination =</span> <span class="cn">FALSE</span>,</span>
<span id="cb2-26"><a href="#cb2-26" aria-hidden="true" tabindex="-1"></a> <span class="at">sortable =</span> <span class="cn">FALSE</span>,</span>
<span id="cb2-27"><a href="#cb2-27" aria-hidden="true" tabindex="-1"></a> <span class="at">searchable =</span> <span class="cn">TRUE</span>,</span>
<span id="cb2-28"><a href="#cb2-28" aria-hidden="true" tabindex="-1"></a> <span class="at">columns =</span> <span class="fu">list</span>(</span>
<span id="cb2-29"><a href="#cb2-29" aria-hidden="true" tabindex="-1"></a> <span class="at">Stock =</span> <span class="fu">colDef</span>(</span>
<span id="cb2-30"><a href="#cb2-30" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"left"</span>,</span>
<span id="cb2-31"><a href="#cb2-31" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(value) {</span>
<span id="cb2-32"><a href="#cb2-32" aria-hidden="true" tabindex="-1"></a> value <span class="ot"><-</span> <span class="fu">strsplit</span>(value, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb2-33"><a href="#cb2-33" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-34"><a href="#cb2-34" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name-row"</span>,</span>
<span id="cb2-35"><a href="#cb2-35" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-36"><a href="#cb2-36" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-code"</span>,</span>
<span id="cb2-37"><a href="#cb2-37" aria-hidden="true" tabindex="-1"></a> value[<span class="dv">1</span>]</span>
<span id="cb2-38"><a href="#cb2-38" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-39"><a href="#cb2-39" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-40"><a href="#cb2-40" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name"</span>,</span>
<span id="cb2-41"><a href="#cb2-41" aria-hidden="true" tabindex="-1"></a> value[<span class="dv">2</span>]</span>
<span id="cb2-42"><a href="#cb2-42" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-43"><a href="#cb2-43" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-44"><a href="#cb2-44" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb2-45"><a href="#cb2-45" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-46"><a href="#cb2-46" aria-hidden="true" tabindex="-1"></a> <span class="at">Price =</span> <span class="fu">colDef</span>(</span>
<span id="cb2-47"><a href="#cb2-47" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"right"</span>,</span>
<span id="cb2-48"><a href="#cb2-48" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(value) {</span>
<span id="cb2-49"><a href="#cb2-49" aria-hidden="true" tabindex="-1"></a> value <span class="ot"><-</span> <span class="fu">strsplit</span>(value, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb2-50"><a href="#cb2-50" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-51"><a href="#cb2-51" aria-hidden="true" tabindex="-1"></a> price <span class="ot"><-</span> <span class="fu">as.numeric</span>(value[<span class="dv">1</span>])</span>
<span id="cb2-52"><a href="#cb2-52" aria-hidden="true" tabindex="-1"></a> change <span class="ot"><-</span> <span class="fu">as.numeric</span>(value[<span class="dv">2</span>])</span>
<span id="cb2-53"><a href="#cb2-53" aria-hidden="true" tabindex="-1"></a> percent <span class="ot"><-</span> <span class="fu">as.numeric</span>(value[<span class="dv">3</span>])</span>
<span id="cb2-54"><a href="#cb2-54" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-55"><a href="#cb2-55" aria-hidden="true" tabindex="-1"></a> indicator <span class="ot"><-</span> <span class="fu">get_css_class</span>(change, <span class="at">type =</span> <span class="st">"all"</span>)</span>
<span id="cb2-56"><a href="#cb2-56" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-57"><a href="#cb2-57" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-58"><a href="#cb2-58" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-price-row"</span>,</span>
<span id="cb2-59"><a href="#cb2-59" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-60"><a href="#cb2-60" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-price"</span>,</span>
<span id="cb2-61"><a href="#cb2-61" aria-hidden="true" tabindex="-1"></a> <span class="at">style =</span> <span class="fu">list</span>(</span>
<span id="cb2-62"><a href="#cb2-62" aria-hidden="true" tabindex="-1"></a> <span class="at">fontSize =</span> <span class="st">"1.5em"</span>,</span>
<span id="cb2-63"><a href="#cb2-63" aria-hidden="true" tabindex="-1"></a> <span class="at">fontWeight =</span> <span class="dv">600</span></span>
<span id="cb2-64"><a href="#cb2-64" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-65"><a href="#cb2-65" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste0</span>(</span>
<span id="cb2-66"><a href="#cb2-66" aria-hidden="true" tabindex="-1"></a> <span class="st">"$"</span>,</span>
<span id="cb2-67"><a href="#cb2-67" aria-hidden="true" tabindex="-1"></a> <span class="fu">sub</span>(</span>
<span id="cb2-68"><a href="#cb2-68" aria-hidden="true" tabindex="-1"></a> <span class="st">"</span><span class="sc">\\</span><span class="st">.0+$"</span>,</span>
<span id="cb2-69"><a href="#cb2-69" aria-hidden="true" tabindex="-1"></a> <span class="st">""</span>,</span>
<span id="cb2-70"><a href="#cb2-70" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_price</span>(price)</span>
<span id="cb2-71"><a href="#cb2-71" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-72"><a href="#cb2-72" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-73"><a href="#cb2-73" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-74"><a href="#cb2-74" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-75"><a href="#cb2-75" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-change-block"</span>,</span>
<span id="cb2-76"><a href="#cb2-76" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-77"><a href="#cb2-77" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-percent"</span>,</span>
<span id="cb2-78"><a href="#cb2-78" aria-hidden="true" tabindex="-1"></a> indicator<span class="sc">$</span>text,</span>
<span id="cb2-79"><a href="#cb2-79" aria-hidden="true" tabindex="-1"></a> indicator<span class="sc">$</span>highlight,</span>
<span id="cb2-80"><a href="#cb2-80" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb2-81"><a href="#cb2-81" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-82"><a href="#cb2-82" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste0</span>(<span class="fu">sub</span>(<span class="st">"-"</span>, <span class="st">""</span>, <span class="fu">preserve_zero</span>(percent)), <span class="st">"%"</span>)</span>
<span id="cb2-83"><a href="#cb2-83" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-84"><a href="#cb2-84" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb2-85"><a href="#cb2-85" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-change"</span>,</span>
<span id="cb2-86"><a href="#cb2-86" aria-hidden="true" tabindex="-1"></a> indicator<span class="sc">$</span>text,</span>
<span id="cb2-87"><a href="#cb2-87" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb2-88"><a href="#cb2-88" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-89"><a href="#cb2-89" aria-hidden="true" tabindex="-1"></a> <span class="fu">sub</span>(<span class="st">"-"</span>, <span class="st">""</span>, <span class="fu">format_price</span>(change))</span>
<span id="cb2-90"><a href="#cb2-90" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-91"><a href="#cb2-91" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb2-92"><a href="#cb2-92" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-93"><a href="#cb2-93" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb2-94"><a href="#cb2-94" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-95"><a href="#cb2-95" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb2-96"><a href="#cb2-96" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="reactable html-widget html-fill-item" id="htmlwidget-f0cf6d39baae34150f79" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-f0cf6d39baae34150f79">{"x":{"tag":{"name":"Reactable","attribs":{"data":{"Stock":["SCRIP1_COMPANY NAME 1","SCRIP2_COMPANY NAME 2","SCRIP3_COMPANY NAME 3","SCRIP4_COMPANY NAME 4","SCRIP5_COMPANY NAME 5"],"Price":["742.95_-12.45_-1.65","512_-2.6_-0.51","3052.5_28.7_0.93","1797_-9.85_-0.55","1322.9_5.65_0.43"]},"columns":[{"id":"Stock","name":"Stock","type":"character","cell":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["SCRIP1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["COMPANY NAME 1"]}]},{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["SCRIP2"]},{"name":"div","attribs":{"className":"stock-name"},"children":["COMPANY NAME 2"]}]},{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["SCRIP3"]},{"name":"div","attribs":{"className":"stock-name"},"children":["COMPANY NAME 3"]}]},{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["SCRIP4"]},{"name":"div","attribs":{"className":"stock-name"},"children":["COMPANY NAME 4"]}]},{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["SCRIP5"]},{"name":"div","attribs":{"className":"stock-name"},"children":["COMPANY NAME 5"]}]}],"align":"left"},{"id":"Price","name":"Price","type":"character","cell":[{"name":"div","attribs":{"className":"stock-price-row"},"children":[{"name":"div","attribs":{"style":{"fontSize":"1.5em","fontWeight":600},"className":"stock-price"},"children":["$742.95"]},{"name":"div","attribs":{"className":"stock-change-block"},"children":[{"name":"div","attribs":{"className":"stock-percent red red-background"},"children":["1.65%"]},{"name":"div","attribs":{"className":"stock-change red"},"children":["12.45"]}]}]},{"name":"div","attribs":{"className":"stock-price-row"},"children":[{"name":"div","attribs":{"style":{"fontSize":"1.5em","fontWeight":600},"className":"stock-price"},"children":["$512"]},{"name":"div","attribs":{"className":"stock-change-block"},"children":[{"name":"div","attribs":{"className":"stock-percent red red-background"},"children":["0.51%"]},{"name":"div","attribs":{"className":"stock-change red"},"children":["2.60"]}]}]},{"name":"div","attribs":{"className":"stock-price-row"},"children":[{"name":"div","attribs":{"style":{"fontSize":"1.5em","fontWeight":600},"className":"stock-price"},"children":["$3,052.50"]},{"name":"div","attribs":{"className":"stock-change-block"},"children":[{"name":"div","attribs":{"className":"stock-percent green green-background"},"children":["0.93%"]},{"name":"div","attribs":{"className":"stock-change green"},"children":["28.70"]}]}]},{"name":"div","attribs":{"className":"stock-price-row"},"children":[{"name":"div","attribs":{"style":{"fontSize":"1.5em","fontWeight":600},"className":"stock-price"},"children":["$1,797"]},{"name":"div","attribs":{"className":"stock-change-block"},"children":[{"name":"div","attribs":{"className":"stock-percent red red-background"},"children":["0.55%"]},{"name":"div","attribs":{"className":"stock-change red"},"children":["9.85"]}]}]},{"name":"div","attribs":{"className":"stock-price-row"},"children":[{"name":"div","attribs":{"style":{"fontSize":"1.5em","fontWeight":600},"className":"stock-price"},"children":["$1,322.90"]},{"name":"div","attribs":{"className":"stock-change-block"},"children":[{"name":"div","attribs":{"className":"stock-percent green green-background"},"children":["0.43%"]},{"name":"div","attribs":{"className":"stock-change green"},"children":["5.65"]}]}]}],"align":"right"}],"sortable":false,"searchable":true,"pagination":false,"dataKey":"660f88aa58277f431a58350bcce87e5b"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="stocks" class="level3">
<h3 class="anchored" data-anchor-id="stocks">Stocks</h3>
<div style="text-align: justify;">
<p>Alright, now that we have data for the ticker, we can create a stocks table. The table below gives you the portfolio with different fields such as Invested Value, Quantity, Average Price on the left, and Unrealized P&L, Realized P&L, Current Price on the right. If a user hovers on the icons, they will find these labels as well.</p>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>portfolio <span class="ot"><-</span> data<span class="sc">$</span>stocks_data <span class="sc">|></span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="at">unrealized_percent =</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">true_round</span>(</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> unrealized <span class="sc">*</span> <span class="dv">100</span> <span class="sc">/</span> holding_value, <span class="dv">2</span></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span></span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste</span>(</span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a> stock_symbol,</span>
<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a> name,</span>
<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a> holding_value,</span>
<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a> quantity,</span>
<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a> avg_price,</span>
<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">paste</span>(</span>
<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a> unrealized,</span>
<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a> unrealized_percent,</span>
<span id="cb3-21"><a href="#cb3-21" aria-hidden="true" tabindex="-1"></a> realized,</span>
<span id="cb3-22"><a href="#cb3-22" aria-hidden="true" tabindex="-1"></a> current_price,</span>
<span id="cb3-23"><a href="#cb3-23" aria-hidden="true" tabindex="-1"></a> change_percent,</span>
<span id="cb3-24"><a href="#cb3-24" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb3-25"><a href="#cb3-25" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-26"><a href="#cb3-26" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb3-27"><a href="#cb3-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(left, right)</span>
<span id="cb3-28"><a href="#cb3-28" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-29"><a href="#cb3-29" aria-hidden="true" tabindex="-1"></a><span class="fu">reactable</span>(</span>
<span id="cb3-30"><a href="#cb3-30" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> portfolio,</span>
<span id="cb3-31"><a href="#cb3-31" aria-hidden="true" tabindex="-1"></a> <span class="at">pagination =</span> <span class="cn">FALSE</span>,</span>
<span id="cb3-32"><a href="#cb3-32" aria-hidden="true" tabindex="-1"></a> <span class="at">searchable =</span> <span class="cn">TRUE</span>,</span>
<span id="cb3-33"><a href="#cb3-33" aria-hidden="true" tabindex="-1"></a> <span class="at">columns =</span> <span class="fu">list</span>(</span>
<span id="cb3-34"><a href="#cb3-34" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">colDef</span>(</span>
<span id="cb3-35"><a href="#cb3-35" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"left"</span>,</span>
<span id="cb3-36"><a href="#cb3-36" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(value) {</span>
<span id="cb3-37"><a href="#cb3-37" aria-hidden="true" tabindex="-1"></a> value <span class="ot"><-</span> <span class="fu">strsplit</span>(value, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb3-38"><a href="#cb3-38" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-39"><a href="#cb3-39" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-left-area"</span>,</span>
<span id="cb3-40"><a href="#cb3-40" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-41"><a href="#cb3-41" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name-row"</span>,</span>
<span id="cb3-42"><a href="#cb3-42" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-43"><a href="#cb3-43" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-code"</span>,</span>
<span id="cb3-44"><a href="#cb3-44" aria-hidden="true" tabindex="-1"></a> value[<span class="dv">1</span>]</span>
<span id="cb3-45"><a href="#cb3-45" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-46"><a href="#cb3-46" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-47"><a href="#cb3-47" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name"</span>,</span>
<span id="cb3-48"><a href="#cb3-48" aria-hidden="true" tabindex="-1"></a> value[<span class="dv">2</span>]</span>
<span id="cb3-49"><a href="#cb3-49" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-50"><a href="#cb3-50" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-51"><a href="#cb3-51" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-52"><a href="#cb3-52" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-holding-row"</span>,</span>
<span id="cb3-53"><a href="#cb3-53" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-54"><a href="#cb3-54" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-market-value small-row-left"</span>,</span>
<span id="cb3-55"><a href="#cb3-55" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Invested Value"</span>,</span>
<span id="cb3-56"><a href="#cb3-56" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"vault"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb3-57"><a href="#cb3-57" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">format_price</span>(value[<span class="dv">3</span>], <span class="dv">2</span>))</span>
<span id="cb3-58"><a href="#cb3-58" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-59"><a href="#cb3-59" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-60"><a href="#cb3-60" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-quantity small-row-left"</span>,</span>
<span id="cb3-61"><a href="#cb3-61" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Quantity"</span>,</span>
<span id="cb3-62"><a href="#cb3-62" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"hashtag"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb3-63"><a href="#cb3-63" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, value[<span class="dv">4</span>])</span>
<span id="cb3-64"><a href="#cb3-64" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-65"><a href="#cb3-65" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-66"><a href="#cb3-66" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-avg-price small-row-left"</span>,</span>
<span id="cb3-67"><a href="#cb3-67" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Average Price"</span>,</span>
<span id="cb3-68"><a href="#cb3-68" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"barcode"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb3-69"><a href="#cb3-69" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">paste0</span>(<span class="st">"₹"</span>, <span class="fu">true_round</span>(value[<span class="dv">5</span>], <span class="dv">2</span>)))</span>
<span id="cb3-70"><a href="#cb3-70" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-71"><a href="#cb3-71" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-72"><a href="#cb3-72" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-73"><a href="#cb3-73" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb3-74"><a href="#cb3-74" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-75"><a href="#cb3-75" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">colDef</span>(</span>
<span id="cb3-76"><a href="#cb3-76" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"right"</span>,</span>
<span id="cb3-77"><a href="#cb3-77" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(value) {</span>
<span id="cb3-78"><a href="#cb3-78" aria-hidden="true" tabindex="-1"></a> value <span class="ot"><-</span> <span class="fu">strsplit</span>(value, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb3-79"><a href="#cb3-79" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-80"><a href="#cb3-80" aria-hidden="true" tabindex="-1"></a> unrealized_class <span class="ot"><-</span> <span class="fu">get_css_class</span>(value[<span class="dv">2</span>], <span class="at">type =</span> <span class="st">"text"</span>)</span>
<span id="cb3-81"><a href="#cb3-81" aria-hidden="true" tabindex="-1"></a> realized_class <span class="ot"><-</span> <span class="fu">get_css_class</span>(value[<span class="dv">3</span>], <span class="at">type =</span> <span class="st">"text"</span>)</span>
<span id="cb3-82"><a href="#cb3-82" aria-hidden="true" tabindex="-1"></a> current_price_class <span class="ot"><-</span> <span class="fu">get_css_class</span>(value[<span class="dv">5</span>], <span class="at">type =</span> <span class="st">"text"</span>)</span>
<span id="cb3-83"><a href="#cb3-83" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-84"><a href="#cb3-84" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-85"><a href="#cb3-85" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-right-area"</span>,</span>
<span id="cb3-86"><a href="#cb3-86" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-87"><a href="#cb3-87" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-unrealized-row small-row-right"</span>,</span>
<span id="cb3-88"><a href="#cb3-88" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Unrealized P&L"</span>,</span>
<span id="cb3-89"><a href="#cb3-89" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb3-90"><a href="#cb3-90" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"money-bill-transfer"</span>,</span>
<span id="cb3-91"><a href="#cb3-91" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb3-92"><a href="#cb3-92" aria-hidden="true" tabindex="-1"></a> unrealized_class,</span>
<span id="cb3-93"><a href="#cb3-93" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-94"><a href="#cb3-94" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-95"><a href="#cb3-95" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-96"><a href="#cb3-96" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb3-97"><a href="#cb3-97" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-unrealized value"</span>,</span>
<span id="cb3-98"><a href="#cb3-98" aria-hidden="true" tabindex="-1"></a> unrealized_class,</span>
<span id="cb3-99"><a href="#cb3-99" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-100"><a href="#cb3-100" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-101"><a href="#cb3-101" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_price</span>(value[<span class="dv">1</span>])</span>
<span id="cb3-102"><a href="#cb3-102" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-103"><a href="#cb3-103" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb3-104"><a href="#cb3-104" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-unrealized-percent value"</span>,</span>
<span id="cb3-105"><a href="#cb3-105" aria-hidden="true" tabindex="-1"></a> unrealized_class,</span>
<span id="cb3-106"><a href="#cb3-106" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-107"><a href="#cb3-107" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-108"><a href="#cb3-108" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste0</span>(<span class="st">"("</span>, value[<span class="dv">2</span>], <span class="st">"%)"</span>)</span>
<span id="cb3-109"><a href="#cb3-109" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-110"><a href="#cb3-110" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-111"><a href="#cb3-111" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-112"><a href="#cb3-112" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-realized small-row-right"</span>,</span>
<span id="cb3-113"><a href="#cb3-113" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Realized P&L"</span>,</span>
<span id="cb3-114"><a href="#cb3-114" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb3-115"><a href="#cb3-115" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"receipt"</span>,</span>
<span id="cb3-116"><a href="#cb3-116" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb3-117"><a href="#cb3-117" aria-hidden="true" tabindex="-1"></a> realized_class,</span>
<span id="cb3-118"><a href="#cb3-118" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-119"><a href="#cb3-119" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-120"><a href="#cb3-120" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-121"><a href="#cb3-121" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb3-122"><a href="#cb3-122" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"value"</span>,</span>
<span id="cb3-123"><a href="#cb3-123" aria-hidden="true" tabindex="-1"></a> realized_class,</span>
<span id="cb3-124"><a href="#cb3-124" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-125"><a href="#cb3-125" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-126"><a href="#cb3-126" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_price</span>(value[<span class="dv">3</span>])</span>
<span id="cb3-127"><a href="#cb3-127" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-128"><a href="#cb3-128" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-129"><a href="#cb3-129" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-130"><a href="#cb3-130" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-current-price-row small-row-right"</span>,</span>
<span id="cb3-131"><a href="#cb3-131" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Current Price"</span>,</span>
<span id="cb3-132"><a href="#cb3-132" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb3-133"><a href="#cb3-133" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"comment-dollar"</span>,</span>
<span id="cb3-134"><a href="#cb3-134" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb3-135"><a href="#cb3-135" aria-hidden="true" tabindex="-1"></a> current_price_class,</span>
<span id="cb3-136"><a href="#cb3-136" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-137"><a href="#cb3-137" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-138"><a href="#cb3-138" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-139"><a href="#cb3-139" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb3-140"><a href="#cb3-140" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb3-141"><a href="#cb3-141" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(</span>
<span id="cb3-142"><a href="#cb3-142" aria-hidden="true" tabindex="-1"></a> <span class="st">"stock-current-price value"</span>,</span>
<span id="cb3-143"><a href="#cb3-143" aria-hidden="true" tabindex="-1"></a> current_price_class,</span>
<span id="cb3-144"><a href="#cb3-144" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-145"><a href="#cb3-145" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-146"><a href="#cb3-146" aria-hidden="true" tabindex="-1"></a> value[<span class="dv">4</span>]</span>
<span id="cb3-147"><a href="#cb3-147" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-148"><a href="#cb3-148" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-149"><a href="#cb3-149" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb3-150"><a href="#cb3-150" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(</span>
<span id="cb3-151"><a href="#cb3-151" aria-hidden="true" tabindex="-1"></a> <span class="st">"stock-current-price-percent value"</span>,</span>
<span id="cb3-152"><a href="#cb3-152" aria-hidden="true" tabindex="-1"></a> current_price_class,</span>
<span id="cb3-153"><a href="#cb3-153" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb3-154"><a href="#cb3-154" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb3-155"><a href="#cb3-155" aria-hidden="true" tabindex="-1"></a> <span class="fu">paste0</span>(<span class="st">"("</span>, value[<span class="dv">5</span>], <span class="st">"%)"</span>)</span>
<span id="cb3-156"><a href="#cb3-156" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-157"><a href="#cb3-157" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-158"><a href="#cb3-158" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-159"><a href="#cb3-159" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb3-160"><a href="#cb3-160" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-161"><a href="#cb3-161" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb3-162"><a href="#cb3-162" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="reactable html-widget html-fill-item" id="htmlwidget-e9f362ee2583f1396a39" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-e9f362ee2583f1396a39">{"x":{"tag":{"name":"Reactable","attribs":{"data":{"left":["STCK1_STOCK 1_15636.48_32_488.64","STCK2_STOCK 2 LTD._93914.48_88_1067.21","STCK3_STOCK 3 COMPANY_49991.37_143_349.59","STCK4_STOCK 4 PVT. LTD._15573.16_38_409.82","STCK5_STOCK 5_38866.38_174_223.37"],"right":["26696.32_170.73_-765.1_1322.9_0.43","39445.12_42_0_1515.45_-0.92","114494.38_229.03_8534.81_1150.25_-0.85","3768.84_24.2_0_509_9.94","218827.62_563.03_0_1481_-0.35"]},"columns":[{"id":"left","name":"left","type":"character","cell":[{"name":"div","attribs":{"className":"stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["STCK1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["STOCK 1"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"stock-market-value small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["15,636.48"]}]},{"name":"div","attribs":{"title":"Quantity","className":"stock-quantity small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["32"]}]},{"name":"div","attribs":{"title":"Average Price","className":"stock-avg-price small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["₹488.64"]}]}]}]},{"name":"div","attribs":{"className":"stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["STCK2"]},{"name":"div","attribs":{"className":"stock-name"},"children":["STOCK 2 LTD."]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"stock-market-value small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["93,914.48"]}]},{"name":"div","attribs":{"title":"Quantity","className":"stock-quantity small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["88"]}]},{"name":"div","attribs":{"title":"Average Price","className":"stock-avg-price small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["₹1067.21"]}]}]}]},{"name":"div","attribs":{"className":"stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["STCK3"]},{"name":"div","attribs":{"className":"stock-name"},"children":["STOCK 3 COMPANY"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"stock-market-value small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["49,991.37"]}]},{"name":"div","attribs":{"title":"Quantity","className":"stock-quantity small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["143"]}]},{"name":"div","attribs":{"title":"Average Price","className":"stock-avg-price small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["₹349.59"]}]}]}]},{"name":"div","attribs":{"className":"stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["STCK4"]},{"name":"div","attribs":{"className":"stock-name"},"children":["STOCK 4 PVT. LTD."]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"stock-market-value small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["15,573.16"]}]},{"name":"div","attribs":{"title":"Quantity","className":"stock-quantity small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["38"]}]},{"name":"div","attribs":{"title":"Average Price","className":"stock-avg-price small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["₹409.82"]}]}]}]},{"name":"div","attribs":{"className":"stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["STCK5"]},{"name":"div","attribs":{"className":"stock-name"},"children":["STOCK 5"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"stock-market-value small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["38,866.38"]}]},{"name":"div","attribs":{"title":"Quantity","className":"stock-quantity small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["174"]}]},{"name":"div","attribs":{"title":"Average Price","className":"stock-avg-price small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["₹223.37"]}]}]}]}],"align":"left"},{"id":"right","name":"right","type":"character","cell":[{"name":"div","attribs":{"className":"stock-right-area"},"children":[{"name":"div","attribs":{"title":"Unrealized P&L","className":"stock-unrealized-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-unrealized value green"},"children":["26,696.32"]},{"name":"p","attribs":{"className":"stock-unrealized-percent value green"},"children":["(170.73%)"]}]},{"name":"div","attribs":{"title":"Realized P&L","className":"stock-realized small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt stock-current-price label red"},"children":[]},{"name":"p","attribs":{"className":"value red"},"children":["-765.10"]}]},{"name":"div","attribs":{"title":"Current Price","className":"stock-current-price-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"div","attribs":{},"children":[{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["1322.9"]}]},{"name":"p","attribs":{"className":"stock-current-price-percent value green"},"children":["(0.43%)"]}]}]},{"name":"div","attribs":{"className":"stock-right-area"},"children":[{"name":"div","attribs":{"title":"Unrealized P&L","className":"stock-unrealized-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-unrealized value green"},"children":["39,445.12"]},{"name":"p","attribs":{"className":"stock-unrealized-percent value green"},"children":["(42%)"]}]},{"name":"div","attribs":{"title":"Realized P&L","className":"stock-realized small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt stock-current-price label grey"},"children":[]},{"name":"p","attribs":{"className":"value grey"},"children":["0.00"]}]},{"name":"div","attribs":{"title":"Current Price","className":"stock-current-price-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label red"},"children":[]},{"name":"div","attribs":{},"children":[{"name":"p","attribs":{"className":"stock-current-price value red"},"children":["1515.45"]}]},{"name":"p","attribs":{"className":"stock-current-price-percent value red"},"children":["(-0.92%)"]}]}]},{"name":"div","attribs":{"className":"stock-right-area"},"children":[{"name":"div","attribs":{"title":"Unrealized P&L","className":"stock-unrealized-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-unrealized value green"},"children":["114,494.38"]},{"name":"p","attribs":{"className":"stock-unrealized-percent value green"},"children":["(229.03%)"]}]},{"name":"div","attribs":{"title":"Realized P&L","className":"stock-realized small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"value green"},"children":["8,534.81"]}]},{"name":"div","attribs":{"title":"Current Price","className":"stock-current-price-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label red"},"children":[]},{"name":"div","attribs":{},"children":[{"name":"p","attribs":{"className":"stock-current-price value red"},"children":["1150.25"]}]},{"name":"p","attribs":{"className":"stock-current-price-percent value red"},"children":["(-0.85%)"]}]}]},{"name":"div","attribs":{"className":"stock-right-area"},"children":[{"name":"div","attribs":{"title":"Unrealized P&L","className":"stock-unrealized-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-unrealized value green"},"children":["3,768.84"]},{"name":"p","attribs":{"className":"stock-unrealized-percent value green"},"children":["(24.2%)"]}]},{"name":"div","attribs":{"title":"Realized P&L","className":"stock-realized small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt stock-current-price label grey"},"children":[]},{"name":"p","attribs":{"className":"value grey"},"children":["0.00"]}]},{"name":"div","attribs":{"title":"Current Price","className":"stock-current-price-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"div","attribs":{},"children":[{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["509"]}]},{"name":"p","attribs":{"className":"stock-current-price-percent value green"},"children":["(9.94%)"]}]}]},{"name":"div","attribs":{"className":"stock-right-area"},"children":[{"name":"div","attribs":{"title":"Unrealized P&L","className":"stock-unrealized-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-unrealized value green"},"children":["218,827.62"]},{"name":"p","attribs":{"className":"stock-unrealized-percent value green"},"children":["(563.03%)"]}]},{"name":"div","attribs":{"title":"Realized P&L","className":"stock-realized small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt stock-current-price label grey"},"children":[]},{"name":"p","attribs":{"className":"value grey"},"children":["0.00"]}]},{"name":"div","attribs":{"title":"Current Price","className":"stock-current-price-row small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label red"},"children":[]},{"name":"div","attribs":{},"children":[{"name":"p","attribs":{"className":"stock-current-price value red"},"children":["1481"]}]},{"name":"p","attribs":{"className":"stock-current-price-percent value red"},"children":["(-0.35%)"]}]}]}],"align":"right"}],"searchable":true,"pagination":false,"dataKey":"3e46bdba709942330e9a77f745585d99"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="bonds" class="level3">
<h3 class="anchored" data-anchor-id="bonds">Bonds</h3>
<div style="text-align: justify;">
<p>Between Stocks and Bonds, something changes. Most stock data is current. You need the most crucial information immediately. With bonds, the information needed is a bit different. You need to know the current amount, the amount it will total to when the time period passes and the progress. So, with the help of <em>reactablefmtr</em>, I added a progress bar to the tables.</p>
<p>Another thing to note is that the progress bar color changes according to a palette. This gives the user visual feedback for how far their bonds have progressed to maturity. Darker is “matures soon”.</p>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>bonds <span class="ot"><-</span> data<span class="sc">$</span>sgb_data</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>today <span class="ot"><-</span> <span class="fu">Sys.Date</span>()</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>bonds<span class="sc">$</span>info <span class="ot"><-</span> <span class="fu">paste</span>(</span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>name,</span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>invested_date,</span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>maturity_date,</span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>category,</span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>quantity,</span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>unit_price,</span>
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> bonds<span class="sc">$</span>total,</span>
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a>bonds<span class="sc">$</span>progress <span class="ot"><-</span></span>
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span> <span class="sc">-</span> <span class="fu">as.numeric</span>(</span>
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">difftime</span>(</span>
<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_date</span>(bonds<span class="sc">$</span>maturity_date),</span>
<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> <span class="fu">as.Date</span>(today),</span>
<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a> <span class="at">units =</span> <span class="st">"days"</span></span>
<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">/</span> (<span class="dv">8</span> <span class="sc">*</span> <span class="fl">365.25</span>)</span>
<span id="cb4-24"><a href="#cb4-24" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-25"><a href="#cb4-25" aria-hidden="true" tabindex="-1"></a>bonds <span class="ot"><-</span> bonds <span class="sc">|></span></span>
<span id="cb4-26"><a href="#cb4-26" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(info, progress) <span class="sc">|></span></span>
<span id="cb4-27"><a href="#cb4-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">rowwise</span>() <span class="sc">|></span></span>
<span id="cb4-28"><a href="#cb4-28" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb4-29"><a href="#cb4-29" aria-hidden="true" tabindex="-1"></a> <span class="at">color =</span> <span class="fu">get_progress_bar_colour</span>(</span>
<span id="cb4-30"><a href="#cb4-30" aria-hidden="true" tabindex="-1"></a> progress,</span>
<span id="cb4-31"><a href="#cb4-31" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(</span>
<span id="cb4-32"><a href="#cb4-32" aria-hidden="true" tabindex="-1"></a> <span class="st">"#a3b18a"</span>,</span>
<span id="cb4-33"><a href="#cb4-33" aria-hidden="true" tabindex="-1"></a> <span class="st">"#588157"</span>,</span>
<span id="cb4-34"><a href="#cb4-34" aria-hidden="true" tabindex="-1"></a> <span class="st">"#3a5a40"</span>,</span>
<span id="cb4-35"><a href="#cb4-35" aria-hidden="true" tabindex="-1"></a> <span class="st">"#344e41"</span></span>
<span id="cb4-36"><a href="#cb4-36" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-37"><a href="#cb4-37" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-38"><a href="#cb4-38" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb4-39"><a href="#cb4-39" aria-hidden="true" tabindex="-1"></a> <span class="fu">ungroup</span>()</span>
<span id="cb4-40"><a href="#cb4-40" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-41"><a href="#cb4-41" aria-hidden="true" tabindex="-1"></a><span class="fu">reactable</span>(</span>
<span id="cb4-42"><a href="#cb4-42" aria-hidden="true" tabindex="-1"></a> bonds,</span>
<span id="cb4-43"><a href="#cb4-43" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-reactable"</span>,</span>
<span id="cb4-44"><a href="#cb4-44" aria-hidden="true" tabindex="-1"></a> <span class="at">columns =</span> <span class="fu">list</span>(</span>
<span id="cb4-45"><a href="#cb4-45" aria-hidden="true" tabindex="-1"></a> <span class="at">info =</span> <span class="fu">colDef</span>(</span>
<span id="cb4-46"><a href="#cb4-46" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Bond"</span>,</span>
<span id="cb4-47"><a href="#cb4-47" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(string) {</span>
<span id="cb4-48"><a href="#cb4-48" aria-hidden="true" tabindex="-1"></a> string <span class="ot"><-</span> <span class="fu">strsplit</span>(string, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb4-49"><a href="#cb4-49" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-50"><a href="#cb4-50" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-row"</span>,</span>
<span id="cb4-51"><a href="#cb4-51" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-52"><a href="#cb4-52" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-name"</span>,</span>
<span id="cb4-53"><a href="#cb4-53" aria-hidden="true" tabindex="-1"></a> <span class="fu">gsub</span>(</span>
<span id="cb4-54"><a href="#cb4-54" aria-hidden="true" tabindex="-1"></a> <span class="st">"BOND NAME"</span>,</span>
<span id="cb4-55"><a href="#cb4-55" aria-hidden="true" tabindex="-1"></a> <span class="st">"/"</span>,</span>
<span id="cb4-56"><a href="#cb4-56" aria-hidden="true" tabindex="-1"></a> string[<span class="dv">1</span>]</span>
<span id="cb4-57"><a href="#cb4-57" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-58"><a href="#cb4-58" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-59"><a href="#cb4-59" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-60"><a href="#cb4-60" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-timeline"</span>,</span>
<span id="cb4-61"><a href="#cb4-61" aria-hidden="true" tabindex="-1"></a> <span class="fu">year</span>(<span class="fu">format_date</span>(string[<span class="dv">2</span>])),</span>
<span id="cb4-62"><a href="#cb4-62" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="st">"arrow-right"</span>),</span>
<span id="cb4-63"><a href="#cb4-63" aria-hidden="true" tabindex="-1"></a> <span class="fu">year</span>(<span class="fu">format_date</span>(string[<span class="dv">3</span>]))</span>
<span id="cb4-64"><a href="#cb4-64" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-65"><a href="#cb4-65" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-66"><a href="#cb4-66" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-metrics-container"</span>,</span>
<span id="cb4-67"><a href="#cb4-67" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-68"><a href="#cb4-68" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-category metric"</span>,</span>
<span id="cb4-69"><a href="#cb4-69" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Category"</span>,</span>
<span id="cb4-70"><a href="#cb4-70" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="st">"receipt"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb4-71"><a href="#cb4-71" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(string[<span class="dv">4</span>], <span class="at">class =</span> <span class="st">"value"</span>)</span>
<span id="cb4-72"><a href="#cb4-72" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-73"><a href="#cb4-73" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-74"><a href="#cb4-74" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-quantity metric"</span>,</span>
<span id="cb4-75"><a href="#cb4-75" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Quantity"</span>,</span>
<span id="cb4-76"><a href="#cb4-76" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="st">"hashtag"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb4-77"><a href="#cb4-77" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(string[<span class="dv">5</span>], <span class="at">class =</span> <span class="st">"value"</span>)</span>
<span id="cb4-78"><a href="#cb4-78" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-79"><a href="#cb4-79" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-80"><a href="#cb4-80" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-price metric"</span>,</span>
<span id="cb4-81"><a href="#cb4-81" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Unit Price"</span>,</span>
<span id="cb4-82"><a href="#cb4-82" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="st">"barcode"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb4-83"><a href="#cb4-83" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="fu">format_price</span>(string[<span class="dv">6</span>]), <span class="at">class =</span> <span class="st">"value"</span>)</span>
<span id="cb4-84"><a href="#cb4-84" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-85"><a href="#cb4-85" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb4-86"><a href="#cb4-86" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sgb-total metric"</span>,</span>
<span id="cb4-87"><a href="#cb4-87" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Total Invested"</span>,</span>
<span id="cb4-88"><a href="#cb4-88" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="st">"vault"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb4-89"><a href="#cb4-89" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="fu">format_price</span>(string[<span class="dv">7</span>]), <span class="at">class =</span> <span class="st">"value"</span>)</span>
<span id="cb4-90"><a href="#cb4-90" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-91"><a href="#cb4-91" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-92"><a href="#cb4-92" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-93"><a href="#cb4-93" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb4-94"><a href="#cb4-94" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-95"><a href="#cb4-95" aria-hidden="true" tabindex="-1"></a> <span class="at">progress =</span> <span class="fu">colDef</span>(</span>
<span id="cb4-96"><a href="#cb4-96" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="fu">data_bars</span>(</span>
<span id="cb4-97"><a href="#cb4-97" aria-hidden="true" tabindex="-1"></a> bonds,</span>
<span id="cb4-98"><a href="#cb4-98" aria-hidden="true" tabindex="-1"></a> <span class="at">max_value =</span> <span class="dv">1</span>,</span>
<span id="cb4-99"><a href="#cb4-99" aria-hidden="true" tabindex="-1"></a> <span class="at">fill_color_ref =</span> <span class="st">"color"</span>,</span>
<span id="cb4-100"><a href="#cb4-100" aria-hidden="true" tabindex="-1"></a> <span class="at">background =</span> <span class="st">"#f1f3f4"</span>,</span>
<span id="cb4-101"><a href="#cb4-101" aria-hidden="true" tabindex="-1"></a> <span class="at">round_edges =</span> <span class="cn">TRUE</span>,</span>
<span id="cb4-102"><a href="#cb4-102" aria-hidden="true" tabindex="-1"></a> <span class="at">bar_height =</span> <span class="dv">20</span>,</span>
<span id="cb4-103"><a href="#cb4-103" aria-hidden="true" tabindex="-1"></a> <span class="at">number_fmt =</span> scales<span class="sc">::</span><span class="fu">label_percent</span>()</span>
<span id="cb4-104"><a href="#cb4-104" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-105"><a href="#cb4-105" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb4-106"><a href="#cb4-106" aria-hidden="true" tabindex="-1"></a> <span class="at">color =</span> <span class="fu">colDef</span>(</span>
<span id="cb4-107"><a href="#cb4-107" aria-hidden="true" tabindex="-1"></a> <span class="at">show =</span> <span class="cn">FALSE</span></span>
<span id="cb4-108"><a href="#cb4-108" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-109"><a href="#cb4-109" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb4-110"><a href="#cb4-110" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="reactable html-widget html-fill-item" id="htmlwidget-1454b0c38c35bc1034fb" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-1454b0c38c35bc1034fb">{"x":{"tag":{"name":"Reactable","attribs":{"data":{"info":["2.50% BOND NAME APR 28_28/04/20_28/04/28_38_22_4589_100958","2.50% BOND NAME JAN 29_05/01/21_05/01/29_46_54_4950_267300","2.50% BOND NAME JUN 28_16/06/20_16/06/28_40_22_4627_101794","2.50% BOND NAME SEP 26_08/09/16_08/09/24_43_40_5067_202680","2.50% BOND NAME DEC 30_28/12/21_28/12/30_3_24_6199_148776"],"progress":[0.513689253935661,0.427446954140999,0.496919917864476,0.968172484599589,0.180355920602327],"color":["#3a5a40","#588157","#588157","#344e41","#a3b18a"]},"columns":[{"id":"info","name":"Bond","type":"character","cell":[{"name":"div","attribs":{"className":"sgb-row"},"children":[{"name":"div","attribs":{"className":"sgb-name"},"children":["2.50% / APR 28"]},{"name":"div","attribs":{"className":"sgb-timeline"},"children":["2020",{"name":"i","attribs":{"role":"presentation","aria-label":"arrow-right icon","className":"fas fa-arrow-right"},"children":[]},"2028"]},{"name":"div","attribs":{"className":"sgb-metrics-container"},"children":[{"name":"div","attribs":{"title":"Category","className":"sgb-category metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["38"]}]},{"name":"div","attribs":{"title":"Quantity","className":"sgb-quantity metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["22"]}]},{"name":"div","attribs":{"title":"Unit Price","className":"sgb-price metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["4,589.00"]}]},{"name":"div","attribs":{"title":"Total Invested","className":"sgb-total metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["100,958.00"]}]}]}]},{"name":"div","attribs":{"className":"sgb-row"},"children":[{"name":"div","attribs":{"className":"sgb-name"},"children":["2.50% / JAN 29"]},{"name":"div","attribs":{"className":"sgb-timeline"},"children":["2021",{"name":"i","attribs":{"role":"presentation","aria-label":"arrow-right icon","className":"fas fa-arrow-right"},"children":[]},"2029"]},{"name":"div","attribs":{"className":"sgb-metrics-container"},"children":[{"name":"div","attribs":{"title":"Category","className":"sgb-category metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["46"]}]},{"name":"div","attribs":{"title":"Quantity","className":"sgb-quantity metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["54"]}]},{"name":"div","attribs":{"title":"Unit Price","className":"sgb-price metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["4,950.00"]}]},{"name":"div","attribs":{"title":"Total Invested","className":"sgb-total metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["267,300.00"]}]}]}]},{"name":"div","attribs":{"className":"sgb-row"},"children":[{"name":"div","attribs":{"className":"sgb-name"},"children":["2.50% / JUN 28"]},{"name":"div","attribs":{"className":"sgb-timeline"},"children":["2020",{"name":"i","attribs":{"role":"presentation","aria-label":"arrow-right icon","className":"fas fa-arrow-right"},"children":[]},"2028"]},{"name":"div","attribs":{"className":"sgb-metrics-container"},"children":[{"name":"div","attribs":{"title":"Category","className":"sgb-category metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["40"]}]},{"name":"div","attribs":{"title":"Quantity","className":"sgb-quantity metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["22"]}]},{"name":"div","attribs":{"title":"Unit Price","className":"sgb-price metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["4,627.00"]}]},{"name":"div","attribs":{"title":"Total Invested","className":"sgb-total metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["101,794.00"]}]}]}]},{"name":"div","attribs":{"className":"sgb-row"},"children":[{"name":"div","attribs":{"className":"sgb-name"},"children":["2.50% / SEP 26"]},{"name":"div","attribs":{"className":"sgb-timeline"},"children":["2016",{"name":"i","attribs":{"role":"presentation","aria-label":"arrow-right icon","className":"fas fa-arrow-right"},"children":[]},"2024"]},{"name":"div","attribs":{"className":"sgb-metrics-container"},"children":[{"name":"div","attribs":{"title":"Category","className":"sgb-category metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["43"]}]},{"name":"div","attribs":{"title":"Quantity","className":"sgb-quantity metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["40"]}]},{"name":"div","attribs":{"title":"Unit Price","className":"sgb-price metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["5,067.00"]}]},{"name":"div","attribs":{"title":"Total Invested","className":"sgb-total metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["202,680.00"]}]}]}]},{"name":"div","attribs":{"className":"sgb-row"},"children":[{"name":"div","attribs":{"className":"sgb-name"},"children":["2.50% / DEC 30"]},{"name":"div","attribs":{"className":"sgb-timeline"},"children":["2021",{"name":"i","attribs":{"role":"presentation","aria-label":"arrow-right icon","className":"fas fa-arrow-right"},"children":[]},"2030"]},{"name":"div","attribs":{"className":"sgb-metrics-container"},"children":[{"name":"div","attribs":{"title":"Category","className":"sgb-category metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"receipt icon","className":"fas fa-receipt label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["3"]}]},{"name":"div","attribs":{"title":"Quantity","className":"sgb-quantity metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["24"]}]},{"name":"div","attribs":{"title":"Unit Price","className":"sgb-price metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"barcode icon","className":"fas fa-barcode label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["6,199.00"]}]},{"name":"div","attribs":{"title":"Total Invested","className":"sgb-total metric"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["148,776.00"]}]}]}]}]},{"id":"progress","name":"progress","type":"numeric","cell":[{"name":"div","attribs":{},"children":[{"name":"div","attribs":{"style":{"flexGrow":1,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"background":"#f1f3f4"}},"children":[{"name":"div","attribs":{"style":{"display":"flex","alignItems":"center"}},"children":[{"name":"div","attribs":{"style":{"boxShadow":null,"textAlign":"right","display":"flex","alignItems":"center","justifyContent":"flex-end","boxShadow.1":null,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"border":" ","background":"#3A5A40FF","backgroundImage":null,"color":"white","fontWeight":"normal","fontSize":null,"width":"51.3689253935661%","height":20,"transition":"width 1s ease","textOverflow":"ellipsis","whiteSpace":"nowrap"}},"children":["51%"]}]}]}]},{"name":"div","attribs":{},"children":[{"name":"div","attribs":{"style":{"flexGrow":1,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"background":"#f1f3f4"}},"children":[{"name":"div","attribs":{"style":{"display":"flex","alignItems":"center"}},"children":[{"name":"div","attribs":{"style":{"boxShadow":null,"textAlign":"right","display":"flex","alignItems":"center","justifyContent":"flex-end","boxShadow.1":null,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"border":" ","background":"#588157FF","backgroundImage":null,"color":"white","fontWeight":"normal","fontSize":null,"width":"42.7446954140999%","height":20,"transition":"width 1s ease","textOverflow":"ellipsis","whiteSpace":"nowrap"}},"children":["43%"]}]}]}]},{"name":"div","attribs":{},"children":[{"name":"div","attribs":{"style":{"flexGrow":1,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"background":"#f1f3f4"}},"children":[{"name":"div","attribs":{"style":{"display":"flex","alignItems":"center"}},"children":[{"name":"div","attribs":{"style":{"boxShadow":null,"textAlign":"right","display":"flex","alignItems":"center","justifyContent":"flex-end","boxShadow.1":null,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"border":" ","background":"#588157FF","backgroundImage":null,"color":"white","fontWeight":"normal","fontSize":null,"width":"49.6919917864476%","height":20,"transition":"width 1s ease","textOverflow":"ellipsis","whiteSpace":"nowrap"}},"children":["50%"]}]}]}]},{"name":"div","attribs":{},"children":[{"name":"div","attribs":{"style":{"flexGrow":1,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"background":"#f1f3f4"}},"children":[{"name":"div","attribs":{"style":{"display":"flex","alignItems":"center"}},"children":[{"name":"div","attribs":{"style":{"boxShadow":null,"textAlign":"right","display":"flex","alignItems":"center","justifyContent":"flex-end","boxShadow.1":null,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"border":" ","background":"#344E41FF","backgroundImage":null,"color":"white","fontWeight":"normal","fontSize":null,"width":"96.8172484599589%","height":20,"transition":"width 1s ease","textOverflow":"ellipsis","whiteSpace":"nowrap"}},"children":["97%"]}]}]}]},{"name":"div","attribs":{},"children":[{"name":"div","attribs":{"style":{"flexGrow":1,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"background":"#f1f3f4"}},"children":[{"name":"div","attribs":{"style":{"display":"flex","alignItems":"center"}},"children":[{"name":"div","attribs":{"style":{"boxShadow":null,"textAlign":"right","display":"flex","alignItems":"center","justifyContent":"flex-end","boxShadow.1":null,"borderTopLeftRadius":10,"borderBottomLeftRadius":10,"borderTopRightRadius":10,"borderBottomRightRadius":10,"border":" ","background":"#A3B18AFF","backgroundImage":null,"color":"black","fontWeight":"normal","fontSize":null,"width":"18.0355920602327%","height":20,"transition":"width 1s ease","textOverflow":"ellipsis","whiteSpace":"nowrap"}},"children":["18%"]}]}]}]}]},{"id":"color","name":"color","type":"character","show":false}],"className":"sgb-reactable","dataKey":"f5179980d30b78d1190ee039f943f5c2"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="funds" class="level3">
<h3 class="anchored" data-anchor-id="funds">Funds</h3>
<div style="text-align: justify;">
<p>Funds work similar to the bonds with slight variation. In some ways, they are a mixture between Stocks and Bonds. But with all the tables covered above, this one requires no explanation. This is how we can reuse most of our CSS here as well.</p>
<p>The key here is a column called <em>is_sip_ongoing,</em> which is used to split the tables into two, with slightly different structures.</p>
</div>
<section id="sips" class="level4">
<h4 class="anchored" data-anchor-id="sips">SIPs</h4>
<div style="text-align: justify;">
<p>For SIPs, we have a simple reminder for each row which tells the date for the installment and the amount.</p>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>sips <span class="ot"><-</span> data<span class="sc">$</span>funds_data <span class="sc">|></span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">paste</span>(</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> provider,</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> name,</span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> total_invested,</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> unit_balance,</span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">paste</span>(</span>
<span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a> current_value,</span>
<span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a> profit,</span>
<span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a> change_percent,</span>
<span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb5-15"><a href="#cb5-15" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-16"><a href="#cb5-16" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(</span>
<span id="cb5-18"><a href="#cb5-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(</span>
<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a> left,</span>
<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a> right,</span>
<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a> is_sip_ongoing,</span>
<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a> sip_date,</span>
<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a> sip_amount</span>
<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(is_sip_ongoing <span class="sc">==</span> <span class="dv">1</span>) <span class="sc">|></span></span>
<span id="cb5-27"><a href="#cb5-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb5-28"><a href="#cb5-28" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">paste</span>(</span>
<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a> left,</span>
<span id="cb5-30"><a href="#cb5-30" aria-hidden="true" tabindex="-1"></a> sip_date,</span>
<span id="cb5-31"><a href="#cb5-31" aria-hidden="true" tabindex="-1"></a> sip_amount,</span>
<span id="cb5-32"><a href="#cb5-32" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb5-33"><a href="#cb5-33" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-34"><a href="#cb5-34" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb5-35"><a href="#cb5-35" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(</span>
<span id="cb5-36"><a href="#cb5-36" aria-hidden="true" tabindex="-1"></a> <span class="sc">-</span><span class="fu">c</span>(</span>
<span id="cb5-37"><a href="#cb5-37" aria-hidden="true" tabindex="-1"></a> is_sip_ongoing,</span>
<span id="cb5-38"><a href="#cb5-38" aria-hidden="true" tabindex="-1"></a> sip_date,</span>
<span id="cb5-39"><a href="#cb5-39" aria-hidden="true" tabindex="-1"></a> sip_amount</span>
<span id="cb5-40"><a href="#cb5-40" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-41"><a href="#cb5-41" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-42"><a href="#cb5-42" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-43"><a href="#cb5-43" aria-hidden="true" tabindex="-1"></a><span class="fu">reactable</span>(</span>
<span id="cb5-44"><a href="#cb5-44" aria-hidden="true" tabindex="-1"></a> sips,</span>
<span id="cb5-45"><a href="#cb5-45" aria-hidden="true" tabindex="-1"></a> <span class="at">searchable =</span> <span class="cn">TRUE</span>,</span>
<span id="cb5-46"><a href="#cb5-46" aria-hidden="true" tabindex="-1"></a> <span class="at">columns =</span> <span class="fu">list</span>(</span>
<span id="cb5-47"><a href="#cb5-47" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">colDef</span>(</span>
<span id="cb5-48"><a href="#cb5-48" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Invested"</span>,</span>
<span id="cb5-49"><a href="#cb5-49" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"left"</span>,</span>
<span id="cb5-50"><a href="#cb5-50" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(string) {</span>
<span id="cb5-51"><a href="#cb5-51" aria-hidden="true" tabindex="-1"></a> string <span class="ot"><-</span> <span class="fu">strsplit</span>(string, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb5-52"><a href="#cb5-52" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-53"><a href="#cb5-53" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-54"><a href="#cb5-54" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sip-table"</span>,</span>
<span id="cb5-55"><a href="#cb5-55" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-56"><a href="#cb5-56" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-holding-container stock-left-area"</span>,</span>
<span id="cb5-57"><a href="#cb5-57" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-58"><a href="#cb5-58" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name-row"</span>,</span>
<span id="cb5-59"><a href="#cb5-59" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-60"><a href="#cb5-60" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-code"</span>,</span>
<span id="cb5-61"><a href="#cb5-61" aria-hidden="true" tabindex="-1"></a> string[<span class="dv">1</span>]</span>
<span id="cb5-62"><a href="#cb5-62" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-63"><a href="#cb5-63" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-64"><a href="#cb5-64" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name"</span>,</span>
<span id="cb5-65"><a href="#cb5-65" aria-hidden="true" tabindex="-1"></a> string[<span class="dv">2</span>]</span>
<span id="cb5-66"><a href="#cb5-66" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-67"><a href="#cb5-67" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-68"><a href="#cb5-68" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-69"><a href="#cb5-69" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-holding-row"</span>,</span>
<span id="cb5-70"><a href="#cb5-70" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-71"><a href="#cb5-71" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-invested small-row-left"</span>,</span>
<span id="cb5-72"><a href="#cb5-72" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Invested Value"</span>,</span>
<span id="cb5-73"><a href="#cb5-73" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"vault"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb5-74"><a href="#cb5-74" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">format_price</span>(string[<span class="dv">3</span>], <span class="dv">2</span>))</span>
<span id="cb5-75"><a href="#cb5-75" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-76"><a href="#cb5-76" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-77"><a href="#cb5-77" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-units small-row-left"</span>,</span>
<span id="cb5-78"><a href="#cb5-78" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Total Units"</span>,</span>
<span id="cb5-79"><a href="#cb5-79" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"hashtag"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb5-80"><a href="#cb5-80" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">true_round</span>(string[<span class="dv">4</span>], <span class="dv">2</span>))</span>
<span id="cb5-81"><a href="#cb5-81" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-82"><a href="#cb5-82" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-83"><a href="#cb5-83" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb5-84"><a href="#cb5-84" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-sip-information"</span>,</span>
<span id="cb5-85"><a href="#cb5-85" aria-hidden="true" tabindex="-1"></a> <span class="fu">glue</span>(<span class="st">"${format_price(string[6], 0)} on the {string[5]}th"</span>)</span>
<span id="cb5-86"><a href="#cb5-86" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-87"><a href="#cb5-87" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-88"><a href="#cb5-88" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-89"><a href="#cb5-89" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb5-90"><a href="#cb5-90" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-91"><a href="#cb5-91" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">colDef</span>(</span>
<span id="cb5-92"><a href="#cb5-92" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Current"</span>,</span>
<span id="cb5-93"><a href="#cb5-93" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"right"</span>,</span>
<span id="cb5-94"><a href="#cb5-94" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(string) {</span>
<span id="cb5-95"><a href="#cb5-95" aria-hidden="true" tabindex="-1"></a> string <span class="ot"><-</span> <span class="fu">strsplit</span>(string, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb5-96"><a href="#cb5-96" aria-hidden="true" tabindex="-1"></a> price_class <span class="ot"><-</span> <span class="fu">get_css_class</span>(string[<span class="dv">2</span>], <span class="at">type =</span> <span class="st">"text"</span>)</span>
<span id="cb5-97"><a href="#cb5-97" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-98"><a href="#cb5-98" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-99"><a href="#cb5-99" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sip-table stock-right-area"</span>,</span>
<span id="cb5-100"><a href="#cb5-100" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-101"><a href="#cb5-101" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-current small-row-right"</span>,</span>
<span id="cb5-102"><a href="#cb5-102" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb5-103"><a href="#cb5-103" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"money-bill-transfer"</span>,</span>
<span id="cb5-104"><a href="#cb5-104" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Current Value"</span>,</span>
<span id="cb5-105"><a href="#cb5-105" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb5-106"><a href="#cb5-106" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb5-107"><a href="#cb5-107" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb5-108"><a href="#cb5-108" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-109"><a href="#cb5-109" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-110"><a href="#cb5-110" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb5-111"><a href="#cb5-111" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_price</span>(string[<span class="dv">1</span>]),</span>
<span id="cb5-112"><a href="#cb5-112" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Change %"</span>,</span>
<span id="cb5-113"><a href="#cb5-113" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price value"</span>,</span>
<span id="cb5-114"><a href="#cb5-114" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb5-115"><a href="#cb5-115" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb5-116"><a href="#cb5-116" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-117"><a href="#cb5-117" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-118"><a href="#cb5-118" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-119"><a href="#cb5-119" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb5-120"><a href="#cb5-120" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-profit small-row-right"</span>,</span>
<span id="cb5-121"><a href="#cb5-121" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb5-122"><a href="#cb5-122" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"comment-dollar"</span>,</span>
<span id="cb5-123"><a href="#cb5-123" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb5-124"><a href="#cb5-124" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb5-125"><a href="#cb5-125" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb5-126"><a href="#cb5-126" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-127"><a href="#cb5-127" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb5-128"><a href="#cb5-128" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb5-129"><a href="#cb5-129" aria-hidden="true" tabindex="-1"></a> <span class="fu">glue</span>(<span class="st">"{string[3]}%"</span>),</span>
<span id="cb5-130"><a href="#cb5-130" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price value"</span>,</span>
<span id="cb5-131"><a href="#cb5-131" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb5-132"><a href="#cb5-132" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb5-133"><a href="#cb5-133" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-134"><a href="#cb5-134" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-135"><a href="#cb5-135" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-136"><a href="#cb5-136" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-137"><a href="#cb5-137" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb5-138"><a href="#cb5-138" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-139"><a href="#cb5-139" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb5-140"><a href="#cb5-140" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="reactable html-widget html-fill-item" id="htmlwidget-1e213f97543fd42c22cb" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-1e213f97543fd42c22cb">{"x":{"tag":{"name":"Reactable","attribs":{"data":{"left":["Provider 3_Large & Midcap Fund_319985.6_3963.715_20_2500","Provider 3_Large Cap Fund_369984.6_5233.95_15_7500","Provider 1_Small Cap Fund_1e+05_621.93_13_20000"],"right":["591386_271400_84.82","575577_205592_55.57","99677_-323_-0.32"]},"columns":[{"id":"left","name":"Invested","type":"character","cell":[{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 3"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Large & Midcap Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["319,985.60"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["3963.72"]}]}]},{"name":"p","attribs":{"className":"fund-sip-information"},"children":["$2,500 on the 20th"]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 3"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Large Cap Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["369,984.60"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["5233.95"]}]}]},{"name":"p","attribs":{"className":"fund-sip-information"},"children":["$7,500 on the 15th"]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Small Cap Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["100,000.00"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["621.93"]}]}]},{"name":"p","attribs":{"className":"fund-sip-information"},"children":["$20,000 on the 13th"]}]}]}],"align":"left"},{"id":"right","name":"Current","type":"character","cell":[{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["591,386.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["84.82%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["575,577.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["55.57%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label red"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value red"},"children":["99,677.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label red"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value red"},"children":["-0.32%"]}]}]}],"align":"right"}],"searchable":true,"dataKey":"e279babbc449ce90e8c7fb828a1fe05c"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
<section id="lumpsum" class="level4">
<h4 class="anchored" data-anchor-id="lumpsum">Lumpsum</h4>
<div style="text-align: justify;">
<p>The Lumpsum funds look very, very similar to the stocks interface and this is by design.</p>
</div>
<div class="cell">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>funds <span class="ot"><-</span> data<span class="sc">$</span>funds_data <span class="sc">|></span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">paste</span>(</span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> provider,</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> name,</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> total_invested,</span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> unit_balance,</span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">paste</span>(</span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a> current_value,</span>
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a> profit,</span>
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a> change_percent,</span>
<span id="cb6-14"><a href="#cb6-14" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">"_"</span></span>
<span id="cb6-15"><a href="#cb6-15" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-16"><a href="#cb6-16" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">|></span></span>
<span id="cb6-17"><a href="#cb6-17" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(is_sip_ongoing <span class="sc">!=</span> <span class="dv">1</span>) <span class="sc">|></span></span>
<span id="cb6-18"><a href="#cb6-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(</span>
<span id="cb6-19"><a href="#cb6-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(</span>
<span id="cb6-20"><a href="#cb6-20" aria-hidden="true" tabindex="-1"></a> left,</span>
<span id="cb6-21"><a href="#cb6-21" aria-hidden="true" tabindex="-1"></a> right</span>
<span id="cb6-22"><a href="#cb6-22" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-23"><a href="#cb6-23" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-24"><a href="#cb6-24" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-25"><a href="#cb6-25" aria-hidden="true" tabindex="-1"></a><span class="fu">reactable</span>(</span>
<span id="cb6-26"><a href="#cb6-26" aria-hidden="true" tabindex="-1"></a> funds,</span>
<span id="cb6-27"><a href="#cb6-27" aria-hidden="true" tabindex="-1"></a> <span class="at">searchable =</span> <span class="cn">TRUE</span>,</span>
<span id="cb6-28"><a href="#cb6-28" aria-hidden="true" tabindex="-1"></a> <span class="at">columns =</span> <span class="fu">list</span>(</span>
<span id="cb6-29"><a href="#cb6-29" aria-hidden="true" tabindex="-1"></a> <span class="at">left =</span> <span class="fu">colDef</span>(</span>
<span id="cb6-30"><a href="#cb6-30" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Invested"</span>,</span>
<span id="cb6-31"><a href="#cb6-31" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"left"</span>,</span>
<span id="cb6-32"><a href="#cb6-32" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(string) {</span>
<span id="cb6-33"><a href="#cb6-33" aria-hidden="true" tabindex="-1"></a> string <span class="ot"><-</span> <span class="fu">strsplit</span>(string, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb6-34"><a href="#cb6-34" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb6-35"><a href="#cb6-35" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-36"><a href="#cb6-36" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sip-table"</span>,</span>
<span id="cb6-37"><a href="#cb6-37" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-38"><a href="#cb6-38" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-holding-container stock-left-area"</span>,</span>
<span id="cb6-39"><a href="#cb6-39" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-40"><a href="#cb6-40" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name-row"</span>,</span>
<span id="cb6-41"><a href="#cb6-41" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-42"><a href="#cb6-42" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-code"</span>,</span>
<span id="cb6-43"><a href="#cb6-43" aria-hidden="true" tabindex="-1"></a> string[<span class="dv">1</span>]</span>
<span id="cb6-44"><a href="#cb6-44" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-45"><a href="#cb6-45" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-46"><a href="#cb6-46" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-name"</span>,</span>
<span id="cb6-47"><a href="#cb6-47" aria-hidden="true" tabindex="-1"></a> string[<span class="dv">2</span>]</span>
<span id="cb6-48"><a href="#cb6-48" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-49"><a href="#cb6-49" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-50"><a href="#cb6-50" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-51"><a href="#cb6-51" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"stock-holding-row"</span>,</span>
<span id="cb6-52"><a href="#cb6-52" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-53"><a href="#cb6-53" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-invested small-row-left"</span>,</span>
<span id="cb6-54"><a href="#cb6-54" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Invested Value"</span>,</span>
<span id="cb6-55"><a href="#cb6-55" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"vault"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb6-56"><a href="#cb6-56" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">format_price</span>(string[<span class="dv">3</span>], <span class="dv">2</span>))</span>
<span id="cb6-57"><a href="#cb6-57" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-58"><a href="#cb6-58" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-59"><a href="#cb6-59" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-units small-row-left"</span>,</span>
<span id="cb6-60"><a href="#cb6-60" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Total Units"</span>,</span>
<span id="cb6-61"><a href="#cb6-61" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(<span class="at">name =</span> <span class="st">"hashtag"</span>, <span class="at">class =</span> <span class="st">"label"</span>),</span>
<span id="cb6-62"><a href="#cb6-62" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(<span class="at">class =</span> <span class="st">"value"</span>, <span class="fu">true_round</span>(string[<span class="dv">4</span>], <span class="dv">2</span>))</span>
<span id="cb6-63"><a href="#cb6-63" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-64"><a href="#cb6-64" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-65"><a href="#cb6-65" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-66"><a href="#cb6-66" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-67"><a href="#cb6-67" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb6-68"><a href="#cb6-68" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-69"><a href="#cb6-69" aria-hidden="true" tabindex="-1"></a> <span class="at">right =</span> <span class="fu">colDef</span>(</span>
<span id="cb6-70"><a href="#cb6-70" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Current"</span>,</span>
<span id="cb6-71"><a href="#cb6-71" aria-hidden="true" tabindex="-1"></a> <span class="at">align =</span> <span class="st">"right"</span>,</span>
<span id="cb6-72"><a href="#cb6-72" aria-hidden="true" tabindex="-1"></a> <span class="at">cell =</span> <span class="cf">function</span>(string) {</span>
<span id="cb6-73"><a href="#cb6-73" aria-hidden="true" tabindex="-1"></a> string <span class="ot"><-</span> <span class="fu">strsplit</span>(string, <span class="st">"_"</span>)[[<span class="dv">1</span>]]</span>
<span id="cb6-74"><a href="#cb6-74" aria-hidden="true" tabindex="-1"></a> price_class <span class="ot"><-</span> <span class="fu">get_css_class</span>(string[<span class="dv">2</span>], <span class="at">type =</span> <span class="st">"text"</span>)</span>
<span id="cb6-75"><a href="#cb6-75" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb6-76"><a href="#cb6-76" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-77"><a href="#cb6-77" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"sip-table stock-right-area"</span>,</span>
<span id="cb6-78"><a href="#cb6-78" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-79"><a href="#cb6-79" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-current small-row-right"</span>,</span>
<span id="cb6-80"><a href="#cb6-80" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb6-81"><a href="#cb6-81" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"money-bill-transfer"</span>,</span>
<span id="cb6-82"><a href="#cb6-82" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Current Value"</span>,</span>
<span id="cb6-83"><a href="#cb6-83" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb6-84"><a href="#cb6-84" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb6-85"><a href="#cb6-85" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb6-86"><a href="#cb6-86" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-87"><a href="#cb6-87" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-88"><a href="#cb6-88" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb6-89"><a href="#cb6-89" aria-hidden="true" tabindex="-1"></a> <span class="fu">format_price</span>(string[<span class="dv">1</span>]),</span>
<span id="cb6-90"><a href="#cb6-90" aria-hidden="true" tabindex="-1"></a> <span class="at">title =</span> <span class="st">"Change %"</span>,</span>
<span id="cb6-91"><a href="#cb6-91" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price value"</span>,</span>
<span id="cb6-92"><a href="#cb6-92" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb6-93"><a href="#cb6-93" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb6-94"><a href="#cb6-94" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-95"><a href="#cb6-95" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-96"><a href="#cb6-96" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-97"><a href="#cb6-97" aria-hidden="true" tabindex="-1"></a> <span class="fu">div</span>(</span>
<span id="cb6-98"><a href="#cb6-98" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="st">"fund-profit small-row-right"</span>,</span>
<span id="cb6-99"><a href="#cb6-99" aria-hidden="true" tabindex="-1"></a> <span class="fu">icon</span>(</span>
<span id="cb6-100"><a href="#cb6-100" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"comment-dollar"</span>,</span>
<span id="cb6-101"><a href="#cb6-101" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price label"</span>,</span>
<span id="cb6-102"><a href="#cb6-102" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb6-103"><a href="#cb6-103" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb6-104"><a href="#cb6-104" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-105"><a href="#cb6-105" aria-hidden="true" tabindex="-1"></a> ),</span>
<span id="cb6-106"><a href="#cb6-106" aria-hidden="true" tabindex="-1"></a> <span class="fu">p</span>(</span>
<span id="cb6-107"><a href="#cb6-107" aria-hidden="true" tabindex="-1"></a> <span class="fu">glue</span>(<span class="st">"{string[3]}%"</span>),</span>
<span id="cb6-108"><a href="#cb6-108" aria-hidden="true" tabindex="-1"></a> <span class="at">class =</span> <span class="fu">paste</span>(<span class="st">"stock-current-price value"</span>,</span>
<span id="cb6-109"><a href="#cb6-109" aria-hidden="true" tabindex="-1"></a> price_class,</span>
<span id="cb6-110"><a href="#cb6-110" aria-hidden="true" tabindex="-1"></a> <span class="at">sep =</span> <span class="st">" "</span></span>
<span id="cb6-111"><a href="#cb6-111" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-112"><a href="#cb6-112" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-113"><a href="#cb6-113" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-114"><a href="#cb6-114" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-115"><a href="#cb6-115" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb6-116"><a href="#cb6-116" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-117"><a href="#cb6-117" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb6-118"><a href="#cb6-118" aria-hidden="true" tabindex="-1"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
<div class="cell-output-display">
<div class="reactable html-widget html-fill-item" id="htmlwidget-bc43b2eee71c15fcfebc" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-bc43b2eee71c15fcfebc">{"x":{"tag":{"name":"Reactable","attribs":{"data":{"left":["Provider 1_Blue Chip Fund_340000_8530.6","Provider 1_Dynamic Bond Fund_125000_4211.777","Provider 1_Index Fund_280000_1514.79","Provider 3_Foreign Fund_64996.75_6509.086","Provider 2_Tax Saver Fund_180000_3779.917"],"right":["760076_420076_123.55","147202_22202_17.76","312395_32395_11.57","130507_65510_100.79","494186_314186_174.55"]},"columns":[{"id":"left","name":"Invested","type":"character","cell":[{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Blue Chip Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["340,000.00"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["8530.6"]}]}]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Dynamic Bond Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["125,000.00"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["4211.78"]}]}]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 1"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Index Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["280,000.00"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["1514.79"]}]}]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 3"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Foreign Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["64,996.75"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["6509.09"]}]}]}]}]},{"name":"div","attribs":{"className":"sip-table"},"children":[{"name":"div","attribs":{"className":"fund-holding-container stock-left-area"},"children":[{"name":"div","attribs":{"className":"stock-name-row"},"children":[{"name":"div","attribs":{"className":"stock-code"},"children":["Provider 2"]},{"name":"div","attribs":{"className":"stock-name"},"children":["Tax Saver Fund"]}]},{"name":"div","attribs":{"className":"stock-holding-row"},"children":[{"name":"div","attribs":{"title":"Invested Value","className":"fund-invested small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"vault icon","className":"fas fa-vault label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["180,000.00"]}]},{"name":"div","attribs":{"title":"Total Units","className":"fund-units small-row-left"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"hashtag icon","className":"fas fa-hashtag label"},"children":[]},{"name":"p","attribs":{"className":"value"},"children":["3779.92"]}]}]}]}]}],"align":"left"},{"id":"right","name":"Current","type":"character","cell":[{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["760,076.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["123.55%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["147,202.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["17.76%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["312,395.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["11.57%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["130,507.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["100.79%"]}]}]},{"name":"div","attribs":{"className":"sip-table stock-right-area"},"children":[{"name":"div","attribs":{"className":"fund-current small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"money-bill-transfer icon","title":"Current Value","className":"fas fa-money-bill-transfer stock-current-price label green"},"children":[]},{"name":"p","attribs":{"title":"Change %","className":"stock-current-price value green"},"children":["494,186.00"]}]},{"name":"div","attribs":{"className":"fund-profit small-row-right"},"children":[{"name":"i","attribs":{"role":"presentation","aria-label":"comment-dollar icon","className":"fas fa-comment-dollar stock-current-price label green"},"children":[]},{"name":"p","attribs":{"className":"stock-current-price value green"},"children":["174.55%"]}]}]}],"align":"right"}],"searchable":true,"dataKey":"1558fd9d877d8523b41d27c0ac5dc50a"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
</section>
</section>
</main>
<!-- /main column -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
const mode = bsSheetEl.getAttribute("data-mode");
const bodyEl = window.document.querySelector("body");
if (mode === "dark") {
bodyEl.classList.add("quarto-dark");
bodyEl.classList.remove("quarto-light");
} else {
bodyEl.classList.add("quarto-light");
bodyEl.classList.remove("quarto-dark");
}
}
const toggleBodyColorPrimary = () => {
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
if (bsSheetEl) {
toggleBodyColorMode(bsSheetEl);
}
}
toggleBodyColorPrimary();
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const clipboard = new window.ClipboardJS('.code-copy-button', {
text: function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
});
clipboard.on('success', function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked"
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button,
{ trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
appendTo: function(el) {
return el.parentElement;
},
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
};
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
for (var i=0; i<noterefs.length; i++) {
const ref = noterefs[i];
tippyHover(ref, function() {
// use id or data attribute instead here
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
try { href = new URL(href).hash; } catch {}
const id = href.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
let selectedAnnoteEl;
const selectorForAnnotation = ( cell, annotation) => {
let cellAttr = 'data-code-cell="' + cell + '"';
let lineAttr = 'data-code-annotation="' + annotation + '"';
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
return selector;
}
const selectCodeLines = (annoteEl) => {
const doc = window.document;
const targetCell = annoteEl.getAttribute("data-target-cell");
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
const lineIds = lines.map((line) => {
return targetCell + "-" + line;
})
let top = null;
let height = null;
let parent = null;
if (lineIds.length > 0) {
//compute the position of the single el (top and bottom and make a div)
const el = window.document.getElementById(lineIds[0]);
top = el.offsetTop;