<commit_before>{% extends "base_visualize.html" %}
{% set active_page = 'viz' %}

{% block head %}
<script type="text/javascript" src="{{ url_for('static', filename='js/scripts_viz.js') }}?ver={{version}}"></script>
<script>
var dataset = {{ JSONObj|safe or {} }};
var numActiveDocs = {{ numActiveDocs }};
$(function() {
	$("#allCheckBoxSelector").click(function() {
		if (!$("#allCheckBoxSelector").is(":checked")) {
			$("#viz").empty();
			$(".minifilepreview").prop("checked", false);
		}
	});
  // If there is data scroll down to the graph on page load
  document.getElementById("graph-anchor").scrollIntoView({block: "start", behavior: "smooth"});
  // Handle the return to top links
  $('.to-top').click(function(){
      $("html, body").animate({ scrollTop: 0 }, 800);
      return false;
  });
});
</script>
<style type="text/css">
.node {cursor: pointer;}
#viz {margin-top:-30px;padding-top:0;}
</style>
{% endblock %}

{% block title %}BubbleViz{% endblock %}

{% block options %}
<div id="status-prepare"><img src="{{ url_for('static', filename='images/loading_icon.svg') }}?ver={{version}}" alt="Loading..."></div>

<legend>BubbleViz Options</legend>
<div class="col-md-6">
	<legend style="width:250px;">Select Document(s)</legend>
	{% if labels|len > 0 %}
   		<label><input type="checkbox" id="allCheckBoxSelector">Toggle All</label><br/>
	{%- endif %}
	<div id="vizoptionscontainer" name="segmentlist" style="overflow:auto; width: 300px; float: left; max-height: 125px; min-height: 2em; padding-left: 15px;">
		<div id="vizcreateoptions">
			<!-- Need to empty the segmentlist value if Toggle All is checked -->
			{% for fileID, label in labels.items() %}
			<div class="forCheckBox">
				<label style="width: 90%; margin: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{label}}
					<input type="checkbox" name="segmentlist" class="minifilepreview" {{ 'checked' if fileID|unicode in session['cloudoption']['segmentlist'] }} id="{{fileID}}_selector" value="{{fileID}}">
				</label>
			</div>
			{%- endfor %}
			{% if labels|len == 0 %}
				<span id="no-labels">No Documents are Selected</span>
			{%- endif %}
		</div>
	</div>
</div>
<div class="col-md-6">
	<legend>Filtering Options</legend>
		<label>Graph Size:
			<input type="number" min="100" max="3000" step="100" id="graphsize" name="graphsize" value="{{ session['bubblevisoption']['graphsize']}}"/>
		</label>
		<br/>
		<label>Maximum Number of Terms:
			<input type="number" min="1" id="maxwords" name="maxwords" value="{{ session['bubblevisoption']['maxwords'] or '100' }}"/>
		</label>
		<br/>
		<label>Minimum Term Length:
			<input type="number" min="0" id="minlength" name="minlength" value="{{ session['bubblevisoption']['minlength'] or '0' }}"/>
		</label>
</div>

{% endblock %}

{% block results %}
{% if not JSONObj %}
<h4 id="nosegments">Please select the document(s) for the graph.</h4>

{% else %}
<a name="graph-anchor" id="graph-anchor"></a>
<div id="viz"></div>
<div class="row">
<div class="col-md-12">
  <a class="to-top" style="margin-right:10px;"><i class="to-top fa fa-arrow-circle-up fa-2x" data-toggle="tooltip" data-container="body" data-trigger="hover focus" data-html="true" data-placement="right" title="Back to Top"></i></a>
</div>
</div>

<!-- Canvg Used for Save to PNG -->
<script type="text/javascript" src="http://gabelerner.github.io/canvg/rgbcolor.js"></script>
<script type="text/javascript" src="http://gabelerner.github.io/canvg/StackBlur.js"></script>
<script type="text/javascript" src="http://gabelerner.github.io/canvg/canvg.js"></script>
<canvas id="svg-canvas" style="display:none;"></canvas>
<img id="svg-img" style="display:none;"/>
<!-- -->

{% endif %}
{% endblock %}

{% block submit %}
<input type="submit" class="bttn bttn-action" id="getviz" role="button" style="float: left; margin-right: 10px;" value="Get Graph"/>
<a class="btn bttn bttn-action" id="save" role="button" style="width: 105px; float: left; display:none;">Save as PNG</a><commit_msg>Updated canvg so bubbleviz download will work.<commit_after>{% extends "base_visualize.html" %}
{% set active_page = 'viz' %}

