<commit_before>/// @file JSRoot.v7more.js
/// JavaScript ROOT v7 graphics for different classes

JSROOT.define(['painter', 'v7gpad'], (jsrp) => {

   "use strict";

   function drawText() {
      let text      = this.getObject(),
          pp        = this.getPadPainter(),
          use_frame = false,
          p         = pp.getCoordinate(text.fPos),
          textFont  = this.v7EvalFont("text", { size: 12, color: "black", align: 22 });

      this.createG(use_frame);

      this.startTextDrawing(textFont, 'font');

      this.drawText({ x: p.x, y: p.y, text: text.fText, latex: 1 });

      return this.finishTextDrawing();
   }


   // =================================================================================

   function drawLine() {

       let line         = this.getObject(),
           pp           = this.getPadPainter(),
           onframe      = this.v7EvalAttr("onframe", false) ? pp.getFramePainter() : null,
           p1           = pp.getCoordinate(line.fP1, onframe),
           p2           = pp.getCoordinate(line.fP2, onframe),
           line_width   = this.v7EvalAttr("line_width", 1),
           line_style   = this.v7EvalAttr("line_style", 1),
           line_color   = this.v7EvalColor("line_color", "black");

       this.createG(onframe);

       this.draw_g
           .append("svg:line")
           .attr("x1", p1.x)
           .attr("y1", p1.y)
           .attr("x2", p2.x)
           .attr("y2", p2.y)
           .style("stroke", line_color)
           .attr("stroke-width", line_width)
//        .attr("stroke-opacity", line_opacity)
           .style("stroke-dasharray", jsrp.root_line_styles[line_style]);
   }

   // =================================================================================

   function drawBox() {

       let box          = this.getObject(),
           pp           = this.getPadPainter(),
           p1           = pp.getCoordinate(box.fP1),
           p2           = pp.getCoordinate(box.fP2),
           line_width   = this.v7EvalAttr( "box_border_width", 1),
           line_style   = this.v7EvalAttr( "box_border_style", 1),<commit_msg>Handle cutbyframe attribute<commit_after>/// @file JSRoot.v7more.js
/// JavaScript ROOT v7 graphics for different classes

JSROOT.define(['painter', 'v7gpad'], (jsrp) => {

   "use strict";

   function drawText() {
      let text      = this.getObject(),
          pp        = this.getPadPainter(),
          use_frame = false,
          p         = pp.getCoordinate(text.fPos),
          textFont  = this.v7EvalFont("text", { size: 12, color: "black", align: 22 });

      this.createG(use_frame);

      this.startTextDrawing(textFont, 'font');

      this.drawText({ x: p.x, y: p.y, text: text.fText, latex: 1 });

      return this.finishTextDrawing();
   }


   // =================================================================================

   function drawLine() {

       let line         = this.getObject(),
           pp           = this.getPadPainter(),
           onframe      = this.v7EvalAttr("onframe", false) ? pp.getFramePainter() : null,
           cutbyframe   = onframe ? this.v7EvalAttr("cutbyframe", true) : false,
           p1           = pp.getCoordinate(line.fP1, onframe),
           p2           = pp.getCoordinate(line.fP2, onframe),
           line_width   = this.v7EvalAttr("line_width", 1),
           line_style   = this.v7EvalAttr("line_style", 1),
           line_color   = this.v7EvalColor("line_color", "black");

       this.createG(cutbyframe ? "main_layer" : (onframe ? "upper_layer" : false ));

       this.draw_g
           .append("svg:line")
           .attr("x1", p1.x)
           .attr("y1", p1.y)
           .attr("x2", p2.x)
           .attr("y2", p2.y)
           .style("stroke", line_color)
           .attr("stroke-width", line_width)
//        .attr("stroke-opacity", line_opacity)
           .style("stroke-dasharray", jsrp.root_line_styles[line_style]);
   }

   // =================================================================================

   function drawBox() {

       let box          = this.getObject(),
           pp           = this.getPadPainter(),
           p1           = pp.getCoordinate(box.fP1),
           p2           = pp.getCoordinate(box.fP2),
           line_width   = this.v7EvalAttr( "box_border_width", 1),
           line_style   = this.v7EvalAttr( "box_border_style", 1),
{'fraction_non_alphanumeric': 0.2079343365253078, 'fraction_numerical': 0.016187870497036023, 'mean_word_length': 2.093794076163611, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3592462', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1326, 'n_words': 236}