eg-renderer-ogdf
Advanced tools
Comparing version
{ | ||
"name": "eg-renderer-ogdf", | ||
"version": "1.1.0", | ||
"version": "1.3.0", | ||
"main": "src/index.js", | ||
@@ -21,3 +21,3 @@ "files": [ | ||
}, | ||
"gitHead": "a880de359f3abccd39302e311a9a1aeaa4266673" | ||
"gitHead": "4f82fe6ce79b8dfcc6b8bdf3324700741d95456b" | ||
} |
@@ -1,2 +0,2 @@ | ||
import {layout} from './layout' | ||
import { layout } from './layout' | ||
@@ -9,11 +9,8 @@ const egRendererTagName = 'eg-renderer' | ||
class EgRendererOGDFElement extends EgRendererElement { | ||
static get observedAttributes () { | ||
const attributes = [ | ||
'layout-method', | ||
'fmmm-unit-edge-length' | ||
] | ||
static get observedAttributes() { | ||
const attributes = ['layout-method', 'fmmm-unit-edge-length'] | ||
return attributes.concat(EgRendererElement.observedAttributes) | ||
} | ||
attributeChangedCallback (attr, oldValue, newValue) { | ||
attributeChangedCallback(attr, oldValue, newValue) { | ||
if (attr === 'layout-method') { | ||
@@ -25,3 +22,3 @@ this.invalidatePositions() | ||
onLayout (data, preservePos) { | ||
onLayout(data, preservePos) { | ||
if (preservePos) { | ||
@@ -33,3 +30,3 @@ return | ||
get layoutMethod () { | ||
get layoutMethod() { | ||
if (!this.hasAttribute('layout-method')) { | ||
@@ -41,7 +38,7 @@ return 'fmmm' | ||
set layoutMethod (value) { | ||
set layoutMethod(value) { | ||
this.setAttribute('layout-method', value) | ||
} | ||
get fmmmUnitEdgeLength () { | ||
get fmmmUnitEdgeLength() { | ||
if (!this.hasAttribute('fmmm-unit-edge-length')) { | ||
@@ -53,3 +50,3 @@ return 20 | ||
set fmmmUnitEdgeLength (value) { | ||
set fmmmUnitEdgeLength(value) { | ||
this.setAttribute('fmmm-unit-edge-length', value) | ||
@@ -56,0 +53,0 @@ } |
@@ -37,16 +37,16 @@ import { | ||
for (const [u, v] of graphData.edgeIds) { | ||
indexToEdge.get(u).set(v, graph.newEdge(indexToNode.get(u), indexToNode.get(v))) | ||
indexToEdge | ||
.get(u) | ||
.set(v, graph.newEdge(indexToNode.get(u), indexToNode.get(v))) | ||
} | ||
const { | ||
nodeGraphics, | ||
edgeGraphics, | ||
nodeStyle, | ||
edgeStyle | ||
} = GraphAttributes | ||
const attributes = new GraphAttributes(graph, nodeGraphics | edgeGraphics | nodeStyle | edgeStyle) | ||
const { nodeGraphics, edgeGraphics, nodeStyle, edgeStyle } = GraphAttributes | ||
const attributes = new GraphAttributes( | ||
graph, | ||
nodeGraphics | edgeGraphics | nodeStyle | edgeStyle | ||
) | ||
const nodes = new NodeList() | ||
graph.allNodes(nodes) | ||
for (const u of graphData.vertexIds) { | ||
const {width, height} = graphData.vertices.get(u) | ||
const { width, height } = graphData.vertices.get(u) | ||
const node = indexToNode.get(u) | ||
@@ -53,0 +53,0 @@ attributes.setWidth(node, width) |
5289
-0.36%120
-2.44%