artdaq_node_server  v1_00_09
 All Classes Namespaces Files Variables Pages
Variables
JSRootPainter.js File Reference

Go to the source code of this file.

Variables

function JSROOT addDrawFunc
 
JSROOT Painter = {}
 
JSROOT Painter readStyleFromURL
 
JSROOT Painter adoptRootColors
 
JSROOT Painter root_markers
 
JSROOT Painter createAttMarker
 
JSROOT Painter getFontDetails
 
JSROOT Painter HLStoRGB
 
JSROOT Painter translateExp
 
JSROOT Painter symbols_map
 
JSROOT Painter translateLaTeX
 

Detailed Description

JavaScript ROOT graphics

Definition in file JSRootPainter.js.

Variable Documentation

function JSROOT addDrawFunc
Initial value:
= function(_name, _func) {
JSROOT.fDrawFunc.push({ name:_name, func:_func });
}
JSROOT.gStyle = {
Tooltip : true,
ContextMenu : true,
Zooming : true,
MoveResize : true,
DragAndDrop : false,
OptimizeDraw : 1,
DefaultCol : 1,
AutoStat : true,
OptStat : 1111,
StatNDC : { fX1NDC : 0.78, fY1NDC: 0.75, fX2NDC: 0.98, fY2NDC: 0.91 },
StatText : { fTextAngle: 0, fTextSize: 9, fTextAlign: 12, fTextColor: 1, fTextFont: 42 },
StatFill : { fFillColor: 0, fFillStyle: 1001 },
TimeOffset : 788918400000,
StatFormat : function(v) { return (Math.abs(v) < 1e5) ? v.toFixed(5) : v.toExponential(7); },
StatEntriesFormat : function(v) { return (Math.abs(v) < 1e7) ? v.toFixed(0) : v.toExponential(7); }
}

Definition at line 27 of file JSRootPainter.js.

JSROOT Painter adoptRootColors
Initial value:
= function(objarr) {
if (!objarr || !objarr.arr) return;
for (var n in objarr.arr) {
var col = objarr.arr[n];
if ((col==null) || (col['_typename'] != 'TColor')) continue;
var num = col.fNumber;
if ((num<0) || (num>4096)) continue;
var rgb = "rgb(" + (col.fRed*255).toFixed(0) + "," + (col.fGreen*255).toFixed(0) + "," + (col.fBlue*255).toFixed(0) + ")";
if (rgb == 'rgb(255,255,255)') rgb = 'white';
JSROOT.Painter.root_colors.push(rgb);
if (JSROOT.Painter.root_colors[num] != rgb) {
JSROOT.Painter.root_colors[num] = rgb;
}
}
}
JSROOT.Painter.root_line_styles = new Array("", "", "3, 3", "1, 2",
"3, 4, 1, 4", "5, 3, 1, 3", "5, 3, 1, 3, 1, 3, 1, 3", "5, 5",
"5, 3, 1, 3, 1, 3", "20, 5", "20, 10, 1, 10", "1, 2")

Definition at line 224 of file JSRootPainter.js.

JSROOT Painter createAttMarker

Function returns the ready to use marker for drawing

Definition at line 261 of file JSRootPainter.js.

JSROOT Painter HLStoRGB

Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255].

Parameters
Numberh The hue
Numbers The saturation
Numberl The lightness
Returns
Array The RGB representation

Definition at line 469 of file JSRootPainter.js.

JSROOT Painter root_markers
Initial value:
= new Array('fcircle', 'fcircle', 'fcross',
'dcross', 'ocircle', 'gcross', 'fcircle', 'fcircle', 'fcircle',
'fcircle', 'fcircle', 'fcircle', 'fcircle', 'fcircle', 'fcircle',
'fcircle', 'fcircle', 'fcircle', 'fcircle', 'fcircle', 'fcircle',
'fsquare', 'ftriangle-up', 'ftriangle-down', 'ocircle', 'osquare',
'otriangle-up', 'odiamond', 'ocross', 'fstar', 'ostar', 'dcross',
'otriangle-down', 'fdiamond', 'fcross')

Definition at line 252 of file JSRootPainter.js.

JSROOT Painter translateExp
Initial value:
= function(str) {
var lstr = str.match(/\^{[0-9]*}/gi);
if (lstr != null) {
var symbol = '';
for (var i = 0; i < lstr.length; ++i) {
symbol = lstr[i].replace(' ', '');
symbol = symbol.replace('^{', '');
symbol = symbol.replace('}', '');
var size = symbol.length;
for (var j = 0; j < size; ++j) {
var c = symbol.charAt(j);
var u, e = parseInt(c);
if (e == 1) u = String.fromCharCode(0xB9);
else if (e > 1 && e < 4) u = String.fromCharCode(0xB0 + e);
else u = String.fromCharCode(0x2070 + e);
symbol = symbol.replace(c, u);
}
str = str.replace(lstr[i], symbol);
}
}
return str;
}

Definition at line 601 of file JSRootPainter.js.