Skip to content

Commit

Permalink
Merge pull request #3 from gkirtzou/master
Browse files Browse the repository at this point in the history
Adding visualization to documentation
  • Loading branch information
gkirtzou authored Jan 29, 2018
2 parents c7f46ed + d937dc1 commit c49705f
Show file tree
Hide file tree
Showing 6 changed files with 978 additions and 10 deletions.
35 changes: 25 additions & 10 deletions OnToology/omtd-share-ontology.owl/documentation/index-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="resources/primer.css" media="screen" /> <link rel="stylesheet" href="resources/rec.css" media="screen" /> <link rel="stylesheet" href="resources/extra.css" media="screen" /> <link rel="stylesheet" href="resources/owl.css" media="screen" />
<link rel="stylesheet" href="resources/primer.css" media="screen" />
<link rel="stylesheet" href="resources/rec.css" media="screen" />
<link rel="stylesheet" href="resources/extra.css" media="screen" />
<link rel="stylesheet" href="resources/owl.css" media="screen" />
<link rel="stylesheet" href="resources/CollapsibleTreeVisualization/dndTree.css" media="screen" />


<!-- SCHEMA.ORG METADATA -->
<script type="application/ld+json">{"@context":"http://schema.org","@type":"TechArticle","url":"http://w3id.org/meta-share/omtd-share","image":"http://vowl.visualdataweb.org/webvowl/#iri=http://w3id.org/meta-share/omtd-share","name":"OMTD-SHARE ontology", "headline":"OMTD-SHARE ontology for resources related to Text and Data Mining initiated in the framework of the OpenMinTeD project (https://www.openminted.eu). It currently focuses on TDM functions (tasks performed by TDM software), annotation types (types of information extracted or annotated by TDM software), TDM methods (classification of the theoretical method used in the TDM algorithm), and data formats of the resoures that can be processed by TDM software. The ontology is deployed in the OMTD-SHARE metadata schema for the description of such resources (https://openminted.github.io/releases/omtd-share/) and is based on work done previously in the framework of the META-SHARE schema for language resources(http://www.meta-share.org/knowledgebase/homePage) and the FOSTER taxonomy of TDM (https://www.fosteropenscience.eu/resources).", "datePublished":"Fri Dec 22 13:26:37 UTC 2017", "version":"v1.0.0", "license":"http://purl.org/NET/rdflicense/cc-by4.0", "author":[{"@type":"Person","name":"Claire Nedellec"},{"@type":"Person","name":"Dimitris Galanis"},{"@type":"Person","name":"Katerina Gkirtzou"},{"@type":"Person","name":"Marta Villegas"},{"@type":"Person","name":"Penny Labropoulou"},{"@type":"Person","name":"Petr Knoth"},{"@type":"Person","name":"Sophie Aubin"}], "contributor":[{"@type":"Person","name":"Richard Eckart de Castilho"}]}</script>

