Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test query visualizer #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions query visualizer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jsonld-vis example</title>
<script src="https://d3js.org/d3.v3.js"></script>
<script src="http://biohackathon.org/d3sparql/d3sparql.js"></script>
<script src="index.js"></script>

</head>
<body>
<form>
<input id="endpoint" value="http://dbpedia.org/sparql" type="text">
<textarea id="sparql">
PREFIX ...
SELECT ...
WHERE { ... }
</textarea>
</form>
<button onclick="exec()">Query</button>
<div id="result"></div>
</body>
</html>
13 changes: 13 additions & 0 deletions query visualizer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function exec() {
var endpoint = d3.select("#endpoint").property("value")
var sparql = d3.select("#sparql").property("value")
d3sparql.query(endpoint, sparql, render)
}
function render(json) {
// set options and call the d3sparql.xxxxx visualization methods in this library ...
var config = {
"margin": {"top": 10, "right": 10, "bottom": 10, "left": 10},
"selector": "#result"
}
d3sparql.forcegraph(json, config)
}