UNPKG

react-digraph

Version:
225 lines (224 loc) 6.93 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for src/utilities/layout-engine/layout-engine.js</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../../../prettify.css" /> <link rel="stylesheet" href="../../../base.css" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type='text/css'> .coverage-summary .sorter { background-image: url(../../../sort-arrow-sprite.png); } </style> </head> <body> <div class='wrapper'> <div class='pad1'> <h1> <a href="../../../index.html">All files</a> / <a href="index.html">src/utilities/layout-engine</a> layout-engine.js </h1> <div class='clearfix'> <div class='fl pad1y space-right2'> <span class="strong">75% </span> <span class="quiet">Statements</span> <span class='fraction'>6/8</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Branches</span> <span class='fraction'>4/4</span> </div> <div class='fl pad1y space-right2'> <span class="strong">60% </span> <span class="quiet">Functions</span> <span class='fraction'>3/5</span> </div> <div class='fl pad1y space-right2'> <span class="strong">75% </span> <span class="quiet">Lines</span> <span class='fraction'>6/8</span> </div> </div> </div> <div class='status-line medium'></div> <pre><table class="coverage"> <tr><td class="line-count quiet">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">153x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">98x</span> <span class="cline-any cline-yes">52x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">52x</span> <span class="cline-any cline-yes">52x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">98x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// @flow /* Copyright(c) 2018 Uber Technologies, Inc. &nbsp; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at &nbsp; http://www.apache.org/licenses/LICENSE-2.0 &nbsp; Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ &nbsp; // import { type IGraphViewProps } from '../../components/graph-view'; import { type IGraphViewProps } from '../../components/graph-view-props'; import { type INode } from '../../components/node'; &nbsp; export type IPosition = { x: number; y: number; [key: string]: any; }; &nbsp; export default class LayoutEngine { graphViewProps: IGraphViewProps; constructor(graphViewProps: IGraphViewProps) { this.graphViewProps = graphViewProps; } &nbsp; <span class="fstat-no" title="function not covered" > ca</span>lculatePosition(node: IPosition) { <span class="cstat-no" title="statement not covered" > return node;</span> } &nbsp; adjustNodes(nodes: INode[], nodesMap?: any): INode[] { nodes.forEach((node) =&gt; { const position = this.calculatePosition({ x: node.x || 0, y: node.y || 0 }); node.x = position.x; node.y = position.y; }); return nodes; } &nbsp; <span class="fstat-no" title="function not covered" > ge</span>tPositionForNode(node: IPosition): IPosition { <span class="cstat-no" title="statement not covered" > return this.calculatePosition(node);</span> } } &nbsp;</pre></td></tr> </table></pre> <div class='push'></div><!-- for sticky footer --> </div><!-- /wrapper --> <div class='footer quiet pad2 space-top1 center small'> Code coverage generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Oct 02 2018 14:30:12 GMT-0700 (PDT) </div> </div> <script src="../../../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../../../sorter.js"></script> </body> </html>