4 | based on dark.css by Ivan Sagalaev
5 |
6 | */
7 |
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | background: #3f3f3f;
13 | color: #dcdcdc;
14 | }
15 |
16 | .hljs-keyword,
17 | .hljs-selector-tag,
18 | .hljs-tag {
19 | color: #e3ceab;
20 | }
21 |
22 | .hljs-template-tag {
23 | color: #dcdcdc;
24 | }
25 |
26 | .hljs-number {
27 | color: #8cd0d3;
28 | }
29 |
30 | .hljs-variable,
31 | .hljs-template-variable,
32 | .hljs-attribute {
33 | color: #efdcbc;
34 | }
35 |
36 | .hljs-literal {
37 | color: #efefaf;
38 | }
39 |
40 | .hljs-subst {
41 | color: #8f8f8f;
42 | }
43 |
44 | .hljs-title,
45 | .hljs-name,
46 | .hljs-selector-id,
47 | .hljs-selector-class,
48 | .hljs-section,
49 | .hljs-type {
50 | color: #efef8f;
51 | }
52 |
53 | .hljs-symbol,
54 | .hljs-bullet,
55 | .hljs-link {
56 | color: #dca3a3;
57 | }
58 |
59 | .hljs-deletion,
60 | .hljs-string,
61 | .hljs-built_in,
62 | .hljs-builtin-name {
63 | color: #cc9393;
64 | }
65 |
66 | .hljs-addition,
67 | .hljs-comment,
68 | .hljs-quote,
69 | .hljs-meta {
70 | color: #7f9f7f;
71 | }
72 |
73 |
74 | .hljs-emphasis {
75 | font-style: italic;
76 | }
77 |
78 | .hljs-strong {
79 | font-weight: bold;
80 | }
81 |
--------------------------------------------------------------------------------
/reveal.js/lib/font/league-gothic/LICENSE:
--------------------------------------------------------------------------------
1 | SIL Open Font License (OFL)
2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
3 |
--------------------------------------------------------------------------------
/reveal.js/lib/font/league-gothic/league-gothic.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'League Gothic';
3 | src: url('league-gothic.eot');
4 | src: url('league-gothic.eot?#iefix') format('embedded-opentype'),
5 | url('league-gothic.woff') format('woff'),
6 | url('league-gothic.ttf') format('truetype');
7 |
8 | font-weight: normal;
9 | font-style: normal;
10 | }
--------------------------------------------------------------------------------
/reveal.js/lib/font/league-gothic/league-gothic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/league-gothic/league-gothic.eot
--------------------------------------------------------------------------------
/reveal.js/lib/font/league-gothic/league-gothic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/league-gothic/league-gothic.ttf
--------------------------------------------------------------------------------
/reveal.js/lib/font/league-gothic/league-gothic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/league-gothic/league-gothic.woff
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff
--------------------------------------------------------------------------------
/reveal.js/lib/font/source-sans-pro/source-sans-pro.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Source Sans Pro';
3 | src: url('source-sans-pro-regular.eot');
4 | src: url('source-sans-pro-regular.eot?#iefix') format('embedded-opentype'),
5 | url('source-sans-pro-regular.woff') format('woff'),
6 | url('source-sans-pro-regular.ttf') format('truetype');
7 | font-weight: normal;
8 | font-style: normal;
9 | }
10 |
11 | @font-face {
12 | font-family: 'Source Sans Pro';
13 | src: url('source-sans-pro-italic.eot');
14 | src: url('source-sans-pro-italic.eot?#iefix') format('embedded-opentype'),
15 | url('source-sans-pro-italic.woff') format('woff'),
16 | url('source-sans-pro-italic.ttf') format('truetype');
17 | font-weight: normal;
18 | font-style: italic;
19 | }
20 |
21 | @font-face {
22 | font-family: 'Source Sans Pro';
23 | src: url('source-sans-pro-semibold.eot');
24 | src: url('source-sans-pro-semibold.eot?#iefix') format('embedded-opentype'),
25 | url('source-sans-pro-semibold.woff') format('woff'),
26 | url('source-sans-pro-semibold.ttf') format('truetype');
27 | font-weight: 600;
28 | font-style: normal;
29 | }
30 |
31 | @font-face {
32 | font-family: 'Source Sans Pro';
33 | src: url('source-sans-pro-semibolditalic.eot');
34 | src: url('source-sans-pro-semibolditalic.eot?#iefix') format('embedded-opentype'),
35 | url('source-sans-pro-semibolditalic.woff') format('woff'),
36 | url('source-sans-pro-semibolditalic.ttf') format('truetype');
37 | font-weight: 600;
38 | font-style: italic;
39 | }
--------------------------------------------------------------------------------
/reveal.js/lib/js/html5shiv.js:
--------------------------------------------------------------------------------
1 | document.createElement('header');
2 | document.createElement('nav');
3 | document.createElement('section');
4 | document.createElement('article');
5 | document.createElement('aside');
6 | document.createElement('footer');
7 | document.createElement('hgroup');
--------------------------------------------------------------------------------
/reveal.js/lib/js/promise.js:
--------------------------------------------------------------------------------
1 | /* MIT | https://github.com/taylorhakes/promise-polyfill */
2 | !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(0,function(){"use strict";function e(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})}function n(){}function t(e){if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],u(e,this)}function o(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,t._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var o;try{o=t(e._value)}catch(f){return void i(n.promise,f)}r(n.promise,o)}else(1===e._state?r:i)(n.promise,e._value)})):e._deferreds.push(n)}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var o=n.then;if(n instanceof t)return e._state=3,e._value=n,void f(e);if("function"==typeof o)return void u(function(e,n){return function(){e.apply(n,arguments)}}(o,n),e)}e._state=1,e._value=n,f(e)}catch(r){i(e,r)}}function i(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&t._immediateFn(function(){e._handled||t._unhandledRejectionFn(e._value)});for(var n=0,r=e._deferreds.length;r>n;n++)o(e,e._deferreds[n]);e._deferreds=null}function u(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,i(n,e))})}catch(o){if(t)return;t=!0,i(n,o)}}var c=setTimeout;t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(e,t,r)),r},t.prototype["finally"]=e,t.all=function(e){return new t(function(n,t){function o(e,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){o(e,n)},t)}r[e]=f,0==--i&&n(r)}catch(c){t(c)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);for(var i=r.length,f=0;r.length>f;f++)o(f,r[f])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(n){n(e)})},t.reject=function(e){return new t(function(n,t){t(e)})},t.race=function(e){return new t(function(n,t){for(var o=0,r=e.length;r>o;o++)e[o].then(n,t)})},t._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){c(e,0)},t._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();"Promise"in l?l.Promise.prototype["finally"]||(l.Promise.prototype["finally"]=e):l.Promise=t});
--------------------------------------------------------------------------------
/reveal.js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal.js",
3 | "version": "3.8.0",
4 | "description": "The HTML Presentation Framework",
5 | "homepage": "http://revealjs.com",
6 | "subdomain": "revealjs",
7 | "main": "js/reveal.js",
8 | "scripts": {
9 | "test": "grunt test",
10 | "start": "grunt serve",
11 | "build": "grunt"
12 | },
13 | "author": {
14 | "name": "Hakim El Hattab",
15 | "email": "hakim.elhattab@gmail.com",
16 | "web": "http://hakim.se"
17 | },
18 | "repository": {
19 | "type": "git",
20 | "url": "git://github.com/hakimel/reveal.js.git"
21 | },
22 | "engines": {
23 | "node": ">=9.0.0"
24 | },
25 | "devDependencies": {
26 | "express": "^4.16.2",
27 | "grunt": "^1.0.4",
28 | "grunt-autoprefixer": "^3.0.4",
29 | "grunt-cli": "^1.3.2",
30 | "grunt-contrib-connect": "^2.0.0",
31 | "grunt-contrib-cssmin": "^3.0.0",
32 | "grunt-contrib-jshint": "^2.0.0",
33 | "grunt-contrib-qunit": "^3.1.0",
34 | "grunt-contrib-uglify": "^3.3.0",
35 | "grunt-contrib-watch": "^1.1.0",
36 | "grunt-sass": "^3.0.2",
37 | "grunt-zip": "~0.17.1",
38 | "load-grunt-tasks": "^4.0.0",
39 | "mustache": "^2.3.0",
40 | "node-sass": "^4.13.1",
41 | "socket.io": "^2.2.0"
42 | },
43 | "license": "MIT"
44 | }
45 |
--------------------------------------------------------------------------------
/reveal.js/plugin/markdown/example.md:
--------------------------------------------------------------------------------
1 | # Markdown Demo
2 |
3 |
4 |
5 | ## External 1.1
6 |
7 | Content 1.1
8 |
9 | Note: This will only appear in the speaker notes window.
10 |
11 |
12 | ## External 1.2
13 |
14 | Content 1.2
15 |
16 |
17 |
18 | ## External 2
19 |
20 | Content 2.1
21 |
22 |
23 |
24 | ## External 3.1
25 |
26 | Content 3.1
27 |
28 |
29 | ## External 3.2
30 |
31 | Content 3.2
32 |
33 |
34 | ## External 3.3
35 |
36 | 
37 |
--------------------------------------------------------------------------------
/reveal.js/plugin/math/math.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A plugin which enables rendering of math equations inside
3 | * of reveal.js slides. Essentially a thin wrapper for MathJax.
4 | *
5 | * @author Hakim El Hattab
6 | */
7 | var RevealMath = window.RevealMath || (function(){
8 |
9 | var options = Reveal.getConfig().math || {};
10 | var mathjax = options.mathjax || 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js';
11 | var config = options.config || 'TeX-AMS_HTML-full';
12 | var url = mathjax + '?config=' + config;
13 |
14 | var defaultOptions = {
15 | messageStyle: 'none',
16 | tex2jax: {
17 | inlineMath: [ [ '$', '$' ], [ '\\(', '\\)' ] ],
18 | skipTags: [ 'script', 'noscript', 'style', 'textarea', 'pre' ]
19 | },
20 | skipStartupTypeset: true
21 | };
22 |
23 | function defaults( options, defaultOptions ) {
24 |
25 | for ( var i in defaultOptions ) {
26 | if ( !options.hasOwnProperty( i ) ) {
27 | options[i] = defaultOptions[i];
28 | }
29 | }
30 |
31 | }
32 |
33 | function loadScript( url, callback ) {
34 |
35 | var head = document.querySelector( 'head' );
36 | var script = document.createElement( 'script' );
37 | script.type = 'text/javascript';
38 | script.src = url;
39 |
40 | // Wrapper for callback to make sure it only fires once
41 | var finish = function() {
42 | if( typeof callback === 'function' ) {
43 | callback.call();
44 | callback = null;
45 | }
46 | }
47 |
48 | script.onload = finish;
49 |
50 | // IE
51 | script.onreadystatechange = function() {
52 | if ( this.readyState === 'loaded' ) {
53 | finish();
54 | }
55 | }
56 |
57 | // Normal browsers
58 | head.appendChild( script );
59 |
60 | }
61 |
62 | return {
63 | init: function() {
64 |
65 | defaults( options, defaultOptions );
66 | defaults( options.tex2jax, defaultOptions.tex2jax );
67 | options.mathjax = options.config = null;
68 |
69 | loadScript( url, function() {
70 |
71 | MathJax.Hub.Config( options );
72 |
73 | // Typeset followed by an immediate reveal.js layout since
74 | // the typesetting process could affect slide height
75 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] );
76 | MathJax.Hub.Queue( Reveal.layout );
77 |
78 | // Reprocess equations in slides when they turn visible
79 | Reveal.addEventListener( 'slidechanged', function( event ) {
80 |
81 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] );
82 |
83 | } );
84 |
85 | } );
86 |
87 | }
88 | }
89 |
90 | })();
91 |
92 | Reveal.registerPlugin( 'math', RevealMath );
93 |
--------------------------------------------------------------------------------
/reveal.js/plugin/multiplex/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var multiplex = Reveal.getConfig().multiplex;
3 | var socketId = multiplex.id;
4 | var socket = io.connect(multiplex.url);
5 |
6 | socket.on(multiplex.id, function(data) {
7 | // ignore data from sockets that aren't ours
8 | if (data.socketId !== socketId) { return; }
9 | if( window.location.host === 'localhost:1947' ) return;
10 |
11 | Reveal.setState(data.state);
12 | });
13 | }());
14 |
--------------------------------------------------------------------------------
/reveal.js/plugin/multiplex/index.js:
--------------------------------------------------------------------------------
1 | var http = require('http');
2 | var express = require('express');
3 | var fs = require('fs');
4 | var io = require('socket.io');
5 | var crypto = require('crypto');
6 |
7 | var app = express();
8 | var staticDir = express.static;
9 | var server = http.createServer(app);
10 |
11 | io = io(server);
12 |
13 | var opts = {
14 | port: process.env.PORT || 1948,
15 | baseDir : __dirname + '/../../'
16 | };
17 |
18 | io.on( 'connection', function( socket ) {
19 | socket.on('multiplex-statechanged', function(data) {
20 | if (typeof data.secret == 'undefined' || data.secret == null || data.secret === '') return;
21 | if (createHash(data.secret) === data.socketId) {
22 | data.secret = null;
23 | socket.broadcast.emit(data.socketId, data);
24 | };
25 | });
26 | });
27 |
28 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) {
29 | app.use('/' + dir, staticDir(opts.baseDir + dir));
30 | });
31 |
32 | app.get("/", function(req, res) {
33 | res.writeHead(200, {'Content-Type': 'text/html'});
34 |
35 | var stream = fs.createReadStream(opts.baseDir + '/index.html');
36 | stream.on('error', function( error ) {
37 | res.write('reveal.js multiplex server.
Generate token');
38 | res.end();
39 | });
40 | stream.on('readable', function() {
41 | stream.pipe(res);
42 | });
43 | });
44 |
45 | app.get("/token", function(req,res) {
46 | var ts = new Date().getTime();
47 | var rand = Math.floor(Math.random()*9999999);
48 | var secret = ts.toString() + rand.toString();
49 | res.send({secret: secret, socketId: createHash(secret)});
50 | });
51 |
52 | var createHash = function(secret) {
53 | var cipher = crypto.createCipher('blowfish', secret);
54 | return(cipher.final('hex'));
55 | };
56 |
57 | // Actually listen
58 | server.listen( opts.port || null );
59 |
60 | var brown = '\033[33m',
61 | green = '\033[32m',
62 | reset = '\033[0m';
63 |
64 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset );
--------------------------------------------------------------------------------
/reveal.js/plugin/multiplex/master.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | // Don't emit events from inside of notes windows
4 | if ( window.location.search.match( /receiver/gi ) ) { return; }
5 |
6 | var multiplex = Reveal.getConfig().multiplex;
7 |
8 | var socket = io.connect( multiplex.url );
9 |
10 | function post() {
11 |
12 | var messageData = {
13 | state: Reveal.getState(),
14 | secret: multiplex.secret,
15 | socketId: multiplex.id
16 | };
17 |
18 | socket.emit( 'multiplex-statechanged', messageData );
19 |
20 | };
21 |
22 | // post once the page is loaded, so the client follows also on "open URL".
23 | window.addEventListener( 'load', post );
24 |
25 | // Monitor events that trigger a change in state
26 | Reveal.addEventListener( 'slidechanged', post );
27 | Reveal.addEventListener( 'fragmentshown', post );
28 | Reveal.addEventListener( 'fragmenthidden', post );
29 | Reveal.addEventListener( 'overviewhidden', post );
30 | Reveal.addEventListener( 'overviewshown', post );
31 | Reveal.addEventListener( 'paused', post );
32 | Reveal.addEventListener( 'resumed', post );
33 |
34 | }());
35 |
--------------------------------------------------------------------------------
/reveal.js/plugin/multiplex/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal-js-multiplex",
3 | "version": "1.0.0",
4 | "description": "reveal.js multiplex server",
5 | "homepage": "http://revealjs.com",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "engines": {
10 | "node": "~4.1.1"
11 | },
12 | "dependencies": {
13 | "express": "~4.13.3",
14 | "grunt-cli": "~0.1.13",
15 | "mustache": "~2.2.1",
16 | "socket.io": "~1.3.7"
17 | },
18 | "license": "MIT"
19 | }
20 |
--------------------------------------------------------------------------------
/reveal.js/plugin/notes-server/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | // don't emit events from inside the previews themselves
4 | if( window.location.search.match( /receiver/gi ) ) { return; }
5 |
6 | var socket = io.connect( window.location.origin ),
7 | socketId = Math.random().toString().slice( 2 );
8 |
9 | console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId );
10 |
11 | window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId );
12 |
13 | /**
14 | * Posts the current slide data to the notes window
15 | */
16 | function post() {
17 |
18 | var slideElement = Reveal.getCurrentSlide(),
19 | notesElement = slideElement.querySelector( 'aside.notes' );
20 |
21 | var messageData = {
22 | notes: '',
23 | markdown: false,
24 | socketId: socketId,
25 | state: Reveal.getState()
26 | };
27 |
28 | // Look for notes defined in a slide attribute
29 | if( slideElement.hasAttribute( 'data-notes' ) ) {
30 | messageData.notes = slideElement.getAttribute( 'data-notes' );
31 | }
32 |
33 | // Look for notes defined in an aside element
34 | if( notesElement ) {
35 | messageData.notes = notesElement.innerHTML;
36 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
37 | }
38 |
39 | socket.emit( 'statechanged', messageData );
40 |
41 | }
42 |
43 | // When a new notes window connects, post our current state
44 | socket.on( 'new-subscriber', function( data ) {
45 | post();
46 | } );
47 |
48 | // When the state changes from inside of the speaker view
49 | socket.on( 'statechanged-speaker', function( data ) {
50 | Reveal.setState( data.state );
51 | } );
52 |
53 | // Monitor events that trigger a change in state
54 | Reveal.addEventListener( 'slidechanged', post );
55 | Reveal.addEventListener( 'fragmentshown', post );
56 | Reveal.addEventListener( 'fragmenthidden', post );
57 | Reveal.addEventListener( 'overviewhidden', post );
58 | Reveal.addEventListener( 'overviewshown', post );
59 | Reveal.addEventListener( 'paused', post );
60 | Reveal.addEventListener( 'resumed', post );
61 |
62 | // Post the initial state
63 | post();
64 |
65 | }());
66 |
--------------------------------------------------------------------------------
/reveal.js/plugin/notes-server/index.js:
--------------------------------------------------------------------------------
1 | var http = require('http');
2 | var express = require('express');
3 | var fs = require('fs');
4 | var io = require('socket.io');
5 | var Mustache = require('mustache');
6 |
7 | var app = express();
8 | var staticDir = express.static;
9 | var server = http.createServer(app);
10 |
11 | io = io(server);
12 |
13 | var opts = {
14 | port : 1947,
15 | baseDir : __dirname + '/../../'
16 | };
17 |
18 | io.on( 'connection', function( socket ) {
19 |
20 | socket.on( 'new-subscriber', function( data ) {
21 | socket.broadcast.emit( 'new-subscriber', data );
22 | });
23 |
24 | socket.on( 'statechanged', function( data ) {
25 | delete data.state.overview;
26 | socket.broadcast.emit( 'statechanged', data );
27 | });
28 |
29 | socket.on( 'statechanged-speaker', function( data ) {
30 | delete data.state.overview;
31 | socket.broadcast.emit( 'statechanged-speaker', data );
32 | });
33 |
34 | });
35 |
36 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) {
37 | app.use( '/' + dir, staticDir( opts.baseDir + dir ) );
38 | });
39 |
40 | app.get('/', function( req, res ) {
41 |
42 | res.writeHead( 200, { 'Content-Type': 'text/html' } );
43 | fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res );
44 |
45 | });
46 |
47 | app.get( '/notes/:socketId', function( req, res ) {
48 |
49 | fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) {
50 | res.send( Mustache.to_html( data.toString(), {
51 | socketId : req.params.socketId
52 | }));
53 | });
54 |
55 | });
56 |
57 | // Actually listen
58 | server.listen( opts.port || null );
59 |
60 | var brown = '\033[33m',
61 | green = '\033[32m',
62 | reset = '\033[0m';
63 |
64 | var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' );
65 |
66 | console.log( brown + 'reveal.js - Speaker Notes' + reset );
67 | console.log( '1. Open the slides at ' + green + slidesLocation + reset );
68 | console.log( '2. Click on the link in your JS console to go to the notes page' );
69 | console.log( '3. Advance through your slides and your notes will advance automatically' );
70 |
--------------------------------------------------------------------------------
/reveal.js/plugin/print-pdf/print-pdf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * phantomjs script for printing presentations to PDF.
3 | *
4 | * Example:
5 | * phantomjs print-pdf.js "http://revealjs.com?print-pdf" reveal-demo.pdf
6 | *
7 | * @author Manuel Bieh (https://github.com/manuelbieh)
8 | * @author Hakim El Hattab (https://github.com/hakimel)
9 | * @author Manuel Riezebosch (https://github.com/riezebosch)
10 | */
11 |
12 | // html2pdf.js
13 | var system = require( 'system' );
14 |
15 | var probePage = new WebPage();
16 | var printPage = new WebPage();
17 |
18 | var inputFile = system.args[1] || 'index.html?print-pdf';
19 | var outputFile = system.args[2] || 'slides.pdf';
20 |
21 | if( outputFile.match( /\.pdf$/gi ) === null ) {
22 | outputFile += '.pdf';
23 | }
24 |
25 | console.log( 'Export PDF: Reading reveal.js config [1/4]' );
26 |
27 | probePage.open( inputFile, function( status ) {
28 |
29 | console.log( 'Export PDF: Preparing print layout [2/4]' );
30 |
31 | var config = probePage.evaluate( function() {
32 | return Reveal.getConfig();
33 | } );
34 |
35 | if( config ) {
36 |
37 | printPage.paperSize = {
38 | width: Math.floor( config.width * ( 1 + config.margin ) ),
39 | height: Math.floor( config.height * ( 1 + config.margin ) ),
40 | border: 0
41 | };
42 |
43 | printPage.open( inputFile, function( status ) {
44 | console.log( 'Export PDF: Preparing pdf [3/4]')
45 | printPage.evaluate( function() {
46 | Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom );
47 | } );
48 | } );
49 |
50 | printPage.onCallback = function( data ) {
51 | // For some reason we need to "jump the queue" for syntax highlighting to work.
52 | // See: http://stackoverflow.com/a/3580132/129269
53 | setTimeout( function() {
54 | console.log( 'Export PDF: Writing file [4/4]' );
55 | printPage.render( outputFile );
56 | console.log( 'Export PDF: Finished successfully!' );
57 | phantom.exit();
58 | }, 0 );
59 | };
60 | }
61 | else {
62 |
63 | console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
64 | phantom.exit( 1 );
65 |
66 | }
67 | } );
68 |
--------------------------------------------------------------------------------
/reveal.js/test/assets/external-script-a.js:
--------------------------------------------------------------------------------
1 | window.externalScriptSequence += 'A';
--------------------------------------------------------------------------------
/reveal.js/test/assets/external-script-b.js:
--------------------------------------------------------------------------------
1 | window.externalScriptSequence += 'B';
--------------------------------------------------------------------------------
/reveal.js/test/assets/external-script-c.js:
--------------------------------------------------------------------------------
1 | window.externalScriptSequence += 'C';
--------------------------------------------------------------------------------
/reveal.js/test/assets/external-script-d.js:
--------------------------------------------------------------------------------
1 | window.externalScriptSequence += 'D';
--------------------------------------------------------------------------------
/reveal.js/test/examples/assets/beeping.txt:
--------------------------------------------------------------------------------
1 | Source: https://freesound.org/people/fennelliott/sounds/379419/
2 | License: CC0 (public domain)
--------------------------------------------------------------------------------
/reveal.js/test/examples/assets/beeping.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/test/examples/assets/beeping.wav
--------------------------------------------------------------------------------
/reveal.js/test/examples/assets/image1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/test/examples/assets/image1.png
--------------------------------------------------------------------------------
/reveal.js/test/examples/assets/image2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/reveal.js/test/examples/assets/image2.png
--------------------------------------------------------------------------------
/reveal.js/test/examples/barebones.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Barebones
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | Barebones Presentation
20 | This example contains the bare minimum includes and markup required to run a reveal.js presentation.
21 |
22 |
23 |
24 | No Theme
25 | There's no theme included, so it will fall back on browser defaults.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/reveal.js/test/examples/embedded-media.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Embedded Media
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Embedded Media Test
23 |
24 |
25 |
28 |
29 |
32 |
33 |
34 | Auto-playing audio
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/reveal.js/test/examples/slide-transitions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Slide Transitions
8 |
9 |
10 |
11 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
36 |
37 |
38 | data-transition: zoom
39 |
40 |
41 |
42 | data-transition: zoom-in fade-out
43 |
44 |
45 |
48 |
49 |
50 | data-transition: convex
51 |
52 |
53 |
54 | data-transition: convex-in concave-out
55 |
56 |
57 |
58 |
61 |
62 | data-transition: concave
63 |
64 |
65 | data-transition: convex-in fade-out
66 |
67 |
70 |
71 |
72 |
73 | data-transition: none
74 |
75 |
76 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/reveal.js/test/simple.md:
--------------------------------------------------------------------------------
1 | ## Slide 1.1
2 |
3 | ```js
4 | var a = 1;
5 | ```
6 |
7 |
8 | ## Slide 1.2
9 |
10 |
11 |
12 | ## Slide 2
13 |
--------------------------------------------------------------------------------
/reveal.js/test/test-dependencies-async.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Async Dependencies
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/reveal.js/test/test-dependencies.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Dependencies
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/reveal.js/test/test-grid-navigation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Grid
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/reveal.js/test/test-iframe-backgrounds.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Iframe Backgrounds
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 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/reveal.js/test/test-iframes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Iframes
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-element-attributes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown Element Attributes
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
73 |
74 |
75 |
76 |
90 |
91 |
98 |
99 |
108 |
109 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-element-attributes.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' );
7 | });
8 |
9 | QUnit.test( 'Attributes on element header in vertical slides', function( assert ) {
10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' );
11 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' );
12 | });
13 |
14 | QUnit.test( 'Attributes on element paragraphs in vertical slides', function( assert ) {
15 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' );
16 | });
17 |
18 | QUnit.test( 'Attributes on element list items in vertical slides', function( assert ) {
19 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.grow' ).length, 3, 'found a vertical slide with three list items with class fragment.grow' );
20 | });
21 |
22 | QUnit.test( 'Attributes on element paragraphs in horizontal slides', function( assert ) {
23 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' );
24 | });
25 |
26 | QUnit.test( 'Attributes on element list items in horizontal slides', function( assert ) {
27 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' );
28 | });
29 |
30 | QUnit.test( 'Attributes on element image in horizontal slides', function( assert ) {
31 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' );
32 | });
33 |
34 | QUnit.test( 'Attributes on elements in vertical slides with default element attribute separator', function( assert ) {
35 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' );
36 | });
37 |
38 | QUnit.test( 'Attributes on elements in single slides with default element attribute separator', function( assert ) {
39 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' );
40 | });
41 |
42 | } );
43 |
44 | Reveal.initialize();
45 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-external.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown
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 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-external.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
7 | });
8 |
9 | QUnit.test( 'Horizontal separator', function( assert ) {
10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section' ).length, 2, 'found two slides' );
11 | });
12 |
13 | QUnit.test( 'Language highlighter', function( assert ) {
14 | assert.strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' );
15 | assert.strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' );
16 | });
17 |
18 | } );
19 |
20 | Reveal.initialize();
21 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-options.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown Options
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-options.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Options are set', function( assert ) {
6 | assert.strictEqual( marked.defaults.smartypants, true );
7 | });
8 |
9 | QUnit.test( 'Smart quotes are activated', function( assert ) {
10 | var text = document.querySelector( '.reveal .slides>section>p' ).textContent;
11 |
12 | assert.strictEqual( /['"]/.test( text ), false );
13 | assert.strictEqual( /[“”‘’]/.test( text ), true );
14 | });
15 |
16 | } );
17 |
18 | Reveal.initialize({
19 | dependencies: [
20 | { src: '../plugin/markdown/marked.js' },
21 | // Test loading JS files with query strings
22 | { src: '../plugin/markdown/markdown.js?query=string' },
23 | ],
24 | markdown: {
25 | smartypants: true
26 | }
27 | });
28 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-slide-attributes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown Attributes
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
57 |
58 |
89 |
90 |
96 |
97 |
103 |
104 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown-slide-attributes.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' );
7 | });
8 |
9 | QUnit.test( 'Id on slide', function( assert ) {
10 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' );
11 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' );
12 | });
13 |
14 | QUnit.test( 'data-background attributes', function( assert ) {
15 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
16 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
17 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
18 | });
19 |
20 | QUnit.test( 'data-transition attributes', function( assert ) {
21 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
22 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
23 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
24 | });
25 |
26 | QUnit.test( 'data-background attributes with default separator', function( assert ) {
27 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
28 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
29 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
30 | });
31 |
32 | QUnit.test( 'data-transition attributes with default separator', function( assert ) {
33 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
34 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
35 | assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' );
36 | });
37 |
38 | QUnit.test( 'data-transition attributes with inline content', function( assert ) {
39 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' );
40 | });
41 |
42 | } );
43 |
44 | Reveal.initialize();
45 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/reveal.js/test/test-markdown.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | QUnit.module( 'Markdown' );
4 |
5 | QUnit.test( 'Vertical separator', function( assert ) {
6 | assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
7 | });
8 |
9 | } );
10 |
11 | Reveal.initialize();
12 |
--------------------------------------------------------------------------------
/reveal.js/test/test-pdf.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test PDF exports
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 1
25 |
26 |
27 |
28 |
39 |
40 |
41 |
42 | 3.1
43 |
44 | - 4.1
45 | - 4.2
46 | - 4.3
47 |
48 |
49 |
50 |
57 |
58 |
59 | 3.3
60 |
61 | - 3.3.1
62 | - 3.3.2
63 | - 3.3.3
64 |
65 |
66 |
67 |
68 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/reveal.js/test/test-pdf.js:
--------------------------------------------------------------------------------
1 | Reveal.addEventListener( 'ready', function() {
2 |
3 | // Only one test for now, we're mainly ensuring that there
4 | // are no execution errors when running PDF mode
5 |
6 | QUnit.test( 'Reveal.isReady', function( assert ) {
7 | assert.strictEqual( Reveal.isReady(), true, 'returns true' );
8 | });
9 |
10 | } );
11 |
12 | Reveal.initialize({ pdf: true });
13 |
--------------------------------------------------------------------------------
/reveal.js/test/test-plugins.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Plugins
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/reveal.js/test/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Tests
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 1
24 |
25 |
26 |
27 |
28 |
29 |
30 |
41 |
42 |
43 |
44 | 3.1
45 |
46 | - 4.1
47 | - 4.2
48 | - 4.3
49 |
50 |
51 |
52 |
60 |
61 |
62 | 3.3
63 |
64 | - 3.3.1
65 | - 3.3.2
66 | - 3.3.3
67 |
68 |
69 |
70 |
71 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/rulPred/BatteryRULTestData.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/BatteryRULTestData.PNG
--------------------------------------------------------------------------------
/rulPred/HIFused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/HIFused.png
--------------------------------------------------------------------------------
/rulPred/HIPlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/HIPlot.png
--------------------------------------------------------------------------------
/rulPred/HIValidationData.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/HIValidationData.png
--------------------------------------------------------------------------------
/rulPred/HIVisualization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/HIVisualization.png
--------------------------------------------------------------------------------
/rulPred/KMeansPerformance.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/KMeansPerformance.PNG
--------------------------------------------------------------------------------
/rulPred/KNNPlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/KNNPlot.png
--------------------------------------------------------------------------------
/rulPred/KNNPlot70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/KNNPlot70.png
--------------------------------------------------------------------------------
/rulPred/KNNPlot90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/KNNPlot90.png
--------------------------------------------------------------------------------
/rulPred/PCADistribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/PCADistribution.png
--------------------------------------------------------------------------------
/rulPred/PHMdata.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/PHMdata.PNG
--------------------------------------------------------------------------------
/rulPred/PlotEnsemblerMember.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/PlotEnsemblerMember.png
--------------------------------------------------------------------------------
/rulPred/RULDistribution50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RULDistribution50.png
--------------------------------------------------------------------------------
/rulPred/RULDistribution70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RULDistribution70.png
--------------------------------------------------------------------------------
/rulPred/RULDistribution90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RULDistribution90.png
--------------------------------------------------------------------------------
/rulPred/RULPred.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RULPred.png
--------------------------------------------------------------------------------
/rulPred/RegimePlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RegimePlot.png
--------------------------------------------------------------------------------
/rulPred/RegimePlotWithCluster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/RegimePlotWithCluster.png
--------------------------------------------------------------------------------
/rulPred/SurvialFunction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/SurvialFunction.png
--------------------------------------------------------------------------------
/rulPred/WindTurbineHighSpeedBearingPrognosisExample_08.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/WindTurbineHighSpeedBearingPrognosisExample_08.gif
--------------------------------------------------------------------------------
/rulPred/alphaLambdaPlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/alphaLambdaPlot.png
--------------------------------------------------------------------------------
/rulPred/bearingTallData.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/bearingTallData.PNG
--------------------------------------------------------------------------------
/rulPred/biasValue.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/biasValue.PNG
--------------------------------------------------------------------------------
/rulPred/degradationDataDemo.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/degradationDataDemo.PNG
--------------------------------------------------------------------------------
/rulPred/degradationSensorFusion.m:
--------------------------------------------------------------------------------
1 | function dataFused = degradationSensorFusion(data, sensorToFuse, weights)
2 | % Combine measurements from different sensors according
3 | % to the weights, smooth the fused data and offset the data
4 | % so that all the data start from 1
5 |
6 | % Fuse the data according to weights
7 | dataToFuse = data{:, cellstr(sensorToFuse)};
8 | dataFusedRaw = dataToFuse*weights;
9 |
10 | % Smooth the fused data with moving mean
11 | stepBackward = 10;
12 | stepForward = 10;
13 | dataFused = movmean(dataFusedRaw, [stepBackward stepForward]);
14 |
15 | % Offset the data to 1
16 | dataFused = dataFused + 1 - dataFused(1);
17 | end
--------------------------------------------------------------------------------
/rulPred/errorMean.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/errorMean.PNG
--------------------------------------------------------------------------------
/rulPred/errorMedian.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/errorMedian.PNG
--------------------------------------------------------------------------------
/rulPred/errorOverview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/errorOverview.png
--------------------------------------------------------------------------------
/rulPred/errorSD.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/errorSD.PNG
--------------------------------------------------------------------------------
/rulPred/featureExtractionProcess.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/featureExtractionProcess.PNG
--------------------------------------------------------------------------------
/rulPred/featureRanking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/featureRanking.png
--------------------------------------------------------------------------------
/rulPred/featureSmooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/featureSmooth.png
--------------------------------------------------------------------------------
/rulPred/featureTimeTable.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/featureTimeTable.PNG
--------------------------------------------------------------------------------
/rulPred/helperAlphaLambdaPlot.m:
--------------------------------------------------------------------------------
1 | function alphaBoundProbablity = helperAlphaLambdaPlot(alpha, trueRULHist, estRULHist, ...
2 | CIRULHist, pdfRULHist, degradationTime, breakpoint, timeUnit)
3 | %HELPERALPHALAMBDAPLOT create alpha-lambda plot and the probability metric
4 |
5 | % Copyright 2018 The MathWorks, Inc.
6 |
7 | N = length(trueRULHist);
8 | t = 1:N;
9 | t2 = t((degradationTime+1):end);
10 |
11 | % Compute the alpha bounds
12 | alphaPlus = trueRULHist + alpha*trueRULHist;
13 | alphaMinus = trueRULHist - alpha*trueRULHist;
14 |
15 | % ---------------- Alpha-Lambda Plot --------------------
16 | figure
17 | hold on
18 | grid on
19 |
20 | % Plot true RUL and its alpha bounds
21 | plot(t, trueRULHist)
22 | fill([t fliplr(t)], [alphaPlus(t)' fliplr(alphaMinus(t)')], ...
23 | 'b', 'FaceAlpha', 0.2, 'EdgeColor', 'none')
24 |
25 | % Plot the estimated RUL and its confidence intervals
26 | plot(t2, estRULHist(t2), '--')
27 | fill([t2 fliplr(t2)], ...
28 | [CIRULHist(t2, 1)' fliplr(CIRULHist(t2, 2)')], ...
29 | 'r', 'FaceAlpha', 0.2, 'EdgeColor', 'none')
30 |
31 | % Plot the train-test breakpoint
32 | ylow = 0;
33 | yup = 80;
34 | plot([breakpoint breakpoint], [ylow yup], 'k-.')
35 |
36 | % Add labels and legends
37 | ylim([ylow yup])
38 | hold off
39 | xlabel(['Time (' timeUnit ')'])
40 | ylabel(['RUL (' timeUnit ')'])
41 | legend('True RUL', ['\alpha = +\\-' num2str(alpha*100) '%'], ...
42 | 'Predicted RUL After Degradation Detected', ...
43 | 'Confidence Interval After Degradation Detected', 'Train-Test Breakpoint')
44 |
45 | % ---------------- Probability Metric --------------------
46 | % Compute the probability of predicted RUL within alpha bounds
47 | alphaBoundProbablity = zeros(N, 1);
48 | for i = 1:N
49 | pdfRUL = pdfRULHist{i};
50 | idx = (pdfRUL{:, 1} > alphaMinus(i)) & (pdfRUL{:, 1} < alphaPlus(i));
51 | prob = sum(pdfRUL{idx, 2});
52 | alphaBoundProbablity(i) = prob;
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/rulPred/helperLoadData.m:
--------------------------------------------------------------------------------
1 | function degradationData = helperLoadData(filename)
2 | % Load degradation data from text file and convert to cell array of tables.
3 | %
4 | % This function supports the Similarity-based Remaining Useful Life
5 | % Estimation example. It may change in a future release.
6 |
7 | % Copyright 2017-2018 The MathWorks, Inc.
8 |
9 | % Load the text file as a table
10 | t = readtable(filename);
11 | t(:,end) = []; %Discard last column of loaded data as all are empty ''
12 |
13 | % Add variable names to the table
14 | VarNames = {...
15 | 'id', 'time', 'op_setting_1', 'op_setting_2', 'op_setting_3', ...
16 | 'sensor_1', 'sensor_2', 'sensor_3', 'sensor_4', 'sensor_5', ...
17 | 'sensor_6', 'sensor_7', 'sensor_8', 'sensor_9', 'sensor_10', ...
18 | 'sensor_11', 'sensor_12', 'sensor_13', 'sensor_14', 'sensor_15', ...
19 | 'sensor_16', 'sensor_17', 'sensor_18', 'sensor_19', 'sensor_20', ...
20 | 'sensor_21'};
21 | t.Properties.VariableNames = VarNames;
22 |
23 | % Split the signals from each machine ID into individual tables
24 | % and collect the tables in a cell array.
25 | IDs = t{:,1};
26 | nID = unique(IDs);
27 | degradationData = cell(numel(nID),1);
28 | for ct=1:numel(nID)
29 | idx = IDs == nID(ct);
30 | degradationData{ct} = t(idx,:);
31 | end
32 | end
--------------------------------------------------------------------------------
/rulPred/helperPlotClusters.m:
--------------------------------------------------------------------------------
1 | function helperPlotClusters(X, idx, C)
2 | % HELPERPLOTCLUSTER Helper function for cluster plotting
3 | %
4 | % This function supports the Similarity-based Remaining Useful Life
5 | % Estimation example. It may change in a future release.
6 |
7 | % Copyright 2017-2018 The MathWorks, Inc.
8 |
9 | if(nargin>1)
10 | hold on
11 | for i = 1:max(idx)
12 | scatter3(X{idx==i,1}, X{idx==i,2}, X{idx==i,3});
13 | end
14 | scatter3(C(:,1),C(:,2),C(:,3), 'x', 'MarkerFaceColor', [0 0 0], ...
15 | 'MarkerEdgeColor', [0 0 0], 'LineWidth', 2);
16 | legendStr = ["Cluster "+(1:6), "Centroids"];
17 | legend(cellstr(legendStr), 'Location', 'NW');
18 | hold off
19 | view(-30,30)
20 | grid on
21 | else
22 | scatter3(X{:,1}, X{:,2}, X{:,3});
23 | end
24 | xlabel(X.Properties.VariableNames{1}, 'Interpreter', 'none')
25 | ylabel(X.Properties.VariableNames{2}, 'Interpreter', 'none')
26 | zlabel(X.Properties.VariableNames{3}, 'Interpreter', 'none')
27 | end
--------------------------------------------------------------------------------
/rulPred/helperPlotEnsemble.m:
--------------------------------------------------------------------------------
1 | function helperPlotEnsemble(ensemble, TimeVariable, DataVariables, nsample, varargin)
2 | % HELPERPLOTENSEMBLE Helper function to plot ensemble data
3 | %
4 | % This function supports the Similarity-based Remaining Useful Life
5 | % Estimation example. It may change in a future release.
6 |
7 | % Copyright 2017-2018 The MathWorks, Inc.
8 |
9 | % Ensemble is a cell array of matrices/timetables/tables
10 | randIdx = randperm(length(ensemble));
11 | ensembleSample = ensemble(randIdx(1:nsample));
12 | numData = length(DataVariables);
13 | for i = 1:numData
14 | data2plot = DataVariables(i);
15 | subplot(numData, 1, i)
16 | hold on
17 | for j = 1:length(ensembleSample)
18 | ensembleMember = ensembleSample{j};
19 | if isa(ensembleMember, 'double')
20 | % TimeVariable and DataVariables are doubles
21 | if isempty(TimeVariable)
22 | plot(ensembleMember(:, DataVariables), varargin{:})
23 | else
24 | plot(ensembleMember(:, TimeVariable), ensembleMember(:, DataVariables), varargin{:})
25 | end
26 | xlblstr = "time";
27 | ylblstr = "Var " + data2plot;
28 | else
29 | % ensembleMember is a table
30 | plot(ensembleMember.(char(TimeVariable)), ensembleMember.(char(data2plot)), varargin{:})
31 | xlblstr = TimeVariable;
32 | ylblstr = data2plot;
33 | end
34 | end
35 | hold off
36 | ylabel(ylblstr, 'Interpreter', 'none')
37 | end
38 | xlabel(xlblstr)
39 | end
--------------------------------------------------------------------------------
/rulPred/helperPlotRUL.m:
--------------------------------------------------------------------------------
1 | function helperPlotRUL(ax, trueRUL, estRUL, CIRUL, pdfRUL, timeUnit)
2 | %HELPERPLOTRULDISTRIBUTION helper function to refresh the distribution plot
3 |
4 | % Copyright 2018 The MathWorks, Inc.
5 | cla(ax)
6 | hold(ax, 'on')
7 | plot(ax, pdfRUL{:,1}, pdfRUL{:,2})
8 | plot(ax, [estRUL estRUL], [0 pdfRUL{find(pdfRUL{:,1} >= estRUL, 1), 2}])
9 | plot(ax, [trueRUL trueRUL], [0 pdfRUL{find(pdfRUL{:,1} >= trueRUL, 1), 2}], '--')
10 | idx = pdfRUL{:,1} >= CIRUL(1) & pdfRUL{:,1}<=CIRUL(2);
11 | area(ax, pdfRUL{idx, 1}, pdfRUL{idx, 2}, ...
12 | 'FaceAlpha', 0.2, 'FaceColor', 'g', 'EdgeColor', 'none');
13 | hold(ax, 'off')
14 | ylabel(ax, 'PDF')
15 | xlabel(ax, ['Time (' timeUnit ')'])
16 | legend(ax, 'pdf of RUL', 'Estimated RUL', 'True RUL', 'Confidence Interval')
--------------------------------------------------------------------------------
/rulPred/helperPlotRULDistribution.m:
--------------------------------------------------------------------------------
1 | function helperPlotRULDistribution(trueRUL, estRUL, pdfRUL, ciRUL)
2 | % HELPERPLOTRULDISTRIBUTION Plot RUL distribution
3 | %
4 | % This function supports the Similarity-based Remaining Useful Life
5 | % Estimation example. It may change in a future release.
6 |
7 | % Copyright 2017-2018 The MathWorks, Inc.
8 |
9 | hold on
10 | plot(pdfRUL.RUL, pdfRUL.ProbabilityDensity, 'b');
11 | idx = find(pdfRUL.RUL > trueRUL, 1, 'first');
12 | if isempty(idx)
13 | y = pdfRUL.ProbabilityDensity(end);
14 | else
15 | y = pdfRUL.ProbabilityDensity(idx);
16 | end
17 | plot([trueRUL, trueRUL], [0, y], 'r');
18 | idx = find(pdfRUL.RUL > estRUL, 1, 'first');
19 | if isempty(idx)
20 | y = pdfRUL.ProbabilityDensity(end);
21 | else
22 | y = pdfRUL.ProbabilityDensity(idx);
23 | end
24 | plot([estRUL, estRUL], [0, y], 'g');
25 | idx = pdfRUL.RUL >= ciRUL(1) & pdfRUL.RUL<=ciRUL(2);
26 | area(pdfRUL.RUL(idx), pdfRUL.ProbabilityDensity(idx), ...
27 | 'FaceAlpha', 0.2, 'FaceColor', 'y', 'EdgeColor', 'none');
28 | hold off
29 | legend('Probability Density Function', 'True RUL', 'Estimated RUL', '90% Confidence Inteval');
30 | xlabel('Cycle')
31 | ylabel('Probability Density')
32 | title('RUL Estimation')
33 | end
34 |
--------------------------------------------------------------------------------
/rulPred/helperPlotTrend.m:
--------------------------------------------------------------------------------
1 | function helperPlotTrend(ax, currentDay, healthIndicator, mdl, threshold, timeUnit)
2 | %HELPERPLOTTREND helper function to refresh the trending plot
3 |
4 | % Copyright 2018 The MathWorks, Inc.
5 | t = 1:size(healthIndicator, 1);
6 | HIpred = mdl.Phi + mdl.Theta*exp(mdl.Beta*(t - mdl.InitialLifeTimeValue));
7 | HIpredCI1 = mdl.Phi + ...
8 | (mdl.Theta - sqrt(mdl.ThetaVariance)) * ...
9 | exp((mdl.Beta - sqrt(mdl.BetaVariance))*(t - mdl.InitialLifeTimeValue));
10 | HIpredCI2 = mdl.Phi + ...
11 | (mdl.Theta + sqrt(mdl.ThetaVariance)) * ...
12 | exp((mdl.Beta + sqrt(mdl.BetaVariance))*(t - mdl.InitialLifeTimeValue));
13 |
14 | cla(ax)
15 | hold(ax, 'on')
16 | plot(ax, t, HIpred)
17 | plot(ax, [t NaN t], [HIpredCI1 NaN, HIpredCI2], '--')
18 | plot(ax, t(1:currentDay), healthIndicator(1:currentDay, :))
19 | plot(ax, t, threshold*ones(1, length(t)), 'r')
20 | hold(ax, 'off')
21 | if ~isempty(mdl.SlopeDetectionInstant)
22 | title(ax, sprintf('Day %d: Degradation detected!\n', currentDay))
23 | else
24 | title(ax, sprintf('Day %d: Degradation NOT detected.\n', currentDay))
25 | end
26 | ylabel(ax, 'Health Indicator')
27 | xlabel(ax, ['Time (' timeUnit ')'])
28 | legend(ax, 'Degradation Model', 'Confidence Interval', ...
29 | 'Health Indicator', 'Threshold', 'Location', 'Northwest')
30 | end
--------------------------------------------------------------------------------
/rulPred/helperReadData.m:
--------------------------------------------------------------------------------
1 | function data = helperReadData(filename, variables)
2 | % Read data variables for the fileEnsemble
3 | %
4 | % Inputs:
5 | % filename - a string of the file name to read from.
6 | % variables - a string array containing variable names to read.
7 | % It must be a subset of DataVariables specified
8 | % in fileEnsembleDatastore.
9 | % Output:
10 | % data - return a table with a single row
11 |
12 | % Copyright 2017-2018 The MathWorks, Inc.
13 |
14 | data = table;
15 | mfile = matfile(filename); % Allows partial loading
16 | for ct = 1:numel(variables)
17 | if strcmp(variables{ct}, "Date")
18 | % Extract the datetime information from the file names
19 | % as the independent variable of the ensemble datastore
20 | [~, fname] = fileparts(filename);
21 | token = regexp(fname, 'data-(\w+)', 'tokens');
22 | data.Date = datetime(token{1}{1}, 'InputFormat', 'yyyyMMdd''T''HHmmss''Z''');
23 | else
24 | val = mfile.(variables{ct});
25 | % Convert non-scalar values into a single cell
26 | if numel(val) > 1
27 | val = {val};
28 | end
29 | data.(variables{ct}) = val;
30 | end
31 | end
32 | end
--------------------------------------------------------------------------------
/rulPred/helperSortedBarPlot.m:
--------------------------------------------------------------------------------
1 | function sortedIdx = helperSortedBarPlot(tbl, ylbl)
2 | % HELPERSORTEDBARPLOT helper function to create sorted bar plot
3 |
4 | % Copyright 2018 The MathWorks, Inc.
5 | [~, sortedIdx] = sort(tbl{1,:}, 'descend');
6 | tblSorted = tbl(:, sortedIdx);
7 | figure
8 | bar(tblSorted{1,:})
9 | xticks(1:size(tblSorted,2))
10 | xticklabels(tbl.Properties.VariableNames(sortedIdx))
11 | xtickangle(45)
12 | ylabel(ylbl)
13 | end
--------------------------------------------------------------------------------
/rulPred/helperWriteToHSBearing.m:
--------------------------------------------------------------------------------
1 | function helperWriteToHSBearing(filename, data)
2 | % Write data to the fileEnsemble
3 | % Inputs:
4 | % filename - a string of the file name to write to.
5 | % data - a structure
6 | save(filename, '-append', '-struct', 'data');
7 | end
--------------------------------------------------------------------------------
/rulPred/predictionErrorBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/predictionErrorBox.png
--------------------------------------------------------------------------------
/rulPred/predictionRULErrorDistribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/predictionRULErrorDistribution.png
--------------------------------------------------------------------------------
/rulPred/probabilityPredRULWithinAlphaBound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/probabilityPredRULWithinAlphaBound.png
--------------------------------------------------------------------------------
/rulPred/regimeNormalization.m:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/regimeNormalization.m
--------------------------------------------------------------------------------
/rulPred/selectedFeatures.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/selectedFeatures.PNG
--------------------------------------------------------------------------------
/rulPred/selectedSensors.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/selectedSensors.PNG
--------------------------------------------------------------------------------
/rulPred/sensorMean.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/sensorMean.PNG
--------------------------------------------------------------------------------
/rulPred/sensorSD.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/sensorSD.PNG
--------------------------------------------------------------------------------
/rulPred/trendPlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/trendPlot.png
--------------------------------------------------------------------------------
/rulPred/trendedSensorsPlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/trendedSensorsPlot.png
--------------------------------------------------------------------------------
/rulPred/vibrationVisualization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/vibrationVisualization.png
--------------------------------------------------------------------------------
/rulPred/vibratonSpecKurtosis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/vibratonSpecKurtosis.png
--------------------------------------------------------------------------------
/rulPred/weights.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/weights.PNG
--------------------------------------------------------------------------------
/rulPred/捕获.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/michael-gan/MatlabPred/a5dbc2dd52072b919cd7c11c18008f57cf5c6ab2/rulPred/捕获.PNG
--------------------------------------------------------------------------------