Update the example web page to have some default values selected

This commit is contained in:
Pitchaya Boonsarngsuk
2018-01-24 21:18:12 +00:00
parent 1c340fce54
commit 918275ce45
2 changed files with 9 additions and 2 deletions

View File

@@ -90,13 +90,13 @@
<label title="The size of the nodes"> <label title="The size of the nodes">
Node size Node size
<output id="nodeSizeSliderOutput">10</output> <output id="nodeSizeSliderOutput">10</output>
<input type="range" min="5" max="200" value="10" step="5" oninput="d3.select('#nodeSizeSliderOutput').text(value); NODE_SIZE=value; d3.selectAll('circle').attr('r', value)"> <input type="range" min="1" max="200" value="10" step="5" oninput="d3.select('#nodeSizeSliderOutput').text(value); NODE_SIZE=value; d3.selectAll('circle').attr('r', value)">
</label> </label>
<br/> <br/>
<label title="The number that distance is multiplied by in order to improve the visibility of the graph"> <label title="The number that distance is multiplied by in order to improve the visibility of the graph">
Render Distance Multiplier Render Distance Multiplier
<output id="distanceMultiplierSliderOutput">50</output> <output id="distanceMultiplierSliderOutput">50</output>
<input type="range" min="5" max="1000" value="50" step="5" oninput="d3.select('#distanceMultiplierSliderOutput').text(value); MULTIPLIER=value;ticked();"> <input type="range" min="1" max="1000" value="50" step="5" oninput="d3.select('#distanceMultiplierSliderOutput').text(value); MULTIPLIER=value;ticked();">
</label> </label>
<br/> <br/>
<label title="Number of iterations before the simulation is stopped"> <label title="Number of iterations before the simulation is stopped">

View File

@@ -63,6 +63,13 @@ var MULTIPLIER = 50,
// Create a color scheme for a range of numbers. // Create a color scheme for a range of numbers.
var color = d3.scaleOrdinal(d3.schemeCategory10); var color = d3.scaleOrdinal(d3.schemeCategory10);
$(document).ready(function() {
distanceFunction = calculateDistance;
d3.select('#startSimulation').on('click', startHybridSimulation);
$("#HLParameters").show();
});
/** /**
* Parse the data from the provided csv file using Papa Parse library * Parse the data from the provided csv file using Papa Parse library
* @param {file} evt - csv file. * @param {file} evt - csv file.