<script src="resources/jquery.js"></script>
<script src="resources/marked.min.js"></script>
<script>
function loadHash() {

<!-- <script src="resources/jquery.js"></script> -->
<script src="resources/marked.min.js"></script>

<!-- Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="resources/CollapsibleTreeVisualization/d3.tip.v0.6.7.js"></script>
<script src="resources/CollapsibleTreeVisualization/dndTree.js"></script>

<script>
function loadHash() {
jQuery(".markdown").each(function(el){jQuery(this).after(marked(jQuery(this).text())).remove()});
var hash = location.hash;
if($(hash).offset()!=null){
Expand Down Expand Up @@ -45,13 +58,14 @@
$(function(){
$("#abstract").load("sections/abstract-en.html");
$("#introduction").load("sections/introduction-en.html");
$("#overview").load("sections/overview-en.html");
$("#overview").load("sections/overview-en.html");
$("#visualization").load("sections/dndTree.html");
$("#description").load("sections/description-en.html");
$("#references").load("sections/references-en.html");
$("#crossref").load("sections/crossref-en.html", null, loadHash);
});
</script>
</head>
</script>
</head>

<body>
<div class="container"><div class="head">
Expand All @@ -74,7 +88,8 @@ <h1>OMTD-SHARE ontology</h1>
</div>
</div> <div id="abstract"></div>
<div id="toc"></div> <div id="introduction"></div>
<div id="overview"></div>
<div id="overview"></div>
<div id="visualization"></div>
<div id="description"></div>
<div id="crossref"></div>
<div id="references"></div>
Expand All @@ -84,4 +99,4 @@ <h2 id="ack" class="list">Acknowledgements <span class="backlink"> back to <a hr
The authors would like to thank <a href="http://www.essepuntato.it/">Silvio Peroni</a> for developing <a href="http://www.essepuntato.it/lode">LODE</a>, a Live OWL Documentation Environment, which is used for representing the Cross Referencing Section of this document and <a href="https://w3id.org/people/dgarijo">Daniel Garijo</a> for developing <a href="https://github.com/dgarijo/Widoco">Widoco</a>, the program used to create the template used in this documentation.</p>
</div>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
// d3.tip
// Copyright (c) 2013 Justin Palmer
//
// Tooltips for d3.js SVG visualizations

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module with d3 as a dependency.
define(['d3'], factory)
} else if (typeof module === 'object' && module.exports) {
// CommonJS
module.exports = function(d3) {
d3.tip = factory(d3)
return d3.tip
}
} else {
// Browser global.
root.d3.tip = factory(root.d3)
}
}(this, function (d3) {

// Public - contructs a new tooltip
//
// Returns a tip
return function() {
var direction = d3_tip_direction,
offset = d3_tip_offset,
html = d3_tip_html,
node = initNode(),
svg = null,
point = null,
target = null

function tip(vis) {
svg = getSVGNode(vis)
point = svg.createSVGPoint()
document.body.appendChild(node)
}

// Public - show the tooltip on the screen
//
// Returns a tip
tip.show = function() {
var args = Array.prototype.slice.call(arguments)
if(args[args.length - 1] instanceof SVGElement) target = args.pop()

var content = html.apply(this, args),
poffset = offset.apply(this, args),
dir = direction.apply(this, args),
nodel = getNodeEl(),
i = directions.length,
coords,
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft

nodel.html(content)
.style({ opacity: 1, 'pointer-events': 'all' })

while(i--) nodel.classed(directions[i], false)
coords = direction_callbacks.get(dir).apply(this)
nodel.classed(dir, true).style({
top: (coords.top + poffset[0]) + scrollTop + 'px',
left: (coords.left + poffset[1]) + scrollLeft + 'px'
})

return tip
}

// Public - hide the tooltip
//
// Returns a tip
tip.hide = function() {
var nodel = getNodeEl()
nodel.style({ opacity: 0, 'pointer-events': 'none' })
return tip
}

// Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
//
// n - name of the attribute
// v - value of the attribute
//
// Returns tip or attribute value
tip.attr = function(n, v) {
if (arguments.length < 2 && typeof n === 'string') {
return getNodeEl().attr(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.attr.apply(getNodeEl(), args)
}

return tip
}

// Public: Proxy style calls to the d3 tip container. Sets or gets a style value.
//
// n - name of the property
// v - value of the property
//
// Returns tip or style property value
tip.style = function(n, v) {
if (arguments.length < 2 && typeof n === 'string') {
return getNodeEl().style(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.style.apply(getNodeEl(), args)
}

return tip
}

// Public: Set or get the direction of the tooltip
//
// v - One of n(north), s(south), e(east), or w(west), nw(northwest),
// sw(southwest), ne(northeast) or se(southeast)
//
// Returns tip or direction
tip.direction = function(v) {
if (!arguments.length) return direction
direction = v == null ? v : d3.functor(v)

return tip
}

// Public: Sets or gets the offset of the tip
//
// v - Array of [x, y] offset
//
// Returns offset or
tip.offset = function(v) {
if (!arguments.length) return offset
offset = v == null ? v : d3.functor(v)

return tip
}

// Public: sets or gets the html value of the tooltip
//
// v - String value of the tip
//
// Returns html value or tip
tip.html = function(v) {
if (!arguments.length) return html
html = v == null ? v : d3.functor(v)

return tip
}

// Public: destroys the tooltip and removes it from the DOM
//
// Returns a tip
tip.destroy = function() {
if(node) {
getNodeEl().remove();
node = null;
}
return tip;
}

function d3_tip_direction() { return 'n' }
function d3_tip_offset() { return [0, 0] }
function d3_tip_html() { return ' ' }

var direction_callbacks = d3.map({
n: direction_n,
s: direction_s,
e: direction_e,
w: direction_w,
nw: direction_nw,
ne: direction_ne,
sw: direction_sw,
se: direction_se
}),

directions = direction_callbacks.keys()

function direction_n() {
var bbox = getScreenBBox()
return {
top: bbox.n.y - node.offsetHeight,
left: bbox.n.x - node.offsetWidth / 2
}
}

function direction_s() {
var bbox = getScreenBBox()
return {
top: bbox.s.y,
left: bbox.s.x - node.offsetWidth / 2
}
}

function direction_e() {
var bbox = getScreenBBox()
return {
top: bbox.e.y - node.offsetHeight / 2,
left: bbox.e.x
}
}

function direction_w() {
var bbox = getScreenBBox()
return {
top: bbox.w.y - node.offsetHeight / 2,
left: bbox.w.x - node.offsetWidth
}
}

function direction_nw() {
var bbox = getScreenBBox()
return {
top: bbox.nw.y - node.offsetHeight,
left: bbox.nw.x - node.offsetWidth
}
}

function direction_ne() {
var bbox = getScreenBBox()
return {
top: bbox.ne.y - node.offsetHeight,
left: bbox.ne.x
}
}

function direction_sw() {
var bbox = getScreenBBox()
return {
top: bbox.sw.y,
left: bbox.sw.x - node.offsetWidth
}
}

function direction_se() {
var bbox = getScreenBBox()
return {
top: bbox.se.y,
left: bbox.e.x
}
}

function initNode() {
var node = d3.select(document.createElement('div'))
node.style({
position: 'absolute',
top: 0,
opacity: 0,
'pointer-events': 'none',
'box-sizing': 'border-box'
})

return node.node()
}

function getSVGNode(el) {
el = el.node()
if(el.tagName.toLowerCase() === 'svg')
return el

return el.ownerSVGElement
}

function getNodeEl() {
if(node === null) {
node = initNode();
// re-add node to DOM
document.body.appendChild(node);
};
return d3.select(node);
}

// Private - gets the screen coordinates of a shape
//
// Given a shape on the screen, will return an SVGPoint for the directions
// n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),
// sw(southwest).
//
// +-+-+
// | |
// + +
// | |
// +-+-+
//
// Returns an Object {n, s, e, w, nw, sw, ne, se}
function getScreenBBox() {
var targetel = target || d3.event.target;

while ('undefined' === typeof targetel.getScreenCTM && 'undefined' === targetel.parentNode) {
targetel = targetel.parentNode;
}

var bbox = {},
matrix = targetel.getScreenCTM(),
tbbox = targetel.getBBox(),
width = tbbox.width,
height = tbbox.height,
x = tbbox.x,
y = tbbox.y

point.x = x
point.y = y
bbox.nw = point.matrixTransform(matrix)
point.x += width
bbox.ne = point.matrixTransform(matrix)
point.y += height
bbox.se = point.matrixTransform(matrix)
point.x -= width
bbox.sw = point.matrixTransform(matrix)
point.y -= height / 2
bbox.w = point.matrixTransform(matrix)
point.x += width
bbox.e = point.matrixTransform(matrix)
point.x -= width / 2
point.y -= height / 2
bbox.n = point.matrixTransform(matrix)
point.y += height
bbox.s = point.matrixTransform(matrix)

return bbox
}

return tip
};

}));
Loading

0 comments on commit c49705f

Please sign in to comment.