Skip to content
Snippets Groups Projects
Commit 355a66d6 authored by Stahl, Merle's avatar Stahl, Merle
Browse files

Korrektur: MS

parent da4aa6bf
No related branches found
No related tags found
2 merge requests!10Output,!9Main
...@@ -210,7 +210,7 @@ ul.inheritsList ...@@ -210,7 +210,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Nov 19 2021 19:23:13 GMT+0100 (MEZ) Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Nov 23 2021 18:11:38 GMT+0100 (MEZ)
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -204,7 +204,7 @@ ul.inheritsList ...@@ -204,7 +204,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Fri Nov 19 2021 19:23:13 GMT+0100 (MEZ) Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Tue Nov 23 2021 18:11:38 GMT+0100 (MEZ)
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -218,6 +218,44 @@ ul.inheritsList ...@@ -218,6 +218,44 @@ ul.inheritsList
<!-- ============================== properties summary ===================== --> <!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class _global_.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#g">g</a></b>
</div>
<div class="description">create group element</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/_global_.html#zoom">zoom</a></b>
</div>
<div class="description">create a new zoom behavior and apply it to svg</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== --> <!-- ============================== methods summary ======================== -->
...@@ -233,6 +271,15 @@ ul.inheritsList ...@@ -233,6 +271,15 @@ ul.inheritsList
</thead> </thead>
<tbody> <tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#center">center</a></b>()
</div>
<div class="description">sets the transform such that svg is centered</div>
</td>
</tr>
<tr> <tr>
<td class="attributes">&nbsp;</td> <td class="attributes">&nbsp;</td>
<td class="nameDescription"> <td class="nameDescription">
...@@ -242,6 +289,15 @@ ul.inheritsList ...@@ -242,6 +289,15 @@ ul.inheritsList
</td> </td>
</tr> </tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/_global_.html#resetZoom">resetZoom</a></b>()
</div>
<div class="description">sets the</div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -256,6 +312,61 @@ ul.inheritsList ...@@ -256,6 +312,61 @@ ul.inheritsList
<!-- ============================== field details ========================== --> <!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="g"> </a>
<div class="fixedFont">
<b>g</b>
</div>
<div class="description">
create group element
<br />
<i>Defined in: </i> <a href="../symbols/src/cn.js.html">cn.js</a>.
</div>
<hr />
<a name="zoom"> </a>
<div class="fixedFont">
<b>zoom</b>
</div>
<div class="description">
create a new zoom behavior and apply it to svg
<br />
<i>Defined in: </i> <a href="../symbols/src/cn.js.html">cn.js</a>.
</div>
<!-- ============================== method details ========================= --> <!-- ============================== method details ========================= -->
...@@ -263,6 +374,34 @@ ul.inheritsList ...@@ -263,6 +374,34 @@ ul.inheritsList
Method Detail Method Detail
</div> </div>
<a name="center"> </a>
<div class="fixedFont">
<b>center</b>()
</div>
<div class="description">
sets the transform such that svg is centered
<br />
<i>Defined in: </i> <a href="../symbols/src/cn.js.html">cn.js</a>.
</div>
<hr />
<a name="firstauthor"> </a> <a name="firstauthor"> </a>
<div class="fixedFont"> <div class="fixedFont">
...@@ -300,6 +439,34 @@ ul.inheritsList ...@@ -300,6 +439,34 @@ ul.inheritsList
<hr />
<a name="resetZoom"> </a>
<div class="fixedFont">
<b>resetZoom</b>()
</div>
<div class="description">
sets the
<br />
<i>Defined in: </i> <a href="../symbols/src/cn.js.html">cn.js</a>.
</div>
...@@ -314,7 +481,7 @@ ul.inheritsList ...@@ -314,7 +481,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Fri Nov 19 2021 19:23:13 GMT+0100 (MEZ) Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 23 2021 18:11:38 GMT+0100 (MEZ)
</div> </div>
</body> </body>
</html> </html>
This diff is collapsed.
...@@ -14,13 +14,16 @@ toRemove; ...@@ -14,13 +14,16 @@ toRemove;
var link; var link;
/**
* create a background
*/
var rect = svg.append("rect") var rect = svg.append("rect")
.attr("x", 0) .attr("x", 0)
.attr("y", 0) .attr("y", 0)
.attr("height", height) .attr("height", height)
.attr("width", width) .attr("width", width)
.style("fill", 'white') .style("fill", 'white')
.on('click', function(d) { .on('click', function(d) {
d3.selectAll(".circle").style("stroke", "none") d3.selectAll(".circle").style("stroke", "none")
d3.selectAll(".link") d3.selectAll(".link")
.style("stroke", "#999") .style("stroke", "#999")
...@@ -35,15 +38,21 @@ var simulation = d3.forceSimulation() ...@@ -35,15 +38,21 @@ var simulation = d3.forceSimulation()
.force("center", d3.forceCenter(width/2, height/2)) .force("center", d3.forceCenter(width/2, height/2))
.force("yscale", d3.forceY().strength(1).y(function(d) {return yscale(d.group)})); .force("yscale", d3.forceY().strength(1).y(function(d) {return yscale(d.group)}));
/**
* create a new zoom behavior and apply it to svg
*/
var zoom = d3.zoom() var zoom = d3.zoom()
.on("zoom", zoom); .on("zoom", zoom);
zoom(svg); zoom(svg);
/**
* create group element
*/
var g = svg.append("g") var g = svg.append("g")
.attr("class", "everything") .attr("class", "everything")
//d3.json("data.json", function (error, graph) { //d3.json("data.json", function (error, graph) {
d3.json("json_text.json").then(function(graph){ d3.json("json_text.json").then(function(graph) {
update(graph.links, graph.nodes); update(graph.links, graph.nodes);
}) })
...@@ -114,28 +123,28 @@ return link.source.index == node.index || link.target.index == node.index; ...@@ -114,28 +123,28 @@ return link.source.index == node.index || link.target.index == node.index;
} }
function marklink(node){ function marklink(node){
d3.selectAll(".link") d3.selectAll(".link")
.style("stroke", function(o) { .style("stroke", function(o) {
return isLinkForNode(node, o) ? "black" : "#999";}) return isLinkForNode(node, o) ? "black" : "#999";})
.attr('marker-end', function(o) { .attr('marker-end', function(o) {
return isLinkForNode(node, o) ? marker('#000000') : marker('#999');}) return isLinkForNode(node, o) ? marker('#000000') : marker('#999');})
} }
function marker(color) { function marker(color) {
svg.append('defs').append('marker')//arrowhead svg.append('defs').append('marker')//arrowhead
.attr('id',color.replace("#", "")) .attr('id',color.replace("#", ""))
.attr('viewBox','-0 -5 10 10') .attr('viewBox','-0 -5 10 10')
.attr('refX',r+10) .attr('refX',r+10)
.attr('refY',0) .attr('refY',0)
.attr('orient','auto') .attr('orient','auto')
.attr('markerWidth',10) .attr('markerWidth',10)
.attr('markerHeight',15) .attr('markerHeight',15)
.attr('xoverflow','visible') .attr('xoverflow','visible')
.append('svg:path') .append('svg:path')
.attr('d', 'M 0,-5 L 10 ,0 L 0,5') .attr('d', 'M 0,-5 L 10 ,0 L 0,5')
.attr('fill', color)//arrowhead color .attr('fill', color)//arrowhead color
.style('stroke','none'); .style('stroke','none');
return "url(" + color + ")"; return "url(" + color + ")";
}; };
/** /**
...@@ -143,60 +152,64 @@ return "url(" + color + ")"; ...@@ -143,60 +152,64 @@ return "url(" + color + ")";
* @param {string} authors - The comma-separated string of authors * @param {string} authors - The comma-separated string of authors
*/ */
function firstauthor(authors){ function firstauthor(authors){
if (/,/.test(authors)==false){ if (/,/.test(authors)==false){
var firstauthor=/^.*\s+([\w\-]+)[\.\s]*$/.exec(authors) var firstauthor=/^.*\s+([\w\-]+)[\.\s]*$/.exec(authors)
} }
else{ else {
var firstauthor=/^[\s\w\.\-]*\s([\w\-]+)[\.\s]*,.*$/.exec(authors) var firstauthor=/^[\s\w\.\-]*\s([\w\-]+)[\.\s]*,.*$/.exec(authors)
} }
return firstauthor[1] return firstauthor[1]
} }
function textfunc(d){ function textfunc(d){
document.getElementById('textbox').innerHTML = "Title:" + '</br>' + d.name + document.getElementById('textbox').innerHTML = "Title:" + '</br>' + d.name +
'</br>' +'</br>'+"Author:"+ '</br>' +d.author+'</br>'+'</br>'+"Year:"+'</br>'+d.year+'</br>'+'</br>' '</br>' +'</br>'+"Author:"+ '</br>' +d.author+'</br>'+'</br>'+"Year:"+'</br>'+d.year+'</br>'+'</br>'
+"doi:"+'</br>'+d.doi; +"doi:"+'</br>'+d.doi;
} }
function ticked() { function ticked() {
link.attr("x1", function (d) {return d.source.x;}) link.attr("x1", function (d) {return d.source.x;})
.attr("y1", function (d) {return d.source.y;}) .attr("y1", function (d) {return d.source.y;})
.attr("x2", function (d) {return d.target.x;}) .attr("x2", function (d) {return d.target.x;})
.attr("y2", function (d) {return d.target.y;}); .attr("y2", function (d) {return d.target.y;});
node.attr("transform", function (d) {return "translate(" + d.x + ", " + d.y + ")";}); node.attr("transform", function (d) {return "translate(" + d.x + ", " + d.y + ")";});
} }
function dragstarted(d) { function dragstarted(d) {
if (!d3.event.active) if (!d3.event.active)
simulation.alphaTarget(0.3).restart() simulation.alphaTarget(0.3).restart()
d.fx = d.x; d.fx = d.x;
d.fy = d.y; d.fy = d.y;
} }
function dragged(d) { function dragged(d) {
d.fx = d3.event.x; d.fx = d3.event.x;
d.fy = d3.event.y; d.fy = d3.event.y;
} }
function resetGraph(){ function resetGraph() {
d3.selectAll(".node").each(function(d) { d3.selectAll(".node").each(function(d) {
d.fx = d.initial_x; d.fx = d.initial_x;
d.fy = d.initial_y; d.fy = d.initial_y;
}) })
} }
function zoom(){ function zoom() {
d3.select('g').attr("transform", d3.event.transform) d3.select('g').attr("transform", d3.event.transform);
} }
/**
* transforms svg such that the zoom is reset
*/
function resetZoom() { function resetZoom() {
d3.select('svg') d3.select('svg')
.transition() .call(zoom.scaleTo, 1);
.call(zoom.scaleTo, 1);
} }
/**
* transforms svg such that it is centered
*/
function center() { function center() {
d3.select('svg') d3.select('svg')
.transition() .call(zoom.translateTo, 0.5 * width, 0.5 * height);
.call(zoom.translateTo, 0.5 * width, 0.5 * height);
} }
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
border: 1px solid #999; border: 1px solid #999;
position: absolute; position: absolute;
top: 20px; top: 20px;
right: 440px; left: 980px;
display: inline-block; display: inline-block;
overflow-y: scroll; overflow-y: scroll;
margin: 0; margin: 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment