Skip to content

Commit

Permalink
chore: 🤖 use module classes for ogdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxy1998 committed Sep 10, 2021
1 parent ca8b2f0 commit 675e7a1
Show file tree
Hide file tree
Showing 67 changed files with 5,662 additions and 2,051 deletions.
64 changes: 64 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,69 @@
}
]
}
},
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
}
}
19 changes: 15 additions & 4 deletions examples/miserables-sm.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div id="main" />
</body>
<script src="https://unpkg.com/netv/build/NetV.js"></script>
<script src="../../packages/ogdf.js/dist/ogdf.js"></script>
<script src="../packages/ogdf.js/dist/ogdf.js"></script>
<script>
const width = 500
const height = 500
Expand All @@ -18,7 +18,17 @@
miserables.links.forEach((link) => {
link.weight = Math.random()
})
const layout = new ogdf.layouts.layered.sugi({
// const layout = new ogdf.layouts.layered.sugi({
// graph: miserables,
// parameters: {
// edgeCosts: 100,
// numberOfPivots: 250,
// useEdgeCostsAttribute: true,
// useWorker: false
// }
// })
let layout = new ogdf.Layout({
LayoutType: ogdf.Layout.SugiyamaLayout,
graph: miserables,
parameters: {
edgeCosts: 100,
Expand All @@ -27,7 +37,7 @@
useWorker: false
}
})
layout.run().then((graph) => {
const callback = (graph) => {
// netv.data(graph)
netv.data(
NetV.Utils.transformGraphPosition(
Expand All @@ -38,6 +48,7 @@
)
)
netv.draw()
})
}
layout.run().then(callback)
</script>
</html>
Loading

0 comments on commit 675e7a1

Please sign in to comment.