Skip to content

Advanced

Flow Charts

There is a library named flowchart.js that can be used to create flow charts. The syntax is documented here and below is an example.

<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.15.0/flowchart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
if (typeof jQuery != 'undefined') {
    (function( $ ) {
        $.fn.flowchart = function( options ) {
            return this.each(function() {
            var $this = $(this);
            var diagram = flowchart.parse($this.text());
            $this.html('');
            diagram.drawSVG(this, options);
            });
        };
    })( jQuery );
}
</script>

<div class="diagram">
st=>start: Start:>https://www.mbari.org[blank]
e=>end: End:>https://www.mbari.org
op1=>operation: Operation1
op2=>operation: Operation2
sub1=>subroutine: Subroutine1
cond=>condition: Decision1
c2=>condition: Decision2
io=>inputoutput: Need info

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
</div>

<script>
$(".diagram").flowchart();
</script>
st=>start: Start:>https://www.mbari.org[blank] e=>end: End:>https://www.mbari.org op1=>operation: Operation1 op2=>operation: Operation2 sub1=>subroutine: Subroutine1 cond=>condition: Decision1 c2=>condition: Decision2 io=>inputoutput: Need info st->op1(right)->cond cond(yes, right)->c2 cond(no)->sub1(left)->op1 c2(yes)->io->e c2(no)->op2->e

Sequence Diagrams

Another diagram type that you can use is sequence diagrams. You can use the js-sequence-diagrams library. Here is an example:

<script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.5.1/snap.svg-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.11.0/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sequence-diagrams/1.0.6/sequence-diagram-min.js"></script>

<div class="seq-diagram">
Title: MBARI Sequence Diagram
A->B: Normal line
B-->C: Dashed line
C->>D: Open arrow
D-->>A: Dashed open arrow
Note left of A: Note to the\n left of A
Note right of B: Note to the\n right of B
Note right of D: Note to the\n right of D
</div>
<script>
$(".seq-diagram").sequenceDiagram({theme: 'simple'});
</script>

Renders out to:

Title: MBARI Sequence Diagram A->B: Normal line B-->C: Dashed line C->>D: Open arrow D-->>A: Dashed open arrow Note left of A: Note to the\n left of A Note right of B: Note to the\n right of B Note right of D: Note to the\n right of D

Advanced Tables

You can embed advanced data tables using the DataTables JavaScript library and CSS. Here is an example:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.21/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.21/css/jquery.dataTables.min.css">
<table id="example" class="display" style="width:100%">
  <thead><tr><th>Date</th><th>Temp(C)</th><th>Sal(psu)</th><th>Depth(m)</th><th>Chl(mg/m^3)</th></tr></thead>
  <tbody>
    <tr><td>2020-02-19 19:52:34.34</td><td>22.8719</td><td>36.2036</td><td>15.132</td><td>1.2729</td></tr>
    <tr><td>2020-02-19 20:02:34.34</td><td>22.4885</td><td>36.1981</td><td>15.248</td><td>1.4179</td></tr>
    <tr><td>2020-02-19 20:12:34.34</td><td>22.4566</td><td>36.2077</td><td>15.133</td><td>1.4103</td></tr>
.
.
.
    <tr><td>2020-02-21 06:52:34.34</td><td>22.1736</td><td>36.2389</td><td>15.642</td><td>1.9901</td></tr>
  </tbody>
</table>
<script>
$("#example").DataTable();
</script>

Renders:

DateTemp(C)Sal(psu)Depth(m)Chl(mg/m^3)
2020-02-19 19:52:34.3422.871936.203615.1321.2729
2020-02-19 20:02:34.3422.488536.198115.2481.4179
2020-02-19 20:12:34.3422.456636.207715.1331.4103
2020-02-19 20:22:34.3422.450636.206215.1611.4179
2020-02-19 20:32:34.3422.436936.2115.1211.4026
2020-02-19 20:42:34.3422.408236.21215.0931.456
2020-02-19 20:52:34.3422.401636.21115.0961.4484
2020-02-19 21:02:34.3422.538936.203515.1621.4179
2020-02-19 21:12:34.3422.556536.204315.1711.456
2020-02-19 21:22:34.3422.591936.205215.141.5018
2020-02-19 21:32:34.3422.605436.205515.1171.4865
2020-02-19 21:42:34.3422.574436.205415.1171.5018
2020-02-19 21:52:34.3422.544736.206215.1861.4637
2020-02-19 22:02:34.3422.535236.206515.1031.4865
2020-02-19 22:12:34.3422.465636.206615.0891.5247
2020-02-19 22:22:34.3422.411236.213415.1491.601
2020-02-19 22:32:34.3422.401436.21415.1211.6162
2020-02-19 22:42:34.3422.404336.211915.1321.5628
2020-02-19 22:52:34.3422.422736.200215.0471.5247
2020-02-19 23:02:34.3422.406736.200115.0541.5705
2020-02-19 23:12:34.3422.398836.204315.1311.6239
2020-02-19 23:22:34.3422.400736.200915.0431.5552
2020-02-19 23:32:34.3422.41236.203214.9981.5247
2020-02-19 23:42:34.3422.40736.202715.091.5552
2020-02-19 23:52:34.3422.409436.202915.0631.601
2020-02-20 00:02:34.3422.410436.203615.0811.5323
2020-02-20 00:12:34.3422.402436.203615.0911.54
2020-02-20 00:22:34.3422.410236.204515.0781.4942
2020-02-20 00:32:34.3422.415136.205715.0061.5705
2020-02-20 00:42:34.3422.426436.206215.0061.4789
2020-02-20 00:52:34.3422.419936.205715.0381.5094
2020-02-20 01:02:34.3422.442536.207115.0311.4789
2020-02-20 01:12:34.3422.438336.207714.9941.5094
2020-02-20 01:22:34.3422.42936.205914.9851.4789
2020-02-20 01:32:34.3422.417136.206315.0311.4865
2020-02-20 01:42:34.3422.424636.206915.0351.4942
2020-02-20 01:52:34.3422.425936.207215.0471.4789
2020-02-20 02:02:34.3422.420836.207614.971.4865
2020-02-20 02:12:34.3422.429836.20915.0061.4713
2020-02-20 02:22:34.3422.430336.208915.0441.4713
2020-02-20 02:32:34.3422.431636.209315.0021.4789
2020-02-20 02:42:34.3422.427736.209215.0731.4942
2020-02-20 02:52:34.3422.423636.209214.9751.5171
2020-02-20 03:02:34.3422.425336.209415.0251.54
2020-02-20 03:12:34.3422.42236.209515.0011.4942
2020-02-20 03:22:34.3422.418136.209214.9841.5171
2020-02-20 03:32:34.3422.4236.209914.8881.5323
2020-02-20 03:42:34.3422.414536.207914.9111.4865
2020-02-20 03:52:34.3422.409936.209314.8981.4942
2020-02-20 04:02:34.3422.407536.209214.8871.5171
2020-02-20 04:12:34.3422.408136.209214.9461.5171
2020-02-20 04:22:34.3422.403736.209314.8941.4789
2020-02-20 04:32:34.3422.403936.209214.9421.4789
2020-02-20 04:42:34.3422.403636.20914.8861.5247
2020-02-20 04:52:34.3422.402736.209714.8631.4713
2020-02-20 05:02:34.3422.402436.208714.9331.4637
2020-02-20 05:12:34.3422.401236.209314.8621.4865
2020-02-20 05:22:34.3422.399636.20914.8981.5781
2020-02-20 05:32:34.3422.400236.207214.8471.4789
2020-02-20 05:42:34.3422.40436.205614.8061.456
2020-02-20 05:52:34.3422.409936.207614.8181.4789
2020-02-20 06:02:34.3422.402536.206414.7771.456
2020-02-20 06:12:34.3422.400136.205414.8551.4789
2020-02-20 06:22:34.3422.400536.205814.8511.4637
2020-02-20 06:32:34.3422.400136.205214.7191.4408
2020-02-20 06:42:34.3422.402336.206314.7051.456
2020-02-20 06:52:34.3422.399636.207214.781.4942
2020-02-20 07:02:34.3422.528536.161514.7061.4255
2020-02-20 07:12:34.3422.456436.18814.7421.5476
2020-02-20 07:22:34.3422.519236.164714.7931.4103
2020-02-20 07:32:34.3422.510136.168414.7491.4331
2020-02-20 07:42:34.3422.52936.16114.6981.4255
2020-02-20 07:52:34.3422.535436.157714.7091.4713
2020-02-20 08:02:34.3422.508336.170414.5741.456
2020-02-20 08:12:34.3422.531936.159214.6471.4408
2020-02-20 08:22:34.3422.523736.162114.6361.4331
2020-02-20 08:32:34.3422.512336.165714.6521.4789
2020-02-20 08:42:34.3422.441936.191314.6141.4713
2020-02-20 08:52:34.3422.50236.169714.5621.456
2020-02-20 09:02:34.3422.510836.165614.6571.4331
2020-02-20 09:12:34.3422.536836.160514.631.456
2020-02-20 09:22:34.3422.574436.153214.5711.4331
2020-02-20 09:32:34.3422.609536.147714.6031.4026
2020-02-20 09:42:34.3422.55736.159214.6151.4484
2020-02-20 09:52:34.3422.579936.153414.5871.456
2020-02-20 10:02:34.3422.536336.164514.61.4255
2020-02-20 10:12:34.3422.555436.161614.5611.4408
2020-02-20 10:22:34.3422.590836.155914.6121.4103
2020-02-20 10:32:34.3422.600136.153614.571.4103
2020-02-20 10:42:34.3422.565736.163214.4831.4255
2020-02-20 10:52:34.3422.597136.157214.5741.4179
2020-02-20 11:02:34.3422.636536.149814.6031.4103
2020-02-20 11:12:34.3422.632436.150814.5071.4179
2020-02-20 11:22:34.3422.648936.094314.5281.3721
2020-02-20 11:32:34.3422.715836.138914.5251.3645
2020-02-20 11:42:34.3422.707636.140914.5471.3568
2020-02-20 11:52:34.3422.6136.156114.6171.3874
2020-02-20 12:02:34.3422.600136.15714.5431.395
2020-02-20 12:12:34.3422.584236.158714.5671.4789
2020-02-20 12:22:34.3422.580536.160514.5481.456
2020-02-20 12:32:34.3422.593136.157114.561.4331
2020-02-20 12:42:34.3422.600436.15714.61.4637
2020-02-20 12:52:34.3422.585436.159314.5471.4179
2020-02-20 13:02:34.3422.574936.161614.5631.4789
2020-02-20 13:12:34.3422.547336.166514.5911.4408
2020-02-20 13:22:34.3422.588236.159714.571.4179
2020-02-20 13:32:34.3422.608536.157114.581.4103
2020-02-20 13:42:34.3422.538936.169914.6611.4484
2020-02-20 13:52:34.3422.58836.15914.6181.4789
2020-02-20 14:02:34.3422.600736.156714.581.4713
2020-02-20 14:12:34.3422.562236.165514.6581.4408
2020-02-20 14:22:34.3422.600936.157414.6631.395
2020-02-20 14:32:34.3422.569336.163714.6211.395
2020-02-20 14:42:34.3422.572636.161614.6891.4103
2020-02-20 14:52:34.3422.560136.164714.6911.4103
2020-02-20 15:02:34.3422.571136.162614.7491.4789
2020-02-20 15:12:34.3422.54436.167314.7121.4255
2020-02-20 15:22:34.3422.563836.164214.7571.4331
2020-02-20 15:32:34.3422.554936.16614.7331.4637
2020-02-20 15:42:34.3422.551436.16714.6971.4408
2020-02-20 15:52:34.3422.570436.16414.8261.4713
2020-02-20 16:02:34.3422.565736.163814.8181.4713
2020-02-20 16:12:34.3422.557736.166414.8261.4789
2020-02-20 16:22:34.3422.544136.169214.8451.4942
2020-02-20 16:32:34.3422.596236.160914.8591.4789
2020-02-20 16:42:34.3422.5436.169214.8961.5094
2020-02-20 16:52:34.3422.555336.179214.8841.4865
2020-02-20 17:02:34.3422.564736.165714.8551.5476
2020-02-20 17:12:34.3422.604136.15714.9921.5323
2020-02-20 17:22:34.3422.574636.164414.991.5247
2020-02-20 17:32:34.3422.563836.166714.9341.54
2020-02-20 17:42:34.3422.557436.165815.0221.54
2020-02-20 17:52:34.3422.57836.16215.0651.54
2020-02-20 18:02:34.3422.492636.177315.0881.601
2020-02-20 18:12:34.3422.547136.167515.1141.5781
2020-02-20 18:22:34.3422.514136.17415.0251.6162
2020-02-20 18:32:34.3422.520136.172515.0731.5705
2020-02-20 18:42:34.3422.508236.175715.081.601
2020-02-20 18:52:34.3422.473936.182215.2681.5781
2020-02-20 19:02:34.3422.492236.178715.1021.5781
2020-02-20 19:12:34.3422.49736.178115.2631.5628
2020-02-20 19:22:34.3422.494936.179414.9741.6239
2020-02-20 19:32:34.3422.480336.178415.1991.6239
2020-02-20 19:42:34.3422.479736.179214.9531.6468
2020-02-20 19:52:34.3422.478536.179415.3241.6391
2020-02-20 20:02:34.3422.466336.180815.2941.6697
2020-02-20 20:12:34.3422.462436.181915.4261.7002
2020-02-20 20:22:34.3422.452236.182615.1841.6544
2020-02-20 20:32:34.3422.429136.186215.2991.7154
2020-02-20 20:42:34.3422.422436.187315.5751.7002
2020-02-20 20:52:34.3422.399536.190315.321.7231
2020-02-20 21:02:34.3422.387236.19414.9831.7231
2020-02-20 21:12:34.3422.372136.19515.1521.7459
2020-02-20 21:22:34.3422.365736.196615.5481.7917
2020-02-20 21:32:34.3422.351936.198515.391.7765
2020-02-20 21:42:34.3422.354436.19814.7821.868
2020-02-20 21:52:34.3422.344536.199715.3921.9291
2020-02-20 22:02:34.3422.330636.202315.2991.8909
2020-02-20 22:12:34.3422.330336.204215.2941.868
2020-02-20 22:22:34.3422.317936.204515.3761.8909
2020-02-20 22:32:34.3422.301136.205815.161.9825
2020-02-20 22:42:34.3422.293336.207715.3231.9062
2020-02-20 22:52:34.3422.289636.208715.2071.9443
2020-02-20 23:02:34.3422.274936.21114.7491.9901
2020-02-20 23:12:34.3422.260136.213715.5352.013
2020-02-20 23:22:34.3422.259136.214915.281.9672
2020-02-20 23:32:34.3422.25536.21615.4982.013
2020-02-20 23:42:34.3422.240736.215615.4622.0054
2020-02-20 23:52:34.3422.235436.219715.2742.0359
2020-02-21 00:02:34.3422.228236.220315.7472.0816
2020-02-21 00:12:34.3422.224436.220815.0812.0359
2020-02-21 00:22:34.3422.221336.223115.2991.9901
2020-02-21 00:32:34.3422.222936.226615.4172.1122
2020-02-21 00:42:34.3422.214836.22615.2612.0664
2020-02-21 00:52:34.3422.219136.227515.352.0893
2020-02-21 01:02:34.3422.198536.227514.962.0664
2020-02-21 01:12:34.3422.205936.229415.1352.0893
2020-02-21 01:22:34.3422.199636.229315.2442.0664
2020-02-21 01:32:34.3422.205836.2314.9052.0054
2020-02-21 01:42:34.3422.190936.232415.3082.0816
2020-02-21 01:52:34.3422.208436.233315.742.0816
2020-02-21 02:02:34.3422.201136.231615.632.0511
2020-02-21 02:12:34.3422.201636.232515.4051.9443
2020-02-21 02:22:34.3422.213636.232915.4342.0435
2020-02-21 02:32:34.3422.212636.234815.6022.0664
2020-02-21 02:42:34.3422.20436.234614.951.9672
2020-02-21 02:52:34.3422.20736.233114.2381.9291
2020-02-21 03:02:34.3422.214236.234215.851.9672
2020-02-21 03:12:34.3422.217336.232915.6271.9825
2020-02-21 03:22:34.3422.203336.234815.0472.1045
2020-02-21 03:32:34.3422.214536.235316.4471.9672
2020-02-21 03:42:34.3422.203436.235415.7582.0664
2020-02-21 03:52:34.3422.205136.235915.3591.9901
2020-02-21 04:02:34.3422.199936.237415.8632.0893
2020-02-21 04:12:34.3422.191436.235715.12.0206
2020-02-21 04:22:34.3422.195736.237414.9591.9901
2020-02-21 04:32:34.3422.198836.237615.0221.9901
2020-02-21 04:42:34.3422.192836.240815.4112.013
2020-02-21 04:52:34.3422.191236.240315.0472.0054
2020-02-21 05:02:34.3422.196436.237415.5152.0206
2020-02-21 05:12:34.3422.168936.24115.6032.0435
2020-02-21 05:22:34.3422.183436.24315.432.0664
2020-02-21 05:32:34.3422.182736.240715.292.0282
2020-02-21 05:42:34.3422.175336.241213.7791.9901
2020-02-21 05:52:34.3422.171836.242615.7122.0816
2020-02-21 06:02:34.3422.165736.244215.4922.1122
2020-02-21 06:12:34.3422.167936.241115.9052.0359
2020-02-21 06:22:34.3422.169336.24214.3232.0664
2020-02-21 06:32:34.3422.164736.240314.5572.0816
2020-02-21 06:42:34.3422.157736.241515.5942.0511
2020-02-21 06:52:34.3422.173636.238915.6421.9901

Highcharts

You can even do complex Highcharts style stuff.

<script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/8.2.2/highcharts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/8.2.2/modules/exporting.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/8.2.2/modules/export-data.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highcharts/8.2.2/modules/accessibility.min.js"></script>

<figure class="highcharts-figure">
    <div id="container"></div>
</figure>
<script>
  Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
    title: {
        text: 'Monthly Average Temperature'
    },
    subtitle: {
        text: 'Source: WorldClimate.com'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },
    yAxis: {
        title: {
            text: 'Temperature (°C)'
        }
    },
    plotOptions: {
        line: {
            dataLabels: {
                enabled: true
            },
            enableMouseTracking: false
        }
    },
    series: [{
        name: 'Tokyo',
        data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
    }, {
        name: 'London',
        data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
    }]
});
</script>

Will render the following: