├── .gitignore ├── LICENSE ├── README.md ├── serial-plot-chartjs ├── client.html ├── dist │ ├── renderer_packed.js │ └── renderer_packed.js.map ├── package-lock.json ├── package.json ├── renderer.js ├── screenshot_chartjs.png └── webpack.config.js ├── serial-plot-client ├── README.md ├── client.html └── client.js ├── serial-plot-epoch ├── client.html ├── dist │ ├── css │ │ └── epoch.min.css │ ├── renderer_packed.js │ └── renderer_packed.js.map ├── package-lock.json ├── package.json ├── renderer.js ├── screenshot_epoch.png └── webpack.config.js ├── serial-plot-server ├── .gitignore ├── README.md ├── package-lock.json ├── package.json └── server.js └── serial-plot-smoothie ├── client.html ├── cover.png ├── dist ├── renderer_packed.js └── renderer_packed.js.map ├── package-lock.json ├── package.json ├── renderer.js ├── screenshot_smoothie.png └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | 63 | # macOS-specific 64 | .DS_Store 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Serial-plot-web 2 |  3 | 4 | 5 | ## Architecture 6 | Project consists of 3 parts: 7 | 8 | - server (`serial-plot-server`) 9 | - responsible for the serial port communication (npm' `serialport` package) 10 | - WebSocket server to deliver serial port data (npm' `ws`) 11 | - Web Server for clients to connect (`express`) 12 | 13 | - client (`serial-plot-client`) 14 | - WebSocket to receive data from the server (native JS support) 15 | - parsing of this data (such behavior can be modified to delegate this task to the server) 16 | - function to be repeat for redrawing 17 | - (optional) simple benchmark to measure a number of points in 1 second 18 | 19 | - one of renderers (Epoch, Smoothie or Chart.js at the moment) 20 | - serve package-specific stuff 21 | 22 | 23 | ## Serial communication 24 | Un-encoded simple integer binary data is assumed. You should transmit numbers in series according to number of channels (2 in this demo). Some out-of-sync situations can be meet though but it's possible to implement some sort of synchronization mechanism. And generally it should not be hard to set the app "on another rails" in terms of data format. 25 | 26 | 27 | ## Installation and configuration 28 | To install modules go to each subdirectory (exclude `serial-plot-client`) and run `npm install` to install necessary dependencies. For front-ends you additionally needs to run `webpack` to collect plotting packages. 29 | 30 | 31 | ## Quick-start usage 32 | Firstly connect your serial device. Run the server: `node serial-plot-server/server.js` (see [README.md](/serial-plot-server/README.md)). Start a browser and go to http://localhost:3000/serial-plot-client/client.html. Then open DevTools and in a console you will see serial port messages. Similarly you can run any of available graphic front-ends. 33 | 34 | 35 | ## Some notes about plotting packages 36 | 3 packages had been tested as a plotting tool and every has its own peculiarities. Some performance measures can be find in correspond directories – screenshots from Chrome' built-in profiler. 37 | 38 | The best in both performance and visual appearance is Smoothie. It's fast, simple, can be easily integrated and has nice skin by default. Epoch is opposite: slow and requires additional files to be included. Chart.js is somewhere in the middle. 39 | 40 | There are also another known charting and plotting libraries but they were not been applied to this project yet. Highcharts and CanvasJS are the most likely candidates for this position. 41 | 42 | 43 | ## TODOs 44 | - [ ] dedicated 'public' directory (with allowed for clients content) 45 | - [ ] demo mode (simulate the serial connection when it is not present) 46 | - [ ] grid of plots MxN (CSS or something else) 47 | - [ ] do not include 'dist' to repository (generate 'dist' directory on every new set-up) 48 | - [ ] play/pause (basic control elements) 49 | - [ ] additional front-ends (Highcharts, CanvasJS, ...) 50 | -------------------------------------------------------------------------------- /serial-plot-chartjs/client.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |2-channel serial plot
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /serial-plot-chartjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serial-plot-chartjs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "chart.js": "^2.7.3" 14 | }, 15 | "devDependencies": { 16 | "webpack": "^4.21.0", 17 | "webpack-cli": "^3.1.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /serial-plot-chartjs/renderer.js: -------------------------------------------------------------------------------- 1 | import Chart from 'chart.js'; 2 | 3 | function addPoint(chart, label, data) { 4 | chart.data.labels.push(label); 5 | chart.data.datasets.forEach((dataset) => { 6 | dataset.data.push(data); 7 | }); 8 | } 9 | 10 | function removePoint(chart) { 11 | chart.data.labels.shift(); 12 | chart.data.datasets.forEach((dataset) => { 13 | dataset.data.shift(); 14 | }); 15 | } 16 | 17 | const numPoints = 150; // length of the visible plot 18 | var pointsCnt = 0; // count up to 'numPoints' 19 | 20 | const charts = new Array(numPlots); 21 | const chartsColors = ['rgb(255, 99, 132)', // magenta 22 | 'rgb(0, 158, 224)']; // cyan 23 | for (var i=0; i2-channel serial data. See console for points
6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /serial-plot-client/client.js: -------------------------------------------------------------------------------- 1 | function parseInts32LE(hexString) { 2 | /* 3 | * Parse string of hex digits to array of 32-bit-width little endian 4 | * integers 5 | * 6 | * To test use value 7 | * hex_str = "237A08002A2C0A0071F25B2E"; // 555555 666666 777777777 8 | */ 9 | 10 | const bytesInInt = 4; // 32-bit value 11 | // truncate the string if its length is not a multiple of 'bytesInInt' 12 | const intsInStr = Math.floor(hexString.length / (bytesInInt*2)); 13 | 14 | var ints = []; 15 | for (var i=0; i2-channel serial plot
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /serial-plot-epoch/dist/css/epoch.min.css: -------------------------------------------------------------------------------- 1 | .epoch .axis path,.epoch .axis line{shape-rendering:crispEdges}.epoch .axis.canvas .tick line{shape-rendering:geometricPrecision}div#_canvas_css_reference{width:0;height:0;position:absolute;top:-1000px;left:-1000px}div#_canvas_css_reference svg{position:absolute;width:0;height:0;top:-1000px;left:-1000px}.epoch{font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:12pt}.epoch .axis path,.epoch .axis line{fill:transparent;stroke:#000}.epoch .axis .tick text{font-size:9pt}.epoch .line{fill:transparent;stroke-width:2px}.epoch.sparklines .line{stroke-width:1px}.epoch .area{stroke:transparent}.epoch .arc.pie{stroke:#fff;stroke-width:1.5px}.epoch .arc.pie text{stroke:transparent;fill:white;font-size:9pt}.epoch .gauge-labels .value{text-anchor:middle;font-size:140%;fill:#666}.epoch.gauge-tiny{width:120px;height:90px}.epoch.gauge-tiny .gauge-labels .value{font-size:80%}.epoch.gauge-tiny .gauge .arc.outer{stroke-width:2px}.epoch.gauge-small{width:180px;height:135px}.epoch.gauge-small .gauge-labels .value{font-size:120%}.epoch.gauge-small .gauge .arc.outer{stroke-width:3px}.epoch.gauge-medium{width:240px;height:180px}.epoch.gauge-medium .gauge .arc.outer{stroke-width:3px}.epoch.gauge-large{width:320px;height:240px}.epoch.gauge-large .gauge-labels .value{font-size:180%}.epoch .gauge .arc.outer{stroke-width:4px;stroke:#666}.epoch .gauge .arc.inner{stroke-width:1px;stroke:#555}.epoch .gauge .tick{stroke-width:1px;stroke:#555}.epoch .gauge .needle{fill:orange}.epoch .gauge .needle-base{fill:#666}.epoch div.ref.category1,.epoch.category10 div.ref.category1{background-color:#1f77b4}.epoch .category1 .line,.epoch.category10 .category1 .line{stroke:#1f77b4}.epoch .category1 .area,.epoch .category1 .dot,.epoch.category10 .category1 .area,.epoch.category10 .category1 .dot{fill:#1f77b4;stroke:transparent}.epoch .arc.category1 path,.epoch.category10 .arc.category1 path{fill:#1f77b4}.epoch .bar.category1,.epoch.category10 .bar.category1{fill:#1f77b4}.epoch div.ref.category2,.epoch.category10 div.ref.category2{background-color:#ff7f0e}.epoch .category2 .line,.epoch.category10 .category2 .line{stroke:#ff7f0e}.epoch .category2 .area,.epoch .category2 .dot,.epoch.category10 .category2 .area,.epoch.category10 .category2 .dot{fill:#ff7f0e;stroke:transparent}.epoch .arc.category2 path,.epoch.category10 .arc.category2 path{fill:#ff7f0e}.epoch .bar.category2,.epoch.category10 .bar.category2{fill:#ff7f0e}.epoch div.ref.category3,.epoch.category10 div.ref.category3{background-color:#2ca02c}.epoch .category3 .line,.epoch.category10 .category3 .line{stroke:#2ca02c}.epoch .category3 .area,.epoch .category3 .dot,.epoch.category10 .category3 .area,.epoch.category10 .category3 .dot{fill:#2ca02c;stroke:transparent}.epoch .arc.category3 path,.epoch.category10 .arc.category3 path{fill:#2ca02c}.epoch .bar.category3,.epoch.category10 .bar.category3{fill:#2ca02c}.epoch div.ref.category4,.epoch.category10 div.ref.category4{background-color:#d62728}.epoch .category4 .line,.epoch.category10 .category4 .line{stroke:#d62728}.epoch .category4 .area,.epoch .category4 .dot,.epoch.category10 .category4 .area,.epoch.category10 .category4 .dot{fill:#d62728;stroke:transparent}.epoch .arc.category4 path,.epoch.category10 .arc.category4 path{fill:#d62728}.epoch .bar.category4,.epoch.category10 .bar.category4{fill:#d62728}.epoch div.ref.category5,.epoch.category10 div.ref.category5{background-color:#9467bd}.epoch .category5 .line,.epoch.category10 .category5 .line{stroke:#9467bd}.epoch .category5 .area,.epoch .category5 .dot,.epoch.category10 .category5 .area,.epoch.category10 .category5 .dot{fill:#9467bd;stroke:transparent}.epoch .arc.category5 path,.epoch.category10 .arc.category5 path{fill:#9467bd}.epoch .bar.category5,.epoch.category10 .bar.category5{fill:#9467bd}.epoch div.ref.category6,.epoch.category10 div.ref.category6{background-color:#8c564b}.epoch .category6 .line,.epoch.category10 .category6 .line{stroke:#8c564b}.epoch .category6 .area,.epoch .category6 .dot,.epoch.category10 .category6 .area,.epoch.category10 .category6 .dot{fill:#8c564b;stroke:transparent}.epoch .arc.category6 path,.epoch.category10 .arc.category6 path{fill:#8c564b}.epoch .bar.category6,.epoch.category10 .bar.category6{fill:#8c564b}.epoch div.ref.category7,.epoch.category10 div.ref.category7{background-color:#e377c2}.epoch .category7 .line,.epoch.category10 .category7 .line{stroke:#e377c2}.epoch .category7 .area,.epoch .category7 .dot,.epoch.category10 .category7 .area,.epoch.category10 .category7 .dot{fill:#e377c2;stroke:transparent}.epoch .arc.category7 path,.epoch.category10 .arc.category7 path{fill:#e377c2}.epoch .bar.category7,.epoch.category10 .bar.category7{fill:#e377c2}.epoch div.ref.category8,.epoch.category10 div.ref.category8{background-color:#7f7f7f}.epoch .category8 .line,.epoch.category10 .category8 .line{stroke:#7f7f7f}.epoch .category8 .area,.epoch .category8 .dot,.epoch.category10 .category8 .area,.epoch.category10 .category8 .dot{fill:#7f7f7f;stroke:transparent}.epoch .arc.category8 path,.epoch.category10 .arc.category8 path{fill:#7f7f7f}.epoch .bar.category8,.epoch.category10 .bar.category8{fill:#7f7f7f}.epoch div.ref.category9,.epoch.category10 div.ref.category9{background-color:#bcbd22}.epoch .category9 .line,.epoch.category10 .category9 .line{stroke:#bcbd22}.epoch .category9 .area,.epoch .category9 .dot,.epoch.category10 .category9 .area,.epoch.category10 .category9 .dot{fill:#bcbd22;stroke:transparent}.epoch .arc.category9 path,.epoch.category10 .arc.category9 path{fill:#bcbd22}.epoch .bar.category9,.epoch.category10 .bar.category9{fill:#bcbd22}.epoch div.ref.category10,.epoch.category10 div.ref.category10{background-color:#17becf}.epoch .category10 .line,.epoch.category10 .category10 .line{stroke:#17becf}.epoch .category10 .area,.epoch .category10 .dot,.epoch.category10 .category10 .area,.epoch.category10 .category10 .dot{fill:#17becf;stroke:transparent}.epoch .arc.category10 path,.epoch.category10 .arc.category10 path{fill:#17becf}.epoch .bar.category10,.epoch.category10 .bar.category10{fill:#17becf}.epoch.category20 div.ref.category1{background-color:#1f77b4}.epoch.category20 .category1 .line{stroke:#1f77b4}.epoch.category20 .category1 .area,.epoch.category20 .category1 .dot{fill:#1f77b4;stroke:transparent}.epoch.category20 .arc.category1 path{fill:#1f77b4}.epoch.category20 .bar.category1{fill:#1f77b4}.epoch.category20 div.ref.category2{background-color:#aec7e8}.epoch.category20 .category2 .line{stroke:#aec7e8}.epoch.category20 .category2 .area,.epoch.category20 .category2 .dot{fill:#aec7e8;stroke:transparent}.epoch.category20 .arc.category2 path{fill:#aec7e8}.epoch.category20 .bar.category2{fill:#aec7e8}.epoch.category20 div.ref.category3{background-color:#ff7f0e}.epoch.category20 .category3 .line{stroke:#ff7f0e}.epoch.category20 .category3 .area,.epoch.category20 .category3 .dot{fill:#ff7f0e;stroke:transparent}.epoch.category20 .arc.category3 path{fill:#ff7f0e}.epoch.category20 .bar.category3{fill:#ff7f0e}.epoch.category20 div.ref.category4{background-color:#ffbb78}.epoch.category20 .category4 .line{stroke:#ffbb78}.epoch.category20 .category4 .area,.epoch.category20 .category4 .dot{fill:#ffbb78;stroke:transparent}.epoch.category20 .arc.category4 path{fill:#ffbb78}.epoch.category20 .bar.category4{fill:#ffbb78}.epoch.category20 div.ref.category5{background-color:#2ca02c}.epoch.category20 .category5 .line{stroke:#2ca02c}.epoch.category20 .category5 .area,.epoch.category20 .category5 .dot{fill:#2ca02c;stroke:transparent}.epoch.category20 .arc.category5 path{fill:#2ca02c}.epoch.category20 .bar.category5{fill:#2ca02c}.epoch.category20 div.ref.category6{background-color:#98df8a}.epoch.category20 .category6 .line{stroke:#98df8a}.epoch.category20 .category6 .area,.epoch.category20 .category6 .dot{fill:#98df8a;stroke:transparent}.epoch.category20 .arc.category6 path{fill:#98df8a}.epoch.category20 .bar.category6{fill:#98df8a}.epoch.category20 div.ref.category7{background-color:#d62728}.epoch.category20 .category7 .line{stroke:#d62728}.epoch.category20 .category7 .area,.epoch.category20 .category7 .dot{fill:#d62728;stroke:transparent}.epoch.category20 .arc.category7 path{fill:#d62728}.epoch.category20 .bar.category7{fill:#d62728}.epoch.category20 div.ref.category8{background-color:#ff9896}.epoch.category20 .category8 .line{stroke:#ff9896}.epoch.category20 .category8 .area,.epoch.category20 .category8 .dot{fill:#ff9896;stroke:transparent}.epoch.category20 .arc.category8 path{fill:#ff9896}.epoch.category20 .bar.category8{fill:#ff9896}.epoch.category20 div.ref.category9{background-color:#9467bd}.epoch.category20 .category9 .line{stroke:#9467bd}.epoch.category20 .category9 .area,.epoch.category20 .category9 .dot{fill:#9467bd;stroke:transparent}.epoch.category20 .arc.category9 path{fill:#9467bd}.epoch.category20 .bar.category9{fill:#9467bd}.epoch.category20 div.ref.category10{background-color:#c5b0d5}.epoch.category20 .category10 .line{stroke:#c5b0d5}.epoch.category20 .category10 .area,.epoch.category20 .category10 .dot{fill:#c5b0d5;stroke:transparent}.epoch.category20 .arc.category10 path{fill:#c5b0d5}.epoch.category20 .bar.category10{fill:#c5b0d5}.epoch.category20 div.ref.category11{background-color:#8c564b}.epoch.category20 .category11 .line{stroke:#8c564b}.epoch.category20 .category11 .area,.epoch.category20 .category11 .dot{fill:#8c564b;stroke:transparent}.epoch.category20 .arc.category11 path{fill:#8c564b}.epoch.category20 .bar.category11{fill:#8c564b}.epoch.category20 div.ref.category12{background-color:#c49c94}.epoch.category20 .category12 .line{stroke:#c49c94}.epoch.category20 .category12 .area,.epoch.category20 .category12 .dot{fill:#c49c94;stroke:transparent}.epoch.category20 .arc.category12 path{fill:#c49c94}.epoch.category20 .bar.category12{fill:#c49c94}.epoch.category20 div.ref.category13{background-color:#e377c2}.epoch.category20 .category13 .line{stroke:#e377c2}.epoch.category20 .category13 .area,.epoch.category20 .category13 .dot{fill:#e377c2;stroke:transparent}.epoch.category20 .arc.category13 path{fill:#e377c2}.epoch.category20 .bar.category13{fill:#e377c2}.epoch.category20 div.ref.category14{background-color:#f7b6d2}.epoch.category20 .category14 .line{stroke:#f7b6d2}.epoch.category20 .category14 .area,.epoch.category20 .category14 .dot{fill:#f7b6d2;stroke:transparent}.epoch.category20 .arc.category14 path{fill:#f7b6d2}.epoch.category20 .bar.category14{fill:#f7b6d2}.epoch.category20 div.ref.category15{background-color:#7f7f7f}.epoch.category20 .category15 .line{stroke:#7f7f7f}.epoch.category20 .category15 .area,.epoch.category20 .category15 .dot{fill:#7f7f7f;stroke:transparent}.epoch.category20 .arc.category15 path{fill:#7f7f7f}.epoch.category20 .bar.category15{fill:#7f7f7f}.epoch.category20 div.ref.category16{background-color:#c7c7c7}.epoch.category20 .category16 .line{stroke:#c7c7c7}.epoch.category20 .category16 .area,.epoch.category20 .category16 .dot{fill:#c7c7c7;stroke:transparent}.epoch.category20 .arc.category16 path{fill:#c7c7c7}.epoch.category20 .bar.category16{fill:#c7c7c7}.epoch.category20 div.ref.category17{background-color:#bcbd22}.epoch.category20 .category17 .line{stroke:#bcbd22}.epoch.category20 .category17 .area,.epoch.category20 .category17 .dot{fill:#bcbd22;stroke:transparent}.epoch.category20 .arc.category17 path{fill:#bcbd22}.epoch.category20 .bar.category17{fill:#bcbd22}.epoch.category20 div.ref.category18{background-color:#dbdb8d}.epoch.category20 .category18 .line{stroke:#dbdb8d}.epoch.category20 .category18 .area,.epoch.category20 .category18 .dot{fill:#dbdb8d;stroke:transparent}.epoch.category20 .arc.category18 path{fill:#dbdb8d}.epoch.category20 .bar.category18{fill:#dbdb8d}.epoch.category20 div.ref.category19{background-color:#17becf}.epoch.category20 .category19 .line{stroke:#17becf}.epoch.category20 .category19 .area,.epoch.category20 .category19 .dot{fill:#17becf;stroke:transparent}.epoch.category20 .arc.category19 path{fill:#17becf}.epoch.category20 .bar.category19{fill:#17becf}.epoch.category20 div.ref.category20{background-color:#9edae5}.epoch.category20 .category20 .line{stroke:#9edae5}.epoch.category20 .category20 .area,.epoch.category20 .category20 .dot{fill:#9edae5;stroke:transparent}.epoch.category20 .arc.category20 path{fill:#9edae5}.epoch.category20 .bar.category20{fill:#9edae5}.epoch.category20b div.ref.category1{background-color:#393b79}.epoch.category20b .category1 .line{stroke:#393b79}.epoch.category20b .category1 .area,.epoch.category20b .category1 .dot{fill:#393b79;stroke:transparent}.epoch.category20b .arc.category1 path{fill:#393b79}.epoch.category20b .bar.category1{fill:#393b79}.epoch.category20b div.ref.category2{background-color:#5254a3}.epoch.category20b .category2 .line{stroke:#5254a3}.epoch.category20b .category2 .area,.epoch.category20b .category2 .dot{fill:#5254a3;stroke:transparent}.epoch.category20b .arc.category2 path{fill:#5254a3}.epoch.category20b .bar.category2{fill:#5254a3}.epoch.category20b div.ref.category3{background-color:#6b6ecf}.epoch.category20b .category3 .line{stroke:#6b6ecf}.epoch.category20b .category3 .area,.epoch.category20b .category3 .dot{fill:#6b6ecf;stroke:transparent}.epoch.category20b .arc.category3 path{fill:#6b6ecf}.epoch.category20b .bar.category3{fill:#6b6ecf}.epoch.category20b div.ref.category4{background-color:#9c9ede}.epoch.category20b .category4 .line{stroke:#9c9ede}.epoch.category20b .category4 .area,.epoch.category20b .category4 .dot{fill:#9c9ede;stroke:transparent}.epoch.category20b .arc.category4 path{fill:#9c9ede}.epoch.category20b .bar.category4{fill:#9c9ede}.epoch.category20b div.ref.category5{background-color:#637939}.epoch.category20b .category5 .line{stroke:#637939}.epoch.category20b .category5 .area,.epoch.category20b .category5 .dot{fill:#637939;stroke:transparent}.epoch.category20b .arc.category5 path{fill:#637939}.epoch.category20b .bar.category5{fill:#637939}.epoch.category20b div.ref.category6{background-color:#8ca252}.epoch.category20b .category6 .line{stroke:#8ca252}.epoch.category20b .category6 .area,.epoch.category20b .category6 .dot{fill:#8ca252;stroke:transparent}.epoch.category20b .arc.category6 path{fill:#8ca252}.epoch.category20b .bar.category6{fill:#8ca252}.epoch.category20b div.ref.category7{background-color:#b5cf6b}.epoch.category20b .category7 .line{stroke:#b5cf6b}.epoch.category20b .category7 .area,.epoch.category20b .category7 .dot{fill:#b5cf6b;stroke:transparent}.epoch.category20b .arc.category7 path{fill:#b5cf6b}.epoch.category20b .bar.category7{fill:#b5cf6b}.epoch.category20b div.ref.category8{background-color:#cedb9c}.epoch.category20b .category8 .line{stroke:#cedb9c}.epoch.category20b .category8 .area,.epoch.category20b .category8 .dot{fill:#cedb9c;stroke:transparent}.epoch.category20b .arc.category8 path{fill:#cedb9c}.epoch.category20b .bar.category8{fill:#cedb9c}.epoch.category20b div.ref.category9{background-color:#8c6d31}.epoch.category20b .category9 .line{stroke:#8c6d31}.epoch.category20b .category9 .area,.epoch.category20b .category9 .dot{fill:#8c6d31;stroke:transparent}.epoch.category20b .arc.category9 path{fill:#8c6d31}.epoch.category20b .bar.category9{fill:#8c6d31}.epoch.category20b div.ref.category10{background-color:#bd9e39}.epoch.category20b .category10 .line{stroke:#bd9e39}.epoch.category20b .category10 .area,.epoch.category20b .category10 .dot{fill:#bd9e39;stroke:transparent}.epoch.category20b .arc.category10 path{fill:#bd9e39}.epoch.category20b .bar.category10{fill:#bd9e39}.epoch.category20b div.ref.category11{background-color:#e7ba52}.epoch.category20b .category11 .line{stroke:#e7ba52}.epoch.category20b .category11 .area,.epoch.category20b .category11 .dot{fill:#e7ba52;stroke:transparent}.epoch.category20b .arc.category11 path{fill:#e7ba52}.epoch.category20b .bar.category11{fill:#e7ba52}.epoch.category20b div.ref.category12{background-color:#e7cb94}.epoch.category20b .category12 .line{stroke:#e7cb94}.epoch.category20b .category12 .area,.epoch.category20b .category12 .dot{fill:#e7cb94;stroke:transparent}.epoch.category20b .arc.category12 path{fill:#e7cb94}.epoch.category20b .bar.category12{fill:#e7cb94}.epoch.category20b div.ref.category13{background-color:#843c39}.epoch.category20b .category13 .line{stroke:#843c39}.epoch.category20b .category13 .area,.epoch.category20b .category13 .dot{fill:#843c39;stroke:transparent}.epoch.category20b .arc.category13 path{fill:#843c39}.epoch.category20b .bar.category13{fill:#843c39}.epoch.category20b div.ref.category14{background-color:#ad494a}.epoch.category20b .category14 .line{stroke:#ad494a}.epoch.category20b .category14 .area,.epoch.category20b .category14 .dot{fill:#ad494a;stroke:transparent}.epoch.category20b .arc.category14 path{fill:#ad494a}.epoch.category20b .bar.category14{fill:#ad494a}.epoch.category20b div.ref.category15{background-color:#d6616b}.epoch.category20b .category15 .line{stroke:#d6616b}.epoch.category20b .category15 .area,.epoch.category20b .category15 .dot{fill:#d6616b;stroke:transparent}.epoch.category20b .arc.category15 path{fill:#d6616b}.epoch.category20b .bar.category15{fill:#d6616b}.epoch.category20b div.ref.category16{background-color:#e7969c}.epoch.category20b .category16 .line{stroke:#e7969c}.epoch.category20b .category16 .area,.epoch.category20b .category16 .dot{fill:#e7969c;stroke:transparent}.epoch.category20b .arc.category16 path{fill:#e7969c}.epoch.category20b .bar.category16{fill:#e7969c}.epoch.category20b div.ref.category17{background-color:#7b4173}.epoch.category20b .category17 .line{stroke:#7b4173}.epoch.category20b .category17 .area,.epoch.category20b .category17 .dot{fill:#7b4173;stroke:transparent}.epoch.category20b .arc.category17 path{fill:#7b4173}.epoch.category20b .bar.category17{fill:#7b4173}.epoch.category20b div.ref.category18{background-color:#a55194}.epoch.category20b .category18 .line{stroke:#a55194}.epoch.category20b .category18 .area,.epoch.category20b .category18 .dot{fill:#a55194;stroke:transparent}.epoch.category20b .arc.category18 path{fill:#a55194}.epoch.category20b .bar.category18{fill:#a55194}.epoch.category20b div.ref.category19{background-color:#ce6dbd}.epoch.category20b .category19 .line{stroke:#ce6dbd}.epoch.category20b .category19 .area,.epoch.category20b .category19 .dot{fill:#ce6dbd;stroke:transparent}.epoch.category20b .arc.category19 path{fill:#ce6dbd}.epoch.category20b .bar.category19{fill:#ce6dbd}.epoch.category20b div.ref.category20{background-color:#de9ed6}.epoch.category20b .category20 .line{stroke:#de9ed6}.epoch.category20b .category20 .area,.epoch.category20b .category20 .dot{fill:#de9ed6;stroke:transparent}.epoch.category20b .arc.category20 path{fill:#de9ed6}.epoch.category20b .bar.category20{fill:#de9ed6}.epoch.category20c div.ref.category1{background-color:#3182bd}.epoch.category20c .category1 .line{stroke:#3182bd}.epoch.category20c .category1 .area,.epoch.category20c .category1 .dot{fill:#3182bd;stroke:transparent}.epoch.category20c .arc.category1 path{fill:#3182bd}.epoch.category20c .bar.category1{fill:#3182bd}.epoch.category20c div.ref.category2{background-color:#6baed6}.epoch.category20c .category2 .line{stroke:#6baed6}.epoch.category20c .category2 .area,.epoch.category20c .category2 .dot{fill:#6baed6;stroke:transparent}.epoch.category20c .arc.category2 path{fill:#6baed6}.epoch.category20c .bar.category2{fill:#6baed6}.epoch.category20c div.ref.category3{background-color:#9ecae1}.epoch.category20c .category3 .line{stroke:#9ecae1}.epoch.category20c .category3 .area,.epoch.category20c .category3 .dot{fill:#9ecae1;stroke:transparent}.epoch.category20c .arc.category3 path{fill:#9ecae1}.epoch.category20c .bar.category3{fill:#9ecae1}.epoch.category20c div.ref.category4{background-color:#c6dbef}.epoch.category20c .category4 .line{stroke:#c6dbef}.epoch.category20c .category4 .area,.epoch.category20c .category4 .dot{fill:#c6dbef;stroke:transparent}.epoch.category20c .arc.category4 path{fill:#c6dbef}.epoch.category20c .bar.category4{fill:#c6dbef}.epoch.category20c div.ref.category5{background-color:#e6550d}.epoch.category20c .category5 .line{stroke:#e6550d}.epoch.category20c .category5 .area,.epoch.category20c .category5 .dot{fill:#e6550d;stroke:transparent}.epoch.category20c .arc.category5 path{fill:#e6550d}.epoch.category20c .bar.category5{fill:#e6550d}.epoch.category20c div.ref.category6{background-color:#fd8d3c}.epoch.category20c .category6 .line{stroke:#fd8d3c}.epoch.category20c .category6 .area,.epoch.category20c .category6 .dot{fill:#fd8d3c;stroke:transparent}.epoch.category20c .arc.category6 path{fill:#fd8d3c}.epoch.category20c .bar.category6{fill:#fd8d3c}.epoch.category20c div.ref.category7{background-color:#fdae6b}.epoch.category20c .category7 .line{stroke:#fdae6b}.epoch.category20c .category7 .area,.epoch.category20c .category7 .dot{fill:#fdae6b;stroke:transparent}.epoch.category20c .arc.category7 path{fill:#fdae6b}.epoch.category20c .bar.category7{fill:#fdae6b}.epoch.category20c div.ref.category8{background-color:#fdd0a2}.epoch.category20c .category8 .line{stroke:#fdd0a2}.epoch.category20c .category8 .area,.epoch.category20c .category8 .dot{fill:#fdd0a2;stroke:transparent}.epoch.category20c .arc.category8 path{fill:#fdd0a2}.epoch.category20c .bar.category8{fill:#fdd0a2}.epoch.category20c div.ref.category9{background-color:#31a354}.epoch.category20c .category9 .line{stroke:#31a354}.epoch.category20c .category9 .area,.epoch.category20c .category9 .dot{fill:#31a354;stroke:transparent}.epoch.category20c .arc.category9 path{fill:#31a354}.epoch.category20c .bar.category9{fill:#31a354}.epoch.category20c div.ref.category10{background-color:#74c476}.epoch.category20c .category10 .line{stroke:#74c476}.epoch.category20c .category10 .area,.epoch.category20c .category10 .dot{fill:#74c476;stroke:transparent}.epoch.category20c .arc.category10 path{fill:#74c476}.epoch.category20c .bar.category10{fill:#74c476}.epoch.category20c div.ref.category11{background-color:#a1d99b}.epoch.category20c .category11 .line{stroke:#a1d99b}.epoch.category20c .category11 .area,.epoch.category20c .category11 .dot{fill:#a1d99b;stroke:transparent}.epoch.category20c .arc.category11 path{fill:#a1d99b}.epoch.category20c .bar.category11{fill:#a1d99b}.epoch.category20c div.ref.category12{background-color:#c7e9c0}.epoch.category20c .category12 .line{stroke:#c7e9c0}.epoch.category20c .category12 .area,.epoch.category20c .category12 .dot{fill:#c7e9c0;stroke:transparent}.epoch.category20c .arc.category12 path{fill:#c7e9c0}.epoch.category20c .bar.category12{fill:#c7e9c0}.epoch.category20c div.ref.category13{background-color:#756bb1}.epoch.category20c .category13 .line{stroke:#756bb1}.epoch.category20c .category13 .area,.epoch.category20c .category13 .dot{fill:#756bb1;stroke:transparent}.epoch.category20c .arc.category13 path{fill:#756bb1}.epoch.category20c .bar.category13{fill:#756bb1}.epoch.category20c div.ref.category14{background-color:#9e9ac8}.epoch.category20c .category14 .line{stroke:#9e9ac8}.epoch.category20c .category14 .area,.epoch.category20c .category14 .dot{fill:#9e9ac8;stroke:transparent}.epoch.category20c .arc.category14 path{fill:#9e9ac8}.epoch.category20c .bar.category14{fill:#9e9ac8}.epoch.category20c div.ref.category15{background-color:#bcbddc}.epoch.category20c .category15 .line{stroke:#bcbddc}.epoch.category20c .category15 .area,.epoch.category20c .category15 .dot{fill:#bcbddc;stroke:transparent}.epoch.category20c .arc.category15 path{fill:#bcbddc}.epoch.category20c .bar.category15{fill:#bcbddc}.epoch.category20c div.ref.category16{background-color:#dadaeb}.epoch.category20c .category16 .line{stroke:#dadaeb}.epoch.category20c .category16 .area,.epoch.category20c .category16 .dot{fill:#dadaeb;stroke:transparent}.epoch.category20c .arc.category16 path{fill:#dadaeb}.epoch.category20c .bar.category16{fill:#dadaeb}.epoch.category20c div.ref.category17{background-color:#636363}.epoch.category20c .category17 .line{stroke:#636363}.epoch.category20c .category17 .area,.epoch.category20c .category17 .dot{fill:#636363;stroke:transparent}.epoch.category20c .arc.category17 path{fill:#636363}.epoch.category20c .bar.category17{fill:#636363}.epoch.category20c div.ref.category18{background-color:#969696}.epoch.category20c .category18 .line{stroke:#969696}.epoch.category20c .category18 .area,.epoch.category20c .category18 .dot{fill:#969696;stroke:transparent}.epoch.category20c .arc.category18 path{fill:#969696}.epoch.category20c .bar.category18{fill:#969696}.epoch.category20c div.ref.category19{background-color:#bdbdbd}.epoch.category20c .category19 .line{stroke:#bdbdbd}.epoch.category20c .category19 .area,.epoch.category20c .category19 .dot{fill:#bdbdbd;stroke:transparent}.epoch.category20c .arc.category19 path{fill:#bdbdbd}.epoch.category20c .bar.category19{fill:#bdbdbd}.epoch.category20c div.ref.category20{background-color:#d9d9d9}.epoch.category20c .category20 .line{stroke:#d9d9d9}.epoch.category20c .category20 .area,.epoch.category20c .category20 .dot{fill:#d9d9d9;stroke:transparent}.epoch.category20c .arc.category20 path{fill:#d9d9d9}.epoch.category20c .bar.category20{fill:#d9d9d9}.epoch .category1 .bucket,.epoch.heatmap5 .category1 .bucket{fill:#1f77b4}.epoch .category2 .bucket,.epoch.heatmap5 .category2 .bucket{fill:#2ca02c}.epoch .category3 .bucket,.epoch.heatmap5 .category3 .bucket{fill:#d62728}.epoch .category4 .bucket,.epoch.heatmap5 .category4 .bucket{fill:#8c564b}.epoch .category5 .bucket,.epoch.heatmap5 .category5 .bucket{fill:#7f7f7f}.epoch-theme-dark .epoch .axis path,.epoch-theme-dark .epoch .axis line{stroke:#d0d0d0}.epoch-theme-dark .epoch .axis .tick text{fill:#d0d0d0}.epoch-theme-dark .arc.pie{stroke:#333}.epoch-theme-dark .arc.pie text{fill:#333}.epoch-theme-dark .epoch .gauge-labels .value{fill:#BBB}.epoch-theme-dark .epoch .gauge .arc.outer{stroke:#999}.epoch-theme-dark .epoch .gauge .arc.inner{stroke:#AAA}.epoch-theme-dark .epoch .gauge .tick{stroke:#AAA}.epoch-theme-dark .epoch .gauge .needle{fill:#F3DE88}.epoch-theme-dark .epoch .gauge .needle-base{fill:#999}.epoch-theme-dark .epoch div.ref.category1,.epoch-theme-dark .epoch.category10 div.ref.category1{background-color:#909CFF}.epoch-theme-dark .epoch .category1 .line,.epoch-theme-dark .epoch.category10 .category1 .line{stroke:#909CFF}.epoch-theme-dark .epoch .category1 .area,.epoch-theme-dark .epoch .category1 .dot,.epoch-theme-dark .epoch.category10 .category1 .area,.epoch-theme-dark .epoch.category10 .category1 .dot{fill:#909CFF;stroke:transparent}.epoch-theme-dark .epoch .arc.category1 path,.epoch-theme-dark .epoch.category10 .arc.category1 path{fill:#909CFF}.epoch-theme-dark .epoch .bar.category1,.epoch-theme-dark .epoch.category10 .bar.category1{fill:#909CFF}.epoch-theme-dark .epoch div.ref.category2,.epoch-theme-dark .epoch.category10 div.ref.category2{background-color:#FFAC89}.epoch-theme-dark .epoch .category2 .line,.epoch-theme-dark .epoch.category10 .category2 .line{stroke:#FFAC89}.epoch-theme-dark .epoch .category2 .area,.epoch-theme-dark .epoch .category2 .dot,.epoch-theme-dark .epoch.category10 .category2 .area,.epoch-theme-dark .epoch.category10 .category2 .dot{fill:#FFAC89;stroke:transparent}.epoch-theme-dark .epoch .arc.category2 path,.epoch-theme-dark .epoch.category10 .arc.category2 path{fill:#FFAC89}.epoch-theme-dark .epoch .bar.category2,.epoch-theme-dark .epoch.category10 .bar.category2{fill:#FFAC89}.epoch-theme-dark .epoch div.ref.category3,.epoch-theme-dark .epoch.category10 div.ref.category3{background-color:#E889E8}.epoch-theme-dark .epoch .category3 .line,.epoch-theme-dark .epoch.category10 .category3 .line{stroke:#E889E8}.epoch-theme-dark .epoch .category3 .area,.epoch-theme-dark .epoch .category3 .dot,.epoch-theme-dark .epoch.category10 .category3 .area,.epoch-theme-dark .epoch.category10 .category3 .dot{fill:#E889E8;stroke:transparent}.epoch-theme-dark .epoch .arc.category3 path,.epoch-theme-dark .epoch.category10 .arc.category3 path{fill:#E889E8}.epoch-theme-dark .epoch .bar.category3,.epoch-theme-dark .epoch.category10 .bar.category3{fill:#E889E8}.epoch-theme-dark .epoch div.ref.category4,.epoch-theme-dark .epoch.category10 div.ref.category4{background-color:#78E8D3}.epoch-theme-dark .epoch .category4 .line,.epoch-theme-dark .epoch.category10 .category4 .line{stroke:#78E8D3}.epoch-theme-dark .epoch .category4 .area,.epoch-theme-dark .epoch .category4 .dot,.epoch-theme-dark .epoch.category10 .category4 .area,.epoch-theme-dark .epoch.category10 .category4 .dot{fill:#78E8D3;stroke:transparent}.epoch-theme-dark .epoch .arc.category4 path,.epoch-theme-dark .epoch.category10 .arc.category4 path{fill:#78E8D3}.epoch-theme-dark .epoch .bar.category4,.epoch-theme-dark .epoch.category10 .bar.category4{fill:#78E8D3}.epoch-theme-dark .epoch div.ref.category5,.epoch-theme-dark .epoch.category10 div.ref.category5{background-color:#C2FF97}.epoch-theme-dark .epoch .category5 .line,.epoch-theme-dark .epoch.category10 .category5 .line{stroke:#C2FF97}.epoch-theme-dark .epoch .category5 .area,.epoch-theme-dark .epoch .category5 .dot,.epoch-theme-dark .epoch.category10 .category5 .area,.epoch-theme-dark .epoch.category10 .category5 .dot{fill:#C2FF97;stroke:transparent}.epoch-theme-dark .epoch .arc.category5 path,.epoch-theme-dark .epoch.category10 .arc.category5 path{fill:#C2FF97}.epoch-theme-dark .epoch .bar.category5,.epoch-theme-dark .epoch.category10 .bar.category5{fill:#C2FF97}.epoch-theme-dark .epoch div.ref.category6,.epoch-theme-dark .epoch.category10 div.ref.category6{background-color:#B7BCD1}.epoch-theme-dark .epoch .category6 .line,.epoch-theme-dark .epoch.category10 .category6 .line{stroke:#B7BCD1}.epoch-theme-dark .epoch .category6 .area,.epoch-theme-dark .epoch .category6 .dot,.epoch-theme-dark .epoch.category10 .category6 .area,.epoch-theme-dark .epoch.category10 .category6 .dot{fill:#B7BCD1;stroke:transparent}.epoch-theme-dark .epoch .arc.category6 path,.epoch-theme-dark .epoch.category10 .arc.category6 path{fill:#B7BCD1}.epoch-theme-dark .epoch .bar.category6,.epoch-theme-dark .epoch.category10 .bar.category6{fill:#B7BCD1}.epoch-theme-dark .epoch div.ref.category7,.epoch-theme-dark .epoch.category10 div.ref.category7{background-color:#FF857F}.epoch-theme-dark .epoch .category7 .line,.epoch-theme-dark .epoch.category10 .category7 .line{stroke:#FF857F}.epoch-theme-dark .epoch .category7 .area,.epoch-theme-dark .epoch .category7 .dot,.epoch-theme-dark .epoch.category10 .category7 .area,.epoch-theme-dark .epoch.category10 .category7 .dot{fill:#FF857F;stroke:transparent}.epoch-theme-dark .epoch .arc.category7 path,.epoch-theme-dark .epoch.category10 .arc.category7 path{fill:#FF857F}.epoch-theme-dark .epoch .bar.category7,.epoch-theme-dark .epoch.category10 .bar.category7{fill:#FF857F}.epoch-theme-dark .epoch div.ref.category8,.epoch-theme-dark .epoch.category10 div.ref.category8{background-color:#F3DE88}.epoch-theme-dark .epoch .category8 .line,.epoch-theme-dark .epoch.category10 .category8 .line{stroke:#F3DE88}.epoch-theme-dark .epoch .category8 .area,.epoch-theme-dark .epoch .category8 .dot,.epoch-theme-dark .epoch.category10 .category8 .area,.epoch-theme-dark .epoch.category10 .category8 .dot{fill:#F3DE88;stroke:transparent}.epoch-theme-dark .epoch .arc.category8 path,.epoch-theme-dark .epoch.category10 .arc.category8 path{fill:#F3DE88}.epoch-theme-dark .epoch .bar.category8,.epoch-theme-dark .epoch.category10 .bar.category8{fill:#F3DE88}.epoch-theme-dark .epoch div.ref.category9,.epoch-theme-dark .epoch.category10 div.ref.category9{background-color:#C9935E}.epoch-theme-dark .epoch .category9 .line,.epoch-theme-dark .epoch.category10 .category9 .line{stroke:#C9935E}.epoch-theme-dark .epoch .category9 .area,.epoch-theme-dark .epoch .category9 .dot,.epoch-theme-dark .epoch.category10 .category9 .area,.epoch-theme-dark .epoch.category10 .category9 .dot{fill:#C9935E;stroke:transparent}.epoch-theme-dark .epoch .arc.category9 path,.epoch-theme-dark .epoch.category10 .arc.category9 path{fill:#C9935E}.epoch-theme-dark .epoch .bar.category9,.epoch-theme-dark .epoch.category10 .bar.category9{fill:#C9935E}.epoch-theme-dark .epoch div.ref.category10,.epoch-theme-dark .epoch.category10 div.ref.category10{background-color:#A488FF}.epoch-theme-dark .epoch .category10 .line,.epoch-theme-dark .epoch.category10 .category10 .line{stroke:#A488FF}.epoch-theme-dark .epoch .category10 .area,.epoch-theme-dark .epoch .category10 .dot,.epoch-theme-dark .epoch.category10 .category10 .area,.epoch-theme-dark .epoch.category10 .category10 .dot{fill:#A488FF;stroke:transparent}.epoch-theme-dark .epoch .arc.category10 path,.epoch-theme-dark .epoch.category10 .arc.category10 path{fill:#A488FF}.epoch-theme-dark .epoch .bar.category10,.epoch-theme-dark .epoch.category10 .bar.category10{fill:#A488FF}.epoch-theme-dark .epoch.category20 div.ref.category1{background-color:#909CFF}.epoch-theme-dark .epoch.category20 .category1 .line{stroke:#909CFF}.epoch-theme-dark .epoch.category20 .category1 .area,.epoch-theme-dark .epoch.category20 .category1 .dot{fill:#909CFF;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category1 path{fill:#909CFF}.epoch-theme-dark .epoch.category20 .bar.category1{fill:#909CFF}.epoch-theme-dark .epoch.category20 div.ref.category2{background-color:#626AAD}.epoch-theme-dark .epoch.category20 .category2 .line{stroke:#626AAD}.epoch-theme-dark .epoch.category20 .category2 .area,.epoch-theme-dark .epoch.category20 .category2 .dot{fill:#626AAD;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category2 path{fill:#626AAD}.epoch-theme-dark .epoch.category20 .bar.category2{fill:#626AAD}.epoch-theme-dark .epoch.category20 div.ref.category3{background-color:#FFAC89}.epoch-theme-dark .epoch.category20 .category3 .line{stroke:#FFAC89}.epoch-theme-dark .epoch.category20 .category3 .area,.epoch-theme-dark .epoch.category20 .category3 .dot{fill:#FFAC89;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category3 path{fill:#FFAC89}.epoch-theme-dark .epoch.category20 .bar.category3{fill:#FFAC89}.epoch-theme-dark .epoch.category20 div.ref.category4{background-color:#BD7F66}.epoch-theme-dark .epoch.category20 .category4 .line{stroke:#BD7F66}.epoch-theme-dark .epoch.category20 .category4 .area,.epoch-theme-dark .epoch.category20 .category4 .dot{fill:#BD7F66;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category4 path{fill:#BD7F66}.epoch-theme-dark .epoch.category20 .bar.category4{fill:#BD7F66}.epoch-theme-dark .epoch.category20 div.ref.category5{background-color:#E889E8}.epoch-theme-dark .epoch.category20 .category5 .line{stroke:#E889E8}.epoch-theme-dark .epoch.category20 .category5 .area,.epoch-theme-dark .epoch.category20 .category5 .dot{fill:#E889E8;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category5 path{fill:#E889E8}.epoch-theme-dark .epoch.category20 .bar.category5{fill:#E889E8}.epoch-theme-dark .epoch.category20 div.ref.category6{background-color:#995A99}.epoch-theme-dark .epoch.category20 .category6 .line{stroke:#995A99}.epoch-theme-dark .epoch.category20 .category6 .area,.epoch-theme-dark .epoch.category20 .category6 .dot{fill:#995A99;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category6 path{fill:#995A99}.epoch-theme-dark .epoch.category20 .bar.category6{fill:#995A99}.epoch-theme-dark .epoch.category20 div.ref.category7{background-color:#78E8D3}.epoch-theme-dark .epoch.category20 .category7 .line{stroke:#78E8D3}.epoch-theme-dark .epoch.category20 .category7 .area,.epoch-theme-dark .epoch.category20 .category7 .dot{fill:#78E8D3;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category7 path{fill:#78E8D3}.epoch-theme-dark .epoch.category20 .bar.category7{fill:#78E8D3}.epoch-theme-dark .epoch.category20 div.ref.category8{background-color:#4F998C}.epoch-theme-dark .epoch.category20 .category8 .line{stroke:#4F998C}.epoch-theme-dark .epoch.category20 .category8 .area,.epoch-theme-dark .epoch.category20 .category8 .dot{fill:#4F998C;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category8 path{fill:#4F998C}.epoch-theme-dark .epoch.category20 .bar.category8{fill:#4F998C}.epoch-theme-dark .epoch.category20 div.ref.category9{background-color:#C2FF97}.epoch-theme-dark .epoch.category20 .category9 .line{stroke:#C2FF97}.epoch-theme-dark .epoch.category20 .category9 .area,.epoch-theme-dark .epoch.category20 .category9 .dot{fill:#C2FF97;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category9 path{fill:#C2FF97}.epoch-theme-dark .epoch.category20 .bar.category9{fill:#C2FF97}.epoch-theme-dark .epoch.category20 div.ref.category10{background-color:#789E5E}.epoch-theme-dark .epoch.category20 .category10 .line{stroke:#789E5E}.epoch-theme-dark .epoch.category20 .category10 .area,.epoch-theme-dark .epoch.category20 .category10 .dot{fill:#789E5E;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category10 path{fill:#789E5E}.epoch-theme-dark .epoch.category20 .bar.category10{fill:#789E5E}.epoch-theme-dark .epoch.category20 div.ref.category11{background-color:#B7BCD1}.epoch-theme-dark .epoch.category20 .category11 .line{stroke:#B7BCD1}.epoch-theme-dark .epoch.category20 .category11 .area,.epoch-theme-dark .epoch.category20 .category11 .dot{fill:#B7BCD1;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category11 path{fill:#B7BCD1}.epoch-theme-dark .epoch.category20 .bar.category11{fill:#B7BCD1}.epoch-theme-dark .epoch.category20 div.ref.category12{background-color:#7F8391}.epoch-theme-dark .epoch.category20 .category12 .line{stroke:#7F8391}.epoch-theme-dark .epoch.category20 .category12 .area,.epoch-theme-dark .epoch.category20 .category12 .dot{fill:#7F8391;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category12 path{fill:#7F8391}.epoch-theme-dark .epoch.category20 .bar.category12{fill:#7F8391}.epoch-theme-dark .epoch.category20 div.ref.category13{background-color:#CCB889}.epoch-theme-dark .epoch.category20 .category13 .line{stroke:#CCB889}.epoch-theme-dark .epoch.category20 .category13 .area,.epoch-theme-dark .epoch.category20 .category13 .dot{fill:#CCB889;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category13 path{fill:#CCB889}.epoch-theme-dark .epoch.category20 .bar.category13{fill:#CCB889}.epoch-theme-dark .epoch.category20 div.ref.category14{background-color:#A1906B}.epoch-theme-dark .epoch.category20 .category14 .line{stroke:#A1906B}.epoch-theme-dark .epoch.category20 .category14 .area,.epoch-theme-dark .epoch.category20 .category14 .dot{fill:#A1906B;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category14 path{fill:#A1906B}.epoch-theme-dark .epoch.category20 .bar.category14{fill:#A1906B}.epoch-theme-dark .epoch.category20 div.ref.category15{background-color:#F3DE88}.epoch-theme-dark .epoch.category20 .category15 .line{stroke:#F3DE88}.epoch-theme-dark .epoch.category20 .category15 .area,.epoch-theme-dark .epoch.category20 .category15 .dot{fill:#F3DE88;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category15 path{fill:#F3DE88}.epoch-theme-dark .epoch.category20 .bar.category15{fill:#F3DE88}.epoch-theme-dark .epoch.category20 div.ref.category16{background-color:#A89A5E}.epoch-theme-dark .epoch.category20 .category16 .line{stroke:#A89A5E}.epoch-theme-dark .epoch.category20 .category16 .area,.epoch-theme-dark .epoch.category20 .category16 .dot{fill:#A89A5E;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category16 path{fill:#A89A5E}.epoch-theme-dark .epoch.category20 .bar.category16{fill:#A89A5E}.epoch-theme-dark .epoch.category20 div.ref.category17{background-color:#FF857F}.epoch-theme-dark .epoch.category20 .category17 .line{stroke:#FF857F}.epoch-theme-dark .epoch.category20 .category17 .area,.epoch-theme-dark .epoch.category20 .category17 .dot{fill:#FF857F;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category17 path{fill:#FF857F}.epoch-theme-dark .epoch.category20 .bar.category17{fill:#FF857F}.epoch-theme-dark .epoch.category20 div.ref.category18{background-color:#BA615D}.epoch-theme-dark .epoch.category20 .category18 .line{stroke:#BA615D}.epoch-theme-dark .epoch.category20 .category18 .area,.epoch-theme-dark .epoch.category20 .category18 .dot{fill:#BA615D;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category18 path{fill:#BA615D}.epoch-theme-dark .epoch.category20 .bar.category18{fill:#BA615D}.epoch-theme-dark .epoch.category20 div.ref.category19{background-color:#A488FF}.epoch-theme-dark .epoch.category20 .category19 .line{stroke:#A488FF}.epoch-theme-dark .epoch.category20 .category19 .area,.epoch-theme-dark .epoch.category20 .category19 .dot{fill:#A488FF;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category19 path{fill:#A488FF}.epoch-theme-dark .epoch.category20 .bar.category19{fill:#A488FF}.epoch-theme-dark .epoch.category20 div.ref.category20{background-color:#7662B8}.epoch-theme-dark .epoch.category20 .category20 .line{stroke:#7662B8}.epoch-theme-dark .epoch.category20 .category20 .area,.epoch-theme-dark .epoch.category20 .category20 .dot{fill:#7662B8;stroke:transparent}.epoch-theme-dark .epoch.category20 .arc.category20 path{fill:#7662B8}.epoch-theme-dark .epoch.category20 .bar.category20{fill:#7662B8}.epoch-theme-dark .epoch.category20b div.ref.category1{background-color:#909CFF}.epoch-theme-dark .epoch.category20b .category1 .line{stroke:#909CFF}.epoch-theme-dark .epoch.category20b .category1 .area,.epoch-theme-dark .epoch.category20b .category1 .dot{fill:#909CFF;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category1 path{fill:#909CFF}.epoch-theme-dark .epoch.category20b .bar.category1{fill:#909CFF}.epoch-theme-dark .epoch.category20b div.ref.category2{background-color:#7680D1}.epoch-theme-dark .epoch.category20b .category2 .line{stroke:#7680D1}.epoch-theme-dark .epoch.category20b .category2 .area,.epoch-theme-dark .epoch.category20b .category2 .dot{fill:#7680D1;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category2 path{fill:#7680D1}.epoch-theme-dark .epoch.category20b .bar.category2{fill:#7680D1}.epoch-theme-dark .epoch.category20b div.ref.category3{background-color:#656DB2}.epoch-theme-dark .epoch.category20b .category3 .line{stroke:#656DB2}.epoch-theme-dark .epoch.category20b .category3 .area,.epoch-theme-dark .epoch.category20b .category3 .dot{fill:#656DB2;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category3 path{fill:#656DB2}.epoch-theme-dark .epoch.category20b .bar.category3{fill:#656DB2}.epoch-theme-dark .epoch.category20b div.ref.category4{background-color:#525992}.epoch-theme-dark .epoch.category20b .category4 .line{stroke:#525992}.epoch-theme-dark .epoch.category20b .category4 .area,.epoch-theme-dark .epoch.category20b .category4 .dot{fill:#525992;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category4 path{fill:#525992}.epoch-theme-dark .epoch.category20b .bar.category4{fill:#525992}.epoch-theme-dark .epoch.category20b div.ref.category5{background-color:#FFAC89}.epoch-theme-dark .epoch.category20b .category5 .line{stroke:#FFAC89}.epoch-theme-dark .epoch.category20b .category5 .area,.epoch-theme-dark .epoch.category20b .category5 .dot{fill:#FFAC89;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category5 path{fill:#FFAC89}.epoch-theme-dark .epoch.category20b .bar.category5{fill:#FFAC89}.epoch-theme-dark .epoch.category20b div.ref.category6{background-color:#D18D71}.epoch-theme-dark .epoch.category20b .category6 .line{stroke:#D18D71}.epoch-theme-dark .epoch.category20b .category6 .area,.epoch-theme-dark .epoch.category20b .category6 .dot{fill:#D18D71;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category6 path{fill:#D18D71}.epoch-theme-dark .epoch.category20b .bar.category6{fill:#D18D71}.epoch-theme-dark .epoch.category20b div.ref.category7{background-color:#AB735C}.epoch-theme-dark .epoch.category20b .category7 .line{stroke:#AB735C}.epoch-theme-dark .epoch.category20b .category7 .area,.epoch-theme-dark .epoch.category20b .category7 .dot{fill:#AB735C;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category7 path{fill:#AB735C}.epoch-theme-dark .epoch.category20b .bar.category7{fill:#AB735C}.epoch-theme-dark .epoch.category20b div.ref.category8{background-color:#92624E}.epoch-theme-dark .epoch.category20b .category8 .line{stroke:#92624E}.epoch-theme-dark .epoch.category20b .category8 .area,.epoch-theme-dark .epoch.category20b .category8 .dot{fill:#92624E;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category8 path{fill:#92624E}.epoch-theme-dark .epoch.category20b .bar.category8{fill:#92624E}.epoch-theme-dark .epoch.category20b div.ref.category9{background-color:#E889E8}.epoch-theme-dark .epoch.category20b .category9 .line{stroke:#E889E8}.epoch-theme-dark .epoch.category20b .category9 .area,.epoch-theme-dark .epoch.category20b .category9 .dot{fill:#E889E8;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category9 path{fill:#E889E8}.epoch-theme-dark .epoch.category20b .bar.category9{fill:#E889E8}.epoch-theme-dark .epoch.category20b div.ref.category10{background-color:#BA6EBA}.epoch-theme-dark .epoch.category20b .category10 .line{stroke:#BA6EBA}.epoch-theme-dark .epoch.category20b .category10 .area,.epoch-theme-dark .epoch.category20b .category10 .dot{fill:#BA6EBA;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category10 path{fill:#BA6EBA}.epoch-theme-dark .epoch.category20b .bar.category10{fill:#BA6EBA}.epoch-theme-dark .epoch.category20b div.ref.category11{background-color:#9B5C9B}.epoch-theme-dark .epoch.category20b .category11 .line{stroke:#9B5C9B}.epoch-theme-dark .epoch.category20b .category11 .area,.epoch-theme-dark .epoch.category20b .category11 .dot{fill:#9B5C9B;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category11 path{fill:#9B5C9B}.epoch-theme-dark .epoch.category20b .bar.category11{fill:#9B5C9B}.epoch-theme-dark .epoch.category20b div.ref.category12{background-color:#7B487B}.epoch-theme-dark .epoch.category20b .category12 .line{stroke:#7B487B}.epoch-theme-dark .epoch.category20b .category12 .area,.epoch-theme-dark .epoch.category20b .category12 .dot{fill:#7B487B;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category12 path{fill:#7B487B}.epoch-theme-dark .epoch.category20b .bar.category12{fill:#7B487B}.epoch-theme-dark .epoch.category20b div.ref.category13{background-color:#78E8D3}.epoch-theme-dark .epoch.category20b .category13 .line{stroke:#78E8D3}.epoch-theme-dark .epoch.category20b .category13 .area,.epoch-theme-dark .epoch.category20b .category13 .dot{fill:#78E8D3;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category13 path{fill:#78E8D3}.epoch-theme-dark .epoch.category20b .bar.category13{fill:#78E8D3}.epoch-theme-dark .epoch.category20b div.ref.category14{background-color:#60BAAA}.epoch-theme-dark .epoch.category20b .category14 .line{stroke:#60BAAA}.epoch-theme-dark .epoch.category20b .category14 .area,.epoch-theme-dark .epoch.category20b .category14 .dot{fill:#60BAAA;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category14 path{fill:#60BAAA}.epoch-theme-dark .epoch.category20b .bar.category14{fill:#60BAAA}.epoch-theme-dark .epoch.category20b div.ref.category15{background-color:#509B8D}.epoch-theme-dark .epoch.category20b .category15 .line{stroke:#509B8D}.epoch-theme-dark .epoch.category20b .category15 .area,.epoch-theme-dark .epoch.category20b .category15 .dot{fill:#509B8D;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category15 path{fill:#509B8D}.epoch-theme-dark .epoch.category20b .bar.category15{fill:#509B8D}.epoch-theme-dark .epoch.category20b div.ref.category16{background-color:#3F7B70}.epoch-theme-dark .epoch.category20b .category16 .line{stroke:#3F7B70}.epoch-theme-dark .epoch.category20b .category16 .area,.epoch-theme-dark .epoch.category20b .category16 .dot{fill:#3F7B70;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category16 path{fill:#3F7B70}.epoch-theme-dark .epoch.category20b .bar.category16{fill:#3F7B70}.epoch-theme-dark .epoch.category20b div.ref.category17{background-color:#C2FF97}.epoch-theme-dark .epoch.category20b .category17 .line{stroke:#C2FF97}.epoch-theme-dark .epoch.category20b .category17 .area,.epoch-theme-dark .epoch.category20b .category17 .dot{fill:#C2FF97;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category17 path{fill:#C2FF97}.epoch-theme-dark .epoch.category20b .bar.category17{fill:#C2FF97}.epoch-theme-dark .epoch.category20b div.ref.category18{background-color:#9FD17C}.epoch-theme-dark .epoch.category20b .category18 .line{stroke:#9FD17C}.epoch-theme-dark .epoch.category20b .category18 .area,.epoch-theme-dark .epoch.category20b .category18 .dot{fill:#9FD17C;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category18 path{fill:#9FD17C}.epoch-theme-dark .epoch.category20b .bar.category18{fill:#9FD17C}.epoch-theme-dark .epoch.category20b div.ref.category19{background-color:#7DA361}.epoch-theme-dark .epoch.category20b .category19 .line{stroke:#7DA361}.epoch-theme-dark .epoch.category20b .category19 .area,.epoch-theme-dark .epoch.category20b .category19 .dot{fill:#7DA361;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category19 path{fill:#7DA361}.epoch-theme-dark .epoch.category20b .bar.category19{fill:#7DA361}.epoch-theme-dark .epoch.category20b div.ref.category20{background-color:#65854E}.epoch-theme-dark .epoch.category20b .category20 .line{stroke:#65854E}.epoch-theme-dark .epoch.category20b .category20 .area,.epoch-theme-dark .epoch.category20b .category20 .dot{fill:#65854E;stroke:transparent}.epoch-theme-dark .epoch.category20b .arc.category20 path{fill:#65854E}.epoch-theme-dark .epoch.category20b .bar.category20{fill:#65854E}.epoch-theme-dark .epoch.category20c div.ref.category1{background-color:#B7BCD1}.epoch-theme-dark .epoch.category20c .category1 .line{stroke:#B7BCD1}.epoch-theme-dark .epoch.category20c .category1 .area,.epoch-theme-dark .epoch.category20c .category1 .dot{fill:#B7BCD1;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category1 path{fill:#B7BCD1}.epoch-theme-dark .epoch.category20c .bar.category1{fill:#B7BCD1}.epoch-theme-dark .epoch.category20c div.ref.category2{background-color:#979DAD}.epoch-theme-dark .epoch.category20c .category2 .line{stroke:#979DAD}.epoch-theme-dark .epoch.category20c .category2 .area,.epoch-theme-dark .epoch.category20c .category2 .dot{fill:#979DAD;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category2 path{fill:#979DAD}.epoch-theme-dark .epoch.category20c .bar.category2{fill:#979DAD}.epoch-theme-dark .epoch.category20c div.ref.category3{background-color:#6E717D}.epoch-theme-dark .epoch.category20c .category3 .line{stroke:#6E717D}.epoch-theme-dark .epoch.category20c .category3 .area,.epoch-theme-dark .epoch.category20c .category3 .dot{fill:#6E717D;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category3 path{fill:#6E717D}.epoch-theme-dark .epoch.category20c .bar.category3{fill:#6E717D}.epoch-theme-dark .epoch.category20c div.ref.category4{background-color:#595C66}.epoch-theme-dark .epoch.category20c .category4 .line{stroke:#595C66}.epoch-theme-dark .epoch.category20c .category4 .area,.epoch-theme-dark .epoch.category20c .category4 .dot{fill:#595C66;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category4 path{fill:#595C66}.epoch-theme-dark .epoch.category20c .bar.category4{fill:#595C66}.epoch-theme-dark .epoch.category20c div.ref.category5{background-color:#FF857F}.epoch-theme-dark .epoch.category20c .category5 .line{stroke:#FF857F}.epoch-theme-dark .epoch.category20c .category5 .area,.epoch-theme-dark .epoch.category20c .category5 .dot{fill:#FF857F;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category5 path{fill:#FF857F}.epoch-theme-dark .epoch.category20c .bar.category5{fill:#FF857F}.epoch-theme-dark .epoch.category20c div.ref.category6{background-color:#DE746E}.epoch-theme-dark .epoch.category20c .category6 .line{stroke:#DE746E}.epoch-theme-dark .epoch.category20c .category6 .area,.epoch-theme-dark .epoch.category20c .category6 .dot{fill:#DE746E;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category6 path{fill:#DE746E}.epoch-theme-dark .epoch.category20c .bar.category6{fill:#DE746E}.epoch-theme-dark .epoch.category20c div.ref.category7{background-color:#B55F5A}.epoch-theme-dark .epoch.category20c .category7 .line{stroke:#B55F5A}.epoch-theme-dark .epoch.category20c .category7 .area,.epoch-theme-dark .epoch.category20c .category7 .dot{fill:#B55F5A;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category7 path{fill:#B55F5A}.epoch-theme-dark .epoch.category20c .bar.category7{fill:#B55F5A}.epoch-theme-dark .epoch.category20c div.ref.category8{background-color:#964E4B}.epoch-theme-dark .epoch.category20c .category8 .line{stroke:#964E4B}.epoch-theme-dark .epoch.category20c .category8 .area,.epoch-theme-dark .epoch.category20c .category8 .dot{fill:#964E4B;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category8 path{fill:#964E4B}.epoch-theme-dark .epoch.category20c .bar.category8{fill:#964E4B}.epoch-theme-dark .epoch.category20c div.ref.category9{background-color:#F3DE88}.epoch-theme-dark .epoch.category20c .category9 .line{stroke:#F3DE88}.epoch-theme-dark .epoch.category20c .category9 .area,.epoch-theme-dark .epoch.category20c .category9 .dot{fill:#F3DE88;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category9 path{fill:#F3DE88}.epoch-theme-dark .epoch.category20c .bar.category9{fill:#F3DE88}.epoch-theme-dark .epoch.category20c div.ref.category10{background-color:#DBC87B}.epoch-theme-dark .epoch.category20c .category10 .line{stroke:#DBC87B}.epoch-theme-dark .epoch.category20c .category10 .area,.epoch-theme-dark .epoch.category20c .category10 .dot{fill:#DBC87B;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category10 path{fill:#DBC87B}.epoch-theme-dark .epoch.category20c .bar.category10{fill:#DBC87B}.epoch-theme-dark .epoch.category20c div.ref.category11{background-color:#BAAA68}.epoch-theme-dark .epoch.category20c .category11 .line{stroke:#BAAA68}.epoch-theme-dark .epoch.category20c .category11 .area,.epoch-theme-dark .epoch.category20c .category11 .dot{fill:#BAAA68;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category11 path{fill:#BAAA68}.epoch-theme-dark .epoch.category20c .bar.category11{fill:#BAAA68}.epoch-theme-dark .epoch.category20c div.ref.category12{background-color:#918551}.epoch-theme-dark .epoch.category20c .category12 .line{stroke:#918551}.epoch-theme-dark .epoch.category20c .category12 .area,.epoch-theme-dark .epoch.category20c .category12 .dot{fill:#918551;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category12 path{fill:#918551}.epoch-theme-dark .epoch.category20c .bar.category12{fill:#918551}.epoch-theme-dark .epoch.category20c div.ref.category13{background-color:#C9935E}.epoch-theme-dark .epoch.category20c .category13 .line{stroke:#C9935E}.epoch-theme-dark .epoch.category20c .category13 .area,.epoch-theme-dark .epoch.category20c .category13 .dot{fill:#C9935E;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category13 path{fill:#C9935E}.epoch-theme-dark .epoch.category20c .bar.category13{fill:#C9935E}.epoch-theme-dark .epoch.category20c div.ref.category14{background-color:#B58455}.epoch-theme-dark .epoch.category20c .category14 .line{stroke:#B58455}.epoch-theme-dark .epoch.category20c .category14 .area,.epoch-theme-dark .epoch.category20c .category14 .dot{fill:#B58455;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category14 path{fill:#B58455}.epoch-theme-dark .epoch.category20c .bar.category14{fill:#B58455}.epoch-theme-dark .epoch.category20c div.ref.category15{background-color:#997048}.epoch-theme-dark .epoch.category20c .category15 .line{stroke:#997048}.epoch-theme-dark .epoch.category20c .category15 .area,.epoch-theme-dark .epoch.category20c .category15 .dot{fill:#997048;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category15 path{fill:#997048}.epoch-theme-dark .epoch.category20c .bar.category15{fill:#997048}.epoch-theme-dark .epoch.category20c div.ref.category16{background-color:#735436}.epoch-theme-dark .epoch.category20c .category16 .line{stroke:#735436}.epoch-theme-dark .epoch.category20c .category16 .area,.epoch-theme-dark .epoch.category20c .category16 .dot{fill:#735436;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category16 path{fill:#735436}.epoch-theme-dark .epoch.category20c .bar.category16{fill:#735436}.epoch-theme-dark .epoch.category20c div.ref.category17{background-color:#A488FF}.epoch-theme-dark .epoch.category20c .category17 .line{stroke:#A488FF}.epoch-theme-dark .epoch.category20c .category17 .area,.epoch-theme-dark .epoch.category20c .category17 .dot{fill:#A488FF;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category17 path{fill:#A488FF}.epoch-theme-dark .epoch.category20c .bar.category17{fill:#A488FF}.epoch-theme-dark .epoch.category20c div.ref.category18{background-color:#8670D1}.epoch-theme-dark .epoch.category20c .category18 .line{stroke:#8670D1}.epoch-theme-dark .epoch.category20c .category18 .area,.epoch-theme-dark .epoch.category20c .category18 .dot{fill:#8670D1;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category18 path{fill:#8670D1}.epoch-theme-dark .epoch.category20c .bar.category18{fill:#8670D1}.epoch-theme-dark .epoch.category20c div.ref.category19{background-color:#705CAD}.epoch-theme-dark .epoch.category20c .category19 .line{stroke:#705CAD}.epoch-theme-dark .epoch.category20c .category19 .area,.epoch-theme-dark .epoch.category20c .category19 .dot{fill:#705CAD;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category19 path{fill:#705CAD}.epoch-theme-dark .epoch.category20c .bar.category19{fill:#705CAD}.epoch-theme-dark .epoch.category20c div.ref.category20{background-color:#52447F}.epoch-theme-dark .epoch.category20c .category20 .line{stroke:#52447F}.epoch-theme-dark .epoch.category20c .category20 .area,.epoch-theme-dark .epoch.category20c .category20 .dot{fill:#52447F;stroke:transparent}.epoch-theme-dark .epoch.category20c .arc.category20 path{fill:#52447F}.epoch-theme-dark .epoch.category20c .bar.category20{fill:#52447F} 2 | -------------------------------------------------------------------------------- /serial-plot-epoch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serial-plot-epoch", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "epoch-charting": "^0.8.4" 14 | }, 15 | "devDependencies": { 16 | "webpack": "^4.22.0", 17 | "webpack-cli": "^3.1.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /serial-plot-epoch/renderer.js: -------------------------------------------------------------------------------- 1 | require("d3"); 2 | require("epoch-charting"); 3 | 4 | const dataSets = new Array(numPlots); 5 | const charts = new Array(numPlots); 6 | 7 | for (var i=0, now=new Date().getTime(); i2-channel serial plot
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /serial-plot-smoothie/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ussserrr/serial-plot-web/b992715e3a62d951fa5dbec816f5fd01b7076597/serial-plot-smoothie/cover.png -------------------------------------------------------------------------------- /serial-plot-smoothie/dist/renderer_packed.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function i(s){if(e[s])return e[s].exports;var a=e[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(s,a,function(e){return t[e]}.bind(null,a));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){const s=i(1),a=new Array(numPlots),o=new Array(numPlots),n=["rgba(0, 255, 0, 1)","rgba(255, 0, 0, 1)"],r=["rgba(0, 255, 0, 0.2)","rgba(255, 0, 0, 0.2)"];for(var l=0;lTimeSeries
with optional data options.\n *\n * Options are of the form (defaults shown):\n *\n * \n * {\n * resetBounds: true, // enables/disables automatic scaling of the y-axis\n * resetBoundsInterval: 3000 // the period between scaling calculations, in millis\n * }\n *\n *\n * Presentation options for TimeSeries are specified as an argument to
SmoothieChart.addTimeSeries
.\n *\n * @constructor\n */\n function TimeSeries(options) {\n this.options = Util.extend({}, TimeSeries.defaultOptions, options);\n this.disabled = false;\n this.clear();\n }\n\n TimeSeries.defaultOptions = {\n resetBoundsInterval: 3000,\n resetBounds: true\n };\n\n /**\n * Clears all data and state from this TimeSeries object.\n */\n TimeSeries.prototype.clear = function() {\n this.data = [];\n this.maxValue = Number.NaN; // The maximum value ever seen in this TimeSeries.\n this.minValue = Number.NaN; // The minimum value ever seen in this TimeSeries.\n };\n\n /**\n * Recalculate the min/max values for this TimeSeries
object.\n *\n * This causes the graph to scale itself in the y-axis.\n */\n TimeSeries.prototype.resetBounds = function() {\n if (this.data.length) {\n // Walk through all data points, finding the min/max value\n this.maxValue = this.data[0][1];\n this.minValue = this.data[0][1];\n for (var i = 1; i < this.data.length; i++) {\n var value = this.data[i][1];\n if (value > this.maxValue) {\n this.maxValue = value;\n }\n if (value < this.minValue) {\n this.minValue = value;\n }\n }\n } else {\n // No data exists, so set min/max to NaN\n this.maxValue = Number.NaN;\n this.minValue = Number.NaN;\n }\n };\n\n /**\n * Adds a new data point to the TimeSeries
, preserving chronological order.\n *\n * @param timestamp the position, in time, of this data point\n * @param value the value of this data point\n * @param sumRepeatedTimeStampValues if timestamp
has an exact match in the series, this flag controls\n * whether it is replaced, or the values summed (defaults to false.)\n */\n TimeSeries.prototype.append = function(timestamp, value, sumRepeatedTimeStampValues) {\n // Rewind until we hit an older timestamp\n var i = this.data.length - 1;\n while (i >= 0 && this.data[i][0] > timestamp) {\n i--;\n }\n\n if (i === -1) {\n // This new item is the oldest data\n this.data.splice(0, 0, [timestamp, value]);\n } else if (this.data.length > 0 && this.data[i][0] === timestamp) {\n // Update existing values in the array\n if (sumRepeatedTimeStampValues) {\n // Sum this value into the existing 'bucket'\n this.data[i][1] += value;\n value = this.data[i][1];\n } else {\n // Replace the previous value\n this.data[i][1] = value;\n }\n } else if (i < this.data.length - 1) {\n // Splice into the correct position to keep timestamps in order\n this.data.splice(i + 1, 0, [timestamp, value]);\n } else {\n // Add to the end of the array\n this.data.push([timestamp, value]);\n }\n\n this.maxValue = isNaN(this.maxValue) ? value : Math.max(this.maxValue, value);\n this.minValue = isNaN(this.minValue) ? value : Math.min(this.minValue, value);\n };\n\n TimeSeries.prototype.dropOldData = function(oldestValidTime, maxDataSetLength) {\n // We must always keep one expired data point as we need this to draw the\n // line that comes into the chart from the left, but any points prior to that can be removed.\n var removeCount = 0;\n while (this.data.length - removeCount >= maxDataSetLength && this.data[removeCount + 1][0] < oldestValidTime) {\n removeCount++;\n }\n if (removeCount !== 0) {\n this.data.splice(0, removeCount);\n }\n };\n\n /**\n * Initialises a new SmoothieChart
.\n *\n * Options are optional, and should be of the form below. Just specify the values you\n * need and the rest will be given sensible defaults as shown:\n *\n * \n * {\n * minValue: undefined, // specify to clamp the lower y-axis to a given value\n * maxValue: undefined, // specify to clamp the upper y-axis to a given value\n * maxValueScale: 1, // allows proportional padding to be added above the chart. for 10% padding, specify 1.1.\n * minValueScale: 1, // allows proportional padding to be added below the chart. for 10% padding, specify 1.1.\n * yRangeFunction: undefined, // function({min: , max: }) { return {min: , max: }; }\n * scaleSmoothing: 0.125, // controls the rate at which y-value zoom animation occurs\n * millisPerPixel: 20, // sets the speed at which the chart pans by\n * enableDpiScaling: true, // support rendering at different DPI depending on the device\n * yMinFormatter: function(min, precision) { // callback function that formats the min y value label\n * return parseFloat(min).toFixed(precision);\n * },\n * yMaxFormatter: function(max, precision) { // callback function that formats the max y value label\n * return parseFloat(max).toFixed(precision);\n * },\n * yIntermediateFormatter: function(intermediate, precision) { // callback function that formats the intermediate y value labels\n * return parseFloat(intermediate).toFixed(precision);\n * },\n * maxDataSetLength: 2,\n * interpolation: 'bezier' // one of 'bezier', 'linear', or 'step'\n * timestampFormatter: null, // optional function to format time stamps for bottom of chart\n * // you may use SmoothieChart.timeFormatter, or your own: function(date) { return ''; }\n * scrollBackwards: false, // reverse the scroll direction of the chart\n * horizontalLines: [], // [ { value: 0, color: '#ffffff', lineWidth: 1 } ]\n * grid:\n * {\n * fillStyle: '#000000', // the background colour of the chart\n * lineWidth: 1, // the pixel width of grid lines\n * strokeStyle: '#777777', // colour of grid lines\n * millisPerLine: 1000, // distance between vertical grid lines\n * sharpLines: false, // controls whether grid lines are 1px sharp, or softened\n * verticalSections: 2, // number of vertical sections marked out by horizontal grid lines\n * borderVisible: true // whether the grid lines trace the border of the chart or not\n * },\n * labels\n * {\n * disabled: false, // enables/disables labels showing the min/max values\n * fillStyle: '#ffffff', // colour for text of labels,\n * fontSize: 15,\n * fontFamily: 'sans-serif',\n * precision: 2,\n * showIntermediateLabels: false, // shows intermediate labels between min and max values along y axis\n * intermediateLabelSameAxis: true,\n * },\n * tooltip: false // show tooltip when mouse is over the chart\n * tooltipLine: { // properties for a vertical line at the cursor position\n * lineWidth: 1,\n * strokeStyle: '#BBBBBB'\n * },\n * tooltipFormatter: SmoothieChart.tooltipFormatter, // formatter function for tooltip text\n * nonRealtimeData: false, // use time of latest data as current time\n * displayDataFromPercentile: 1, // display not latest data, but data from the given percentile\n * // useful when trying to see old data saved by setting a high value for maxDataSetLength\n * // should be a value between 0 and 1\n * responsive: false, // whether the chart should adapt to the size of the canvas\n * limitFPS: 0 // maximum frame rate the chart will render at, in FPS (zero means no limit)\n * }\n *\n *\n * @constructor\n */\n function SmoothieChart(options) {\n this.options = Util.extend({}, SmoothieChart.defaultChartOptions, options);\n this.seriesSet = [];\n this.currentValueRange = 1;\n this.currentVisMinValue = 0;\n this.lastRenderTimeMillis = 0;\n this.lastChartTimestamp = 0;\n\n this.mousemove = this.mousemove.bind(this);\n this.mouseout = this.mouseout.bind(this);\n }\n\n /** Formats the HTML string content of the tooltip. */\n SmoothieChart.tooltipFormatter = function (timestamp, data) {\n var timestampFormatter = this.options.timestampFormatter || SmoothieChart.timeFormatter,\n lines = [timestampFormatter(new Date(timestamp))];\n\n for (var i = 0; i < data.length; ++i) {\n lines.push('' +\n this.options.yMaxFormatter(data[i].value, this.options.labels.precision) + '');\n }\n\n return lines.join('
TimeSeries
to this chart, with optional presentation options.\n *\n * Presentation options should be of the form (defaults shown):\n *\n * \n * {\n * lineWidth: 1,\n * strokeStyle: '#ffffff',\n * fillStyle: undefined\n * }\n *\n */\n SmoothieChart.prototype.addTimeSeries = function(timeSeries, options) {\n this.seriesSet.push({timeSeries: timeSeries, options: Util.extend({}, SmoothieChart.defaultSeriesPresentationOptions, options)});\n if (timeSeries.options.resetBounds && timeSeries.options.resetBoundsInterval > 0) {\n timeSeries.resetBoundsTimerId = setInterval(\n function() {\n timeSeries.resetBounds();\n },\n timeSeries.options.resetBoundsInterval\n );\n }\n };\n\n /**\n * Removes the specified
TimeSeries
from the chart.\n */\n SmoothieChart.prototype.removeTimeSeries = function(timeSeries) {\n // Find the correct timeseries to remove, and remove it\n var numSeries = this.seriesSet.length;\n for (var i = 0; i < numSeries; i++) {\n if (this.seriesSet[i].timeSeries === timeSeries) {\n this.seriesSet.splice(i, 1);\n break;\n }\n }\n // If a timer was operating for that timeseries, remove it\n if (timeSeries.resetBoundsTimerId) {\n // Stop resetting the bounds, if we were\n clearInterval(timeSeries.resetBoundsTimerId);\n }\n };\n\n /**\n * Gets render options for the specified TimeSeries
.\n *\n * As you may use a single TimeSeries
in multiple charts with different formatting in each usage,\n * these settings are stored in the chart.\n */\n SmoothieChart.prototype.getTimeSeriesOptions = function(timeSeries) {\n // Find the correct timeseries to remove, and remove it\n var numSeries = this.seriesSet.length;\n for (var i = 0; i < numSeries; i++) {\n if (this.seriesSet[i].timeSeries === timeSeries) {\n return this.seriesSet[i].options;\n }\n }\n };\n\n /**\n * Brings the specified TimeSeries
to the top of the chart. It will be rendered last.\n */\n SmoothieChart.prototype.bringToFront = function(timeSeries) {\n // Find the correct timeseries to remove, and remove it\n var numSeries = this.seriesSet.length;\n for (var i = 0; i < numSeries; i++) {\n if (this.seriesSet[i].timeSeries === timeSeries) {\n var set = this.seriesSet.splice(i, 1);\n this.seriesSet.push(set[0]);\n break;\n }\n }\n };\n\n /**\n * Instructs the SmoothieChart
to start rendering to the provided canvas, with specified delay.\n *\n * @param canvas the target canvas element\n * @param delayMillis an amount of time to wait before a data point is shown. This can prevent the end of the series\n * from appearing on screen, with new values flashing into view, at the expense of some latency.\n */\n SmoothieChart.prototype.streamTo = function(canvas, delayMillis) {\n this.canvas = canvas;\n this.delay = delayMillis;\n this.start();\n };\n\n SmoothieChart.prototype.getTooltipEl = function () {\n // Create the tool tip element lazily\n if (!this.tooltipEl) {\n this.tooltipEl = document.createElement('div');\n this.tooltipEl.className = 'smoothie-chart-tooltip';\n this.tooltipEl.style.position = 'absolute';\n this.tooltipEl.style.display = 'none';\n document.body.appendChild(this.tooltipEl);\n }\n return this.tooltipEl;\n };\n\n SmoothieChart.prototype.updateTooltip = function () {\n var el = this.getTooltipEl();\n\n if (!this.mouseover || !this.options.tooltip) {\n el.style.display = 'none';\n return;\n }\n\n var time = this.lastChartTimestamp;\n\n // x pixel to time\n var t = this.options.scrollBackwards\n ? time - this.mouseX * this.options.millisPerPixel\n : time - (this.canvas.offsetWidth - this.mouseX) * this.options.millisPerPixel;\n\n var data = [];\n\n // For each data set...\n for (var d = 0; d < this.seriesSet.length; d++) {\n var timeSeries = this.seriesSet[d].timeSeries;\n if (timeSeries.disabled) {\n continue;\n }\n\n // find datapoint closest to time 't'\n var closeIdx = Util.binarySearch(timeSeries.data, t);\n if (closeIdx > 0 && closeIdx < timeSeries.data.length) {\n data.push({ series: this.seriesSet[d], index: closeIdx, value: timeSeries.data[closeIdx][1] });\n }\n }\n\n if (data.length) {\n el.innerHTML = this.options.tooltipFormatter.call(this, t, data);\n el.style.display = 'block';\n } else {\n el.style.display = 'none';\n }\n };\n\n SmoothieChart.prototype.mousemove = function (evt) {\n this.mouseover = true;\n this.mouseX = evt.offsetX;\n this.mouseY = evt.offsetY;\n this.mousePageX = evt.pageX;\n this.mousePageY = evt.pageY;\n\n var el = this.getTooltipEl();\n el.style.top = Math.round(this.mousePageY) + 'px';\n el.style.left = Math.round(this.mousePageX) + 'px';\n this.updateTooltip();\n };\n\n SmoothieChart.prototype.mouseout = function () {\n this.mouseover = false;\n this.mouseX = this.mouseY = -1;\n if (this.tooltipEl)\n this.tooltipEl.style.display = 'none';\n };\n\n /**\n * Make sure the canvas has the optimal resolution for the device's pixel ratio.\n */\n SmoothieChart.prototype.resize = function () {\n var dpr = !this.options.enableDpiScaling || !window ? 1 : window.devicePixelRatio,\n width, height;\n if (this.options.responsive) {\n // Newer behaviour: Use the canvas's size in the layout, and set the internal\n // resolution according to that size and the device pixel ratio (eg: high DPI)\n width = this.canvas.offsetWidth;\n height = this.canvas.offsetHeight;\n\n if (width !== this.lastWidth) {\n this.lastWidth = width;\n this.canvas.setAttribute('width', (Math.floor(width * dpr)).toString());\n this.canvas.getContext('2d').scale(dpr, dpr);\n }\n if (height !== this.lastHeight) {\n this.lastHeight = height;\n this.canvas.setAttribute('height', (Math.floor(height * dpr)).toString());\n this.canvas.getContext('2d').scale(dpr, dpr);\n }\n } else if (dpr !== 1) {\n // Older behaviour: use the canvas's inner dimensions and scale the element's size\n // according to that size and the device pixel ratio (eg: high DPI)\n width = parseInt(this.canvas.getAttribute('width'));\n height = parseInt(this.canvas.getAttribute('height'));\n\n if (!this.originalWidth || (Math.floor(this.originalWidth * dpr) !== width)) {\n this.originalWidth = width;\n this.canvas.setAttribute('width', (Math.floor(width * dpr)).toString());\n this.canvas.style.width = width + 'px';\n this.canvas.getContext('2d').scale(dpr, dpr);\n }\n\n if (!this.originalHeight || (Math.floor(this.originalHeight * dpr) !== height)) {\n this.originalHeight = height;\n this.canvas.setAttribute('height', (Math.floor(height * dpr)).toString());\n this.canvas.style.height = height + 'px';\n this.canvas.getContext('2d').scale(dpr, dpr);\n }\n }\n };\n\n /**\n * Starts the animation of this chart.\n */\n SmoothieChart.prototype.start = function() {\n if (this.frame) {\n // We're already running, so just return\n return;\n }\n\n this.canvas.addEventListener('mousemove', this.mousemove);\n this.canvas.addEventListener('mouseout', this.mouseout);\n\n // Renders a frame, and queues the next frame for later rendering\n var animate = function() {\n this.frame = SmoothieChart.AnimateCompatibility.requestAnimationFrame(function() {\n if(this.options.nonRealtimeData){\n var dateZero = new Date(0);\n // find the data point with the latest timestamp\n var maxTimeStamp = this.seriesSet.reduce(function(max, series){\n var dataSet = series.timeSeries.data;\n var indexToCheck = Math.round(this.options.displayDataFromPercentile * dataSet.length) - 1;\n indexToCheck = indexToCheck >= 0 ? indexToCheck : 0;\n indexToCheck = indexToCheck <= dataSet.length -1 ? indexToCheck : dataSet.length -1;\n if(dataSet && dataSet.length > 0)\n {\n // timestamp corresponds to element 0 of the data point\n var lastDataTimeStamp = dataSet[indexToCheck][0];\n max = max > lastDataTimeStamp ? max : lastDataTimeStamp;\n }\n return max;\n }.bind(this), dateZero);\n // use the max timestamp as current time\n this.render(this.canvas, maxTimeStamp > dateZero ? maxTimeStamp : null);\n } else {\n this.render();\n }\n animate();\n }.bind(this));\n }.bind(this);\n\n animate();\n };\n\n /**\n * Stops the animation of this chart.\n */\n SmoothieChart.prototype.stop = function() {\n if (this.frame) {\n SmoothieChart.AnimateCompatibility.cancelAnimationFrame(this.frame);\n delete this.frame;\n this.canvas.removeEventListener('mousemove', this.mousemove);\n this.canvas.removeEventListener('mouseout', this.mouseout);\n }\n };\n\n SmoothieChart.prototype.updateValueRange = function() {\n // Calculate the current scale of the chart, from all time series.\n var chartOptions = this.options,\n chartMaxValue = Number.NaN,\n chartMinValue = Number.NaN;\n\n for (var d = 0; d < this.seriesSet.length; d++) {\n // TODO(ndunn): We could calculate / track these values as they stream in.\n var timeSeries = this.seriesSet[d].timeSeries;\n if (timeSeries.disabled) {\n continue;\n }\n\n if (!isNaN(timeSeries.maxValue)) {\n chartMaxValue = !isNaN(chartMaxValue) ? Math.max(chartMaxValue, timeSeries.maxValue) : timeSeries.maxValue;\n }\n\n if (!isNaN(timeSeries.minValue)) {\n chartMinValue = !isNaN(chartMinValue) ? Math.min(chartMinValue, timeSeries.minValue) : timeSeries.minValue;\n }\n }\n\n // Scale the chartMaxValue to add padding at the top if required\n if (chartOptions.maxValue != null) {\n chartMaxValue = chartOptions.maxValue;\n } else {\n chartMaxValue *= chartOptions.maxValueScale;\n }\n\n // Set the minimum if we've specified one\n if (chartOptions.minValue != null) {\n chartMinValue = chartOptions.minValue;\n } else {\n chartMinValue -= Math.abs(chartMinValue * chartOptions.minValueScale - chartMinValue);\n }\n\n // If a custom range function is set, call it\n if (this.options.yRangeFunction) {\n var range = this.options.yRangeFunction({min: chartMinValue, max: chartMaxValue});\n chartMinValue = range.min;\n chartMaxValue = range.max;\n }\n\n if (!isNaN(chartMaxValue) && !isNaN(chartMinValue)) {\n var targetValueRange = chartMaxValue - chartMinValue;\n var valueRangeDiff = (targetValueRange - this.currentValueRange);\n var minValueDiff = (chartMinValue - this.currentVisMinValue);\n this.isAnimatingScale = Math.abs(valueRangeDiff) > 0.1 || Math.abs(minValueDiff) > 0.1;\n this.currentValueRange += chartOptions.scaleSmoothing * valueRangeDiff;\n this.currentVisMinValue += chartOptions.scaleSmoothing * minValueDiff;\n }\n\n this.valueRange = { min: chartMinValue, max: chartMaxValue };\n };\n\n SmoothieChart.prototype.render = function(canvas, time) {\n var nowMillis = Date.now();\n\n // Respect any frame rate limit.\n if (this.options.limitFPS > 0 && nowMillis - this.lastRenderTimeMillis < (1000/this.options.limitFPS))\n return;\n\n if (!this.isAnimatingScale) {\n // We're not animating. We can use the last render time and the scroll speed to work out whether\n // we actually need to paint anything yet. If not, we can return immediately.\n\n // Render at least every 1/6th of a second. The canvas may be resized, which there is\n // no reliable way to detect.\n var maxIdleMillis = Math.min(1000/6, this.options.millisPerPixel);\n\n if (nowMillis - this.lastRenderTimeMillis < maxIdleMillis) {\n return;\n }\n }\n\n this.resize();\n this.updateTooltip();\n\n this.lastRenderTimeMillis = nowMillis;\n\n canvas = canvas || this.canvas;\n time = time || nowMillis - (this.delay || 0);\n\n // Round time down to pixel granularity, so motion appears smoother.\n time -= time % this.options.millisPerPixel;\n\n this.lastChartTimestamp = time;\n\n var context = canvas.getContext('2d'),\n chartOptions = this.options,\n dimensions = { top: 0, left: 0, width: canvas.clientWidth, height: canvas.clientHeight },\n // Calculate the threshold time for the oldest data points.\n oldestValidTime = time - (dimensions.width * chartOptions.millisPerPixel),\n valueToYPixel = function(value) {\n var offset = value - this.currentVisMinValue;\n return this.currentValueRange === 0\n ? dimensions.height\n : dimensions.height - (Math.round((offset / this.currentValueRange) * dimensions.height));\n }.bind(this),\n timeToXPixel = function(t) {\n if(chartOptions.scrollBackwards) {\n return Math.round((time - t) / chartOptions.millisPerPixel);\n }\n return Math.round(dimensions.width - ((time - t) / chartOptions.millisPerPixel));\n };\n\n this.updateValueRange();\n\n context.font = chartOptions.labels.fontSize + 'px ' + chartOptions.labels.fontFamily;\n\n // Save the state of the canvas context, any transformations applied in this method\n // will get removed from the stack at the end of this method when .restore() is called.\n context.save();\n\n // Move the origin.\n context.translate(dimensions.left, dimensions.top);\n\n // Create a clipped rectangle - anything we draw will be constrained to this rectangle.\n // This prevents the occasional pixels from curves near the edges overrunning and creating\n // screen cheese (that phrase should need no explanation).\n context.beginPath();\n context.rect(0, 0, dimensions.width, dimensions.height);\n context.clip();\n\n // Clear the working area.\n context.save();\n context.fillStyle = chartOptions.grid.fillStyle;\n context.clearRect(0, 0, dimensions.width, dimensions.height);\n context.fillRect(0, 0, dimensions.width, dimensions.height);\n context.restore();\n\n // Grid lines...\n context.save();\n context.lineWidth = chartOptions.grid.lineWidth;\n context.strokeStyle = chartOptions.grid.strokeStyle;\n // Vertical (time) dividers.\n if (chartOptions.grid.millisPerLine > 0) {\n context.beginPath();\n for (var t = time - (time % chartOptions.grid.millisPerLine);\n t >= oldestValidTime;\n t -= chartOptions.grid.millisPerLine) {\n var gx = timeToXPixel(t);\n if (chartOptions.grid.sharpLines) {\n gx -= 0.5;\n }\n context.moveTo(gx, 0);\n context.lineTo(gx, dimensions.height);\n }\n context.stroke();\n context.closePath();\n }\n\n // Horizontal (value) dividers.\n for (var v = 1; v < chartOptions.grid.verticalSections; v++) {\n var gy = Math.round(v * dimensions.height / chartOptions.grid.verticalSections);\n if (chartOptions.grid.sharpLines) {\n gy -= 0.5;\n }\n context.beginPath();\n context.moveTo(0, gy);\n context.lineTo(dimensions.width, gy);\n context.stroke();\n context.closePath();\n }\n // Bounding rectangle.\n if (chartOptions.grid.borderVisible) {\n context.beginPath();\n context.strokeRect(0, 0, dimensions.width, dimensions.height);\n context.closePath();\n }\n context.restore();\n\n // Draw any horizontal lines...\n if (chartOptions.horizontalLines && chartOptions.horizontalLines.length) {\n for (var hl = 0; hl < chartOptions.horizontalLines.length; hl++) {\n var line = chartOptions.horizontalLines[hl],\n hly = Math.round(valueToYPixel(line.value)) - 0.5;\n context.strokeStyle = line.color || '#ffffff';\n context.lineWidth = line.lineWidth || 1;\n context.beginPath();\n context.moveTo(0, hly);\n context.lineTo(dimensions.width, hly);\n context.stroke();\n context.closePath();\n }\n }\n\n // For each data set...\n for (var d = 0; d < this.seriesSet.length; d++) {\n context.save();\n var timeSeries = this.seriesSet[d].timeSeries;\n if (timeSeries.disabled) {\n continue;\n }\n\n var dataSet = timeSeries.data,\n seriesOptions = this.seriesSet[d].options;\n\n // Delete old data that's moved off the left of the chart.\n timeSeries.dropOldData(oldestValidTime, chartOptions.maxDataSetLength);\n\n // Set style for this dataSet.\n context.lineWidth = seriesOptions.lineWidth;\n context.strokeStyle = seriesOptions.strokeStyle;\n // Draw the line...\n context.beginPath();\n // Retain lastX, lastY for calculating the control points of bezier curves.\n var firstX = 0, lastX = 0, lastY = 0;\n for (var i = 0; i < dataSet.length && dataSet.length !== 1; i++) {\n var x = timeToXPixel(dataSet[i][0]),\n y = valueToYPixel(dataSet[i][1]);\n\n if (i === 0) {\n firstX = x;\n context.moveTo(x, y);\n } else {\n switch (chartOptions.interpolation) {\n case \"linear\":\n case \"line\": {\n context.lineTo(x,y);\n break;\n }\n case \"bezier\":\n default: {\n // Great explanation of Bezier curves: http://en.wikipedia.org/wiki/Bezier_curve#Quadratic_curves\n //\n // Assuming A was the last point in the line plotted and B is the new point,\n // we draw a curve with control points P and Q as below.\n //\n // A---P\n // |\n // |\n // |\n // Q---B\n //\n // Importantly, A and P are at the same y coordinate, as are B and Q. This is\n // so adjacent curves appear to flow as one.\n //\n context.bezierCurveTo( // startPoint (A) is implicit from last iteration of loop\n Math.round((lastX + x) / 2), lastY, // controlPoint1 (P)\n Math.round((lastX + x)) / 2, y, // controlPoint2 (Q)\n x, y); // endPoint (B)\n break;\n }\n case \"step\": {\n context.lineTo(x,lastY);\n context.lineTo(x,y);\n break;\n }\n }\n }\n\n lastX = x; lastY = y;\n }\n\n if (dataSet.length > 1) {\n if (seriesOptions.fillStyle) {\n // Close up the fill region.\n context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, lastY);\n context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, dimensions.height + seriesOptions.lineWidth + 1);\n context.lineTo(firstX, dimensions.height + seriesOptions.lineWidth);\n context.fillStyle = seriesOptions.fillStyle;\n context.fill();\n }\n\n if (seriesOptions.strokeStyle && seriesOptions.strokeStyle !== 'none') {\n context.stroke();\n }\n context.closePath();\n }\n context.restore();\n }\n\n if (chartOptions.tooltip && this.mouseX >= 0) {\n // Draw vertical bar to show tooltip position\n context.lineWidth = chartOptions.tooltipLine.lineWidth;\n context.strokeStyle = chartOptions.tooltipLine.strokeStyle;\n context.beginPath();\n context.moveTo(this.mouseX, 0);\n context.lineTo(this.mouseX, dimensions.height);\n context.closePath();\n context.stroke();\n this.updateTooltip();\n }\n\n // Draw the axis values on the chart.\n if (!chartOptions.labels.disabled && !isNaN(this.valueRange.min) && !isNaN(this.valueRange.max)) {\n var maxValueString = chartOptions.yMaxFormatter(this.valueRange.max, chartOptions.labels.precision),\n minValueString = chartOptions.yMinFormatter(this.valueRange.min, chartOptions.labels.precision),\n maxLabelPos = chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(maxValueString).width - 2,\n minLabelPos = chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(minValueString).width - 2;\n context.fillStyle = chartOptions.labels.fillStyle;\n context.fillText(maxValueString, maxLabelPos, chartOptions.labels.fontSize);\n context.fillText(minValueString, minLabelPos, dimensions.height - 2);\n }\n\n // Display intermediate y axis labels along y-axis to the left of the chart\n if ( chartOptions.labels.showIntermediateLabels\n && !isNaN(this.valueRange.min) && !isNaN(this.valueRange.max)\n && chartOptions.grid.verticalSections > 0) {\n // show a label above every vertical section divider\n var step = (this.valueRange.max - this.valueRange.min) / chartOptions.grid.verticalSections;\n var stepPixels = dimensions.height / chartOptions.grid.verticalSections;\n for (var v = 1; v < chartOptions.grid.verticalSections; v++) {\n var gy = dimensions.height - Math.round(v * stepPixels);\n if (chartOptions.grid.sharpLines) {\n gy -= 0.5;\n }\n var yValue = chartOptions.yIntermediateFormatter(this.valueRange.min + (v * step), chartOptions.labels.precision);\n //left of right axis?\n intermediateLabelPos =\n chartOptions.labels.intermediateLabelSameAxis\n ? (chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(yValue).width - 2)\n : (chartOptions.scrollBackwards ? dimensions.width - context.measureText(yValue).width - 2 : 0);\n\n context.fillText(yValue, intermediateLabelPos, gy - chartOptions.grid.lineWidth);\n }\n }\n\n // Display timestamps along x-axis at the bottom of the chart.\n if (chartOptions.timestampFormatter && chartOptions.grid.millisPerLine > 0) {\n var textUntilX = chartOptions.scrollBackwards\n ? context.measureText(minValueString).width\n : dimensions.width - context.measureText(minValueString).width + 4;\n for (var t = time - (time % chartOptions.grid.millisPerLine);\n t >= oldestValidTime;\n t -= chartOptions.grid.millisPerLine) {\n var gx = timeToXPixel(t);\n // Only draw the timestamp if it won't overlap with the previously drawn one.\n if ((!chartOptions.scrollBackwards && gx < textUntilX) || (chartOptions.scrollBackwards && gx > textUntilX)) {\n // Formats the timestamp based on user specified formatting function\n // SmoothieChart.timeFormatter function above is one such formatting option\n var tx = new Date(t),\n ts = chartOptions.timestampFormatter(tx),\n tsWidth = context.measureText(ts).width;\n\n textUntilX = chartOptions.scrollBackwards\n ? gx + tsWidth + 2\n : gx - tsWidth - 2;\n\n context.fillStyle = chartOptions.labels.fillStyle;\n if(chartOptions.scrollBackwards) {\n context.fillText(ts, gx, dimensions.height - 2);\n } else {\n context.fillText(ts, gx - tsWidth, dimensions.height - 2);\n }\n }\n }\n }\n\n context.restore(); // See .save() above.\n };\n\n // Sample timestamp formatting function\n SmoothieChart.timeFormatter = function(date) {\n function pad2(number) { return (number < 10 ? '0' : '') + number }\n return pad2(date.getHours()) + ':' + pad2(date.getMinutes()) + ':' + pad2(date.getSeconds());\n };\n\n exports.TimeSeries = TimeSeries;\n exports.SmoothieChart = SmoothieChart;\n\n})(typeof exports === 'undefined' ? this : exports);\n"],"sourceRoot":""}
--------------------------------------------------------------------------------
/serial-plot-smoothie/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "serial-plot-smoothie",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "server.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node server.js"
9 | },
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "smoothie": "^1.35.0"
14 | },
15 | "devDependencies": {
16 | "webpack": "^4.21.0",
17 | "webpack-cli": "^3.1.2"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/serial-plot-smoothie/renderer.js:
--------------------------------------------------------------------------------
1 | const Smoothie = require('smoothie');
2 |
3 | const dataSets = new Array(numPlots);
4 | const charts = new Array(numPlots);
5 |
6 | // 0: green, 1st: red
7 | const chartLineColors = ['rgba(0, 255, 0, 1)', 'rgba(255, 0, 0, 1)'];
8 | const chartFillColors = ['rgba(0, 255, 0, 0.2)', 'rgba(255, 0, 0, 0.2)'];
9 |
10 | for (var i=0; i