{% block head %}
<script type="text/javascript" src="{{ url_for('static', filename='js/scripts_viz.js') }}?ver={{version}}"></script>
<script>
var dataset = {{ JSONObj|safe or {} }};
var numActiveDocs = {{ numActiveDocs }};
$(function() {
	$("#allCheckBoxSelector").click(function() {
		if (!$("#allCheckBoxSelector").is(":checked")) {
			$("#viz").empty();
			$(".minifilepreview").prop("checked", false);
		}
	});
  // If there is data scroll down to the graph on page load
  document.getElementById("graph-anchor").scrollIntoView({block: "start", behavior: "smooth"});
  // Handle the return to top links
  $('.to-top').click(function(){
      $("html, body").animate({ scrollTop: 0 }, 800);
      return false;
  });
});
</script>
<style type="text/css">
.node {cursor: pointer;}
#viz {margin-top:-30px;padding-top:0;}
</style>
{% endblock %}

{% block title %}BubbleViz{% endblock %}

{% block options %}
<div id="status-prepare"><img src="{{ url_for('static', filename='images/loading_icon.svg') }}?ver={{version}}" alt="Loading..."></div>

<legend>BubbleViz Options</legend>
<div class="col-md-6">
	<legend style="width:250px;">Select Document(s)</legend>
	{% if labels|len > 0 %}
   		<label><input type="checkbox" id="allCheckBoxSelector">Toggle All</label><br/>
	{%- endif %}
	<div id="vizoptionscontainer" name="segmentlist" style="overflow:auto; width: 300px; float: left; max-height: 125px; min-height: 2em; padding-left: 15px;">
		<div id="vizcreateoptions">
			<!-- Need to empty the segmentlist value if Toggle All is checked -->
			{% for fileID, label in labels.items() %}
			<div class="forCheckBox">
				<label style="width: 90%; margin: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{label}}
					<input type="checkbox" name="segmentlist" class="minifilepreview" {{ 'checked' if fileID|unicode in session['cloudoption']['segmentlist'] }} id="{{fileID}}_selector" value="{{fileID}}">
				</label>
			</div>
			{%- endfor %}
			{% if labels|len == 0 %}
				<span id="no-labels">No Documents are Selected</span>
			{%- endif %}
		</div>
	</div>
</div>
<div class="col-md-6">
	<legend>Filtering Options</legend>
		<label>Graph Size:
			<input type="number" min="100" max="3000" step="100" id="graphsize" name="graphsize" value="{{ session['bubblevisoption']['graphsize']}}"/>
		</label>
		<br/>
		<label>Maximum Number of Terms:
			<input type="number" min="1" id="maxwords" name="maxwords" value="{{ session['bubblevisoption']['maxwords'] or '100' }}"/>
		</label>
		<br/>
		<label>Minimum Term Length:
			<input type="number" min="0" id="minlength" name="minlength" value="{{ session['bubblevisoption']['minlength'] or '0' }}"/>
		</label>
</div>

{% endblock %}

{% block results %}
{% if not JSONObj %}
<h4 id="nosegments">Please select the document(s) for the graph.</h4>

{% else %}
<a name="graph-anchor" id="graph-anchor"></a>
<div id="viz"></div>
<div class="row">
<div class="col-md-12">
  <a class="to-top" style="margin-right:10px;"><i class="to-top fa fa-arrow-circle-up fa-2x" data-toggle="tooltip" data-container="body" data-trigger="hover focus" data-html="true" data-placement="right" title="Back to Top"></i></a>
</div>
</div>

<!-- Canvg Used for Save to PNG -->
<script type="text/javascript" src="http://canvg.github.io/canvg/rgbcolor.js"></script>
<script type="text/javascript" src="http://canvg.github.io/canvg/StackBlur.js"></script>
<script type="text/javascript" src="http://canvg.github.io/canvg/canvg.js"></script>
<canvas id="svg-canvas" style="display:none;"></canvas>
<img id="svg-img" style="display:none;"/>
<!-- -->

{% endif %}
{% endblock %}

{% block submit %}
<input type="submit" class="bttn bttn-action" id="getviz" role="button" style="float: left; margin-right: 10px;" value="Get Graph"/>
<a class="btn bttn bttn-action" id="save" role="button" style="width: 105px; float: left; display:none;">Save as PNG</a>
{'fraction_non_alphanumeric': 0.22240219287316224, 'fraction_numerical': 0.01320707699975081, 'mean_word_length': 5.261310452418097, 'pattern_counts': {'":': 2, '<': 151, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '322891', 'n_tokens_mistral': 2993, 'n_tokens_neox': 2682, 'n_words': 617}