-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
26 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
{% extends "webpage/base.html" %} | ||
{% load static %} | ||
{% load netvis_extras %} | ||
{% load webpage_extras %} | ||
{% block title %}{{ object.name }}{% endblock %} | ||
{% block scriptHeader %} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/[email protected]/build/three.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/@acdh/network-visualization@latest/lib/network-visualization.umd.js"></script> | ||
<script src="{% static 'netvis/js/netvis.js' %}"></script> | ||
<link rel="stylesheet" href="{% static 'netvis/css/netvis.css' %}" /> <!-- optional --> | ||
{% load_netvis_js %} | ||
{% endblock %} | ||
{% block content %} | ||
<!-- <div class="container"> --> | ||
|
@@ -137,9 +134,10 @@ <h2> | |
</table> | ||
</div> | ||
<div class="col-md-6"> | ||
<div id="visualization" style="position: relative; height: 700px; background: #fafafa;"></div> | ||
<div id="visualization"></div> | ||
<script src="{% static 'netvis/js/netvis.js' %}"></script> | ||
<script type="text/javascript"> | ||
showGraph("{% url 'netvis:graph' app_name=app_name model_name=class_name|lower pk=object.id %}", "visualization") | ||
showGraph("visualization", "{% url 'netvis:graph' app_name=app_name model_name=class_name|lower pk=object.id %}") | ||
</script> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,15 @@ | |
{% load static %} | ||
{% load django_tables2 %} | ||
{% load browsing_extras %} | ||
|
||
{% load netvis_extras %} | ||
|
||
{% load i18n %} | ||
{% load crispy_forms_field %} | ||
{% load crispy_forms_tags %} | ||
{% block title %} Browse {{ class_name }} {% endblock %} | ||
{% block scriptHeader %} | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/[email protected]/build/three.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/@acdh/network-visualization@latest/lib/network-visualization.umd.js"></script> | ||
<script src="{% static 'netvis/js/netvis.js' %}"></script> | ||
<link rel="stylesheet" href="{% static 'netvis/css/netvis.css' %}" /> <!-- optional --> | ||
{% load_netvis_js %} | ||
{% endblock %} | ||
{% block content %} | ||
|
||
|
@@ -264,27 +260,21 @@ <h4>{{ error_msg|safe }}</h4> | |
</div> | ||
|
||
</div> | ||
<div id="visualization" style="position: relative; height: 600px; background: #fafafa;"></div> | ||
<div id="visualization"></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock %} | ||
{% block scripts2 %} | ||
<script src="{% static 'netvis/js/netvis.js' %}"></script> | ||
<script> | ||
|
||
const graph_endpoint = "{% url 'archiv:keyword_data' %}"; | ||
const graph_params = window.location.search; | ||
const graph_url = `${graph_endpoint}${graph_params}`; | ||
fetch(graph_url) | ||
.then(response => response.json()) | ||
.then(data => ReactDOM.render( | ||
React.createElement(NetworkVisualization.Visualization, { | ||
graph: data, | ||
}), | ||
document.getElementById('visualization') | ||
)); | ||
showGraph("visualization", graph_url) | ||
|
||
|
||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters