<commit_before><script>
// task:  establish how existing points in a d3 plot can be selected and highlighted programmatically.
//   a) create minimal d3 xy plot, from data hard-coded into your Module.js
//   b) that hard-coded data should be defined within a function call, "getRandomPoints(count)"
//   b) write a function "selectPoints(listOfPoints, clearExistingSelectionFirst)"
//   c) add a button which calls a function creating a random subset from getRandomPoints:
//          getRandomSubset(count)
//   d) add a button which clears any existing selection
//
// Note that the button in d, and the "clearExistingSelectionFirst" (if true) will call the same function,
// "clearSelection()"
//
// Make it clean, make it simple, make it a little bit handsome.  Once it checks out, your next step will be to add
// this capability to the PCA module, and to register a new function to handle a message like "selectPatientsInPCAModule".

//----------------------------------------------------------------------------------------------------
var highlightPlotModule = (function () {
                           
  var randomPointsButton;
  var clearSelectionButton;
  var highlightPlotDisplay;
  //var HighlightPlotResults;
  //var patientClassification;
  var firstTime = true;
  var highlightPlotSelectedRegion;    // from brushing
  var d3PlotBrush;
  //var HighlightPlotTabNumber = 2;
  var d3HighlightPlotDisplay;
  var highlightPlotTextDisplay;
  var numberOfPoints = 100;
  var listOfPoints;
  var clearExistingSelectionFirst;
  var data = [];
                           
  //--------------------------------------------------------------------------------------------

  function initializeUI () {
      getRandomPoints(numberOfPoints);
      highlightPlotDisplay = $("#HighlightPlotDisplay");
      d3HighlightPlotDisplay = d3.select("#HighlightPlotDisplay");<commit_msg>updated the task description<commit_after><script>
// task:  establish how existing points in a d3 plot can be selected and highlighted programmatically.
//   a) create minimal d3 xy plot, from data hard-coded into your Module.js
//   b) that hard-coded data should be defined within a function call, "getRandomPoints(count)"
//   c) write a function "selectPoints(listOfPoints, clearExistingSelectionFirst)"
//      the listOfPoints needs to be a proper subset of the current points you have displayed, but
//      since someone could send you bad data, always check these points, and use only the 
//      intersection of listOfPoints with the points currently displayed
//   d) add a button which calls this selectPoints function.  this simulates the json message coming in from Oncoscape
//   3) add a button which clears any existing selection
//
// Note that the button in d, and the "clearExistingSelectionFirst" (if true) will call the same function,
// "clearSelection()"
//
// Make it clean, make it simple, make it a little bit handsome.  Once it checks out, your next step will be to add
// this capability to the PCA module, and to register a new function to handle a message like "selectPatientsInPCAModule".
//
//  one technique for highlighting d3 points is seen here:
//     http://bl.ocks.org/bycoffe/5871227
//  the points to be highlighted are painted a different color -- orange in this example.  this example
//  only highlights interactively selected points, where in your code, instead, you need to highligh
//  programmatically selected points.  but the d3 technique can be the same.
//----------------------------------------------------------------------------------------------------
var highlightPlotModule = (function () {
                           
  var randomPointsButton;
  var clearSelectionButton;
  var highlightPlotDisplay;
  //var HighlightPlotResults;
  //var patientClassification;
  var firstTime = true;
  var highlightPlotSelectedRegion;    // from brushing
  var d3PlotBrush;
  //var HighlightPlotTabNumber = 2;
  var d3HighlightPlotDisplay;
  var highlightPlotTextDisplay;
  var numberOfPoints = 100;
  var listOfPoints;
  var clearExistingSelectionFirst;
  var data = [];
                           
  //--------------------------------------------------------------------------------------------

  function initializeUI () {
      getRandomPoints(numberOfPoints);
      highlightPlotDisplay = $("#HighlightPlotDisplay");
      d3HighlightPlotDisplay = d3.select("#HighlightPlotDisplay");
{'fraction_non_alphanumeric': 0.15462983925741453, 'fraction_numerical': 0.006791940230925968, 'mean_word_length': 2.416860015467904, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4557559', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1033, 'n_words': 441}