@atjson/renderer-graphviz
Advanced tools
Comparing version 0.12.2 to 0.12.3
@@ -6,2 +6,11 @@ # Change Log | ||
## [0.12.3](https://github.com/CondeNast-Copilot/atjson/compare/@atjson/renderer-graphviz@0.12.2...@atjson/renderer-graphviz@0.12.3) (2019-03-18) | ||
### 🐛 Fixes | ||
* 🚀🐛 Performance fixes ([#119](https://github.com/CondeNast-Copilot/atjson/issues/119)) | ||
## [0.12.2](https://github.com/CondeNast-Copilot/atjson/compare/@atjson/renderer-graphviz@0.12.1...@atjson/renderer-graphviz@0.12.2) (2019-03-14) | ||
@@ -8,0 +17,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const hir_1 = require("@atjson/hir"); | ||
function getColor(annotation) { | ||
if (annotation.rank === -Infinity) { | ||
function getColor(rank) { | ||
if (rank === -Infinity) { | ||
return 'style=filled fillcolor="#000000" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 0) { | ||
else if (rank <= 0) { | ||
return 'style=filled fillcolor="#222222" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 10) { | ||
else if (rank <= 10) { | ||
return 'style=filled fillcolor="#444444" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 50) { | ||
else if (rank <= 50) { | ||
return 'style=filled fillcolor="#666666" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 100) { | ||
else if (rank <= 100) { | ||
return 'style=filled fillcolor="#888888" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 1000) { | ||
else if (rank <= 1000) { | ||
return 'style=filled fillcolor="#AAAAAA" fontcolor="#000000"'; | ||
} | ||
else if (annotation.rank <= Number.MAX_SAFE_INTEGER) { | ||
else if (rank <= Number.MAX_SAFE_INTEGER) { | ||
return 'style=filled fillcolor="#CCCCCC" fontcolor="#000000"'; | ||
@@ -33,4 +33,4 @@ } | ||
let text = hirNode.type; | ||
if (hirNode.type === 'text' && hirNode.annotation.attributes.text != null) { | ||
text = hirNode.annotation.attributes.text; | ||
if (hirNode.type === 'text' && hirNode.text != null) { | ||
text = hirNode.text; | ||
} | ||
@@ -43,3 +43,3 @@ else { | ||
label: hirNode.type, | ||
color: getColor(hirNode.annotation), | ||
color: getColor(hirNode.rank), | ||
text | ||
@@ -74,2 +74,2 @@ }; | ||
exports.default = GraphvizRenderer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxxQ0FBMkM7QUFTM0MsU0FBUyxRQUFRLENBQUMsVUFBc0I7SUFDdEMsSUFBSSxVQUFVLENBQUMsSUFBSSxLQUFLLENBQUMsUUFBUSxFQUFFO1FBQ2pDLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksQ0FBQyxFQUFFO1FBQy9CLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksRUFBRSxFQUFFO1FBQ2hDLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksRUFBRSxFQUFFO1FBQ2hDLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksR0FBRyxFQUFFO1FBQ2pDLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksSUFBSSxFQUFFO1FBQ2xDLE9BQU8sc0RBQXNELENBQUM7S0FDL0Q7U0FBTSxJQUFJLFVBQVUsQ0FBQyxJQUFJLElBQUksTUFBTSxDQUFDLGdCQUFnQixFQUFFO1FB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{ | ||
if (annotation.rank === -Infinity) { | ||
function getColor(rank) { | ||
if (rank === -Infinity) { | ||
return 'style=filled fillcolor="#000000" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 0) { | ||
else if (rank <= 0) { | ||
return 'style=filled fillcolor="#222222" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 10) { | ||
else if (rank <= 10) { | ||
return 'style=filled fillcolor="#444444" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 50) { | ||
else if (rank <= 50) { | ||
return 'style=filled fillcolor="#666666" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 100) { | ||
else if (rank <= 100) { | ||
return 'style=filled fillcolor="#888888" fontcolor="#FFFFFF"'; | ||
} | ||
else if (annotation.rank <= 1000) { | ||
else if (rank <= 1000) { | ||
return 'style=filled fillcolor="#AAAAAA" fontcolor="#000000"'; | ||
} | ||
else if (annotation.rank <= Number.MAX_SAFE_INTEGER) { | ||
else if (rank <= Number.MAX_SAFE_INTEGER) { | ||
return 'style=filled fillcolor="#CCCCCC" fontcolor="#000000"'; | ||
@@ -31,4 +31,4 @@ } | ||
let text = hirNode.type; | ||
if (hirNode.type === 'text' && hirNode.annotation.attributes.text != null) { | ||
text = hirNode.annotation.attributes.text; | ||
if (hirNode.type === 'text' && hirNode.text != null) { | ||
text = hirNode.text; | ||
} | ||
@@ -41,3 +41,3 @@ else { | ||
label: hirNode.type, | ||
color: getColor(hirNode.annotation), | ||
color: getColor(hirNode.rank), | ||
text | ||
@@ -71,2 +71,2 @@ }; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLEdBQUcsRUFBVyxNQUFNLGFBQWEsQ0FBQzt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BQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDbkY7YUFBTTtZQUNMLEdBQUcsR0FBRyxLQUFLLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsS0FBSyxJQUFJLENBQUMsRUFBRSxZQUFZLElBQUksQ0FBQyxLQUFLLE1BQU0sSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxLQUFLLElBQUksQ0FBQyxLQUFLLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxJQUFJO2dCQUM5SCxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxNQUFNLEVBQUUsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLEtBQUssTUFBTSxDQUFDLEVBQUUsT0FBTyxLQUFLLENBQUMsRUFBRSxHQUFHLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDbkY7UUFFRCxPQUFPO2dCQUNLLE9BQU8sQ0FBQyxLQUFLO0VBQzNCLEdBQUc7RUFDSCxDQUFDO0lBQ0QsQ0FBQztDQUNGIn0= |
{ | ||
"name": "@atjson/renderer-graphviz", | ||
"version": "0.12.2", | ||
"version": "0.12.3", | ||
"description": "Render documents into graphs to help with debugging", | ||
@@ -19,6 +19,6 @@ "main": "dist/commonjs/index.js", | ||
"dependencies": { | ||
"@atjson/document": "0.14.3", | ||
"@atjson/hir": "0.11.11" | ||
"@atjson/document": "0.14.4", | ||
"@atjson/hir": "0.11.12" | ||
}, | ||
"gitHead": "877b2a4a26a94da04757e7dcb9c536114c54669e" | ||
"gitHead": "8ada7433b51c67064c4b6fd2fa88108967558265" | ||
} |
@@ -1,2 +0,2 @@ | ||
import Document, { Annotation } from '@atjson/document'; | ||
import Document from '@atjson/document'; | ||
import { HIR, HIRNode } from '@atjson/hir'; | ||
@@ -11,16 +11,16 @@ | ||
function getColor(annotation: Annotation) { | ||
if (annotation.rank === -Infinity) { | ||
function getColor(rank: number) { | ||
if (rank === -Infinity) { | ||
return 'style=filled fillcolor="#000000" fontcolor="#FFFFFF"'; | ||
} else if (annotation.rank <= 0) { | ||
} else if (rank <= 0) { | ||
return 'style=filled fillcolor="#222222" fontcolor="#FFFFFF"'; | ||
} else if (annotation.rank <= 10) { | ||
} else if (rank <= 10) { | ||
return 'style=filled fillcolor="#444444" fontcolor="#FFFFFF"'; | ||
} else if (annotation.rank <= 50) { | ||
} else if (rank <= 50) { | ||
return 'style=filled fillcolor="#666666" fontcolor="#FFFFFF"'; | ||
} else if (annotation.rank <= 100) { | ||
} else if (rank <= 100) { | ||
return 'style=filled fillcolor="#888888" fontcolor="#FFFFFF"'; | ||
} else if (annotation.rank <= 1000) { | ||
} else if (rank <= 1000) { | ||
return 'style=filled fillcolor="#AAAAAA" fontcolor="#000000"'; | ||
} else if (annotation.rank <= Number.MAX_SAFE_INTEGER) { | ||
} else if (rank <= Number.MAX_SAFE_INTEGER) { | ||
return 'style=filled fillcolor="#CCCCCC" fontcolor="#000000"'; | ||
@@ -35,4 +35,4 @@ } else { | ||
let text = hirNode.type; | ||
if (hirNode.type === 'text' && hirNode.annotation.attributes.text != null) { | ||
text = hirNode.annotation.attributes.text; | ||
if (hirNode.type === 'text' && hirNode.text != null) { | ||
text = hirNode.text; | ||
} else { | ||
@@ -45,3 +45,3 @@ text = JSON.stringify(hirNode.annotation.attributes); | ||
label: hirNode.type, | ||
color: getColor(hirNode.annotation), | ||
color: getColor(hirNode.rank), | ||
text | ||
@@ -48,0 +48,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59921
+ Added@atjson/document@0.14.4(transitive)
+ Added@atjson/hir@0.11.12(transitive)
- Removed@atjson/document@0.14.3(transitive)
- Removed@atjson/hir@0.11.11(transitive)
Updated@atjson/document@0.14.4
Updated@atjson/hir@0.11.12