Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
Core.settings.HandleKeys = false;
{jsDrawCode}
}}
const servers = ['/static/', 'https://root.cern/js/7.11.0/', 'https://jsroot.gsi.de/7.11.0/'],
const servers = ['/static/', 'https://root.cern/js/7.12.0/', 'https://jsroot.gsi.de/7.12.0/'],
path = 'build/jsroot';
if (typeof JSROOT !== 'undefined')
execCode_{jsDivId}(JSROOT);
Expand Down
5,542 changes: 3,618 additions & 1,924 deletions js/build/jsroot.js

Large diffs are not rendered by default.

65 changes: 44 additions & 21 deletions js/changes.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
# JSROOT changelog

## Changes in dev
1. Add textendash and textemdash `TLatex` symbols #407
1. Let store canvas as html file via context menu
1. Improve `TGraph` update
1. When draw `TH2`/`TF2` with "surf same" draw option, only lines are drawn
1. Implement new "POLF" and "POLN" draw options for polar coordinates for `TH2`
1. Adjust automatic colors handling in `THStack` and `TMultiGraph`
1. Let copy and paste histogram title, `TLatex` text and `TPave` label via context menu
1. Use "JSROOT" label for main pad button, hide it after 5 seconds from the drawing
1. Let preserve `BigInt` values when calling `rntupleProcess()` function #418
1. Use `8.6g`/`10.8g` format for float/double historgam content-to-text conversion in tooltips
1. Add `@vite-ignore` comment to dynamic imports to suppress Vite/Rollup analysis warnings
1. Fix - read all cluster groups from ntuple #415
1. Fix - correctly handle empty clusters in ntuple #420
1. Fix - reading of negative 64-bit integers #422
## Changes in 7.12.0
1. Add textendash and textemdash `TLatex` symbols #407 (@ferdymercury)
2. Let store canvas as HTML file via context menu
3. Improve `TGraph` update
4. When drawing `TH2`/`TF2` with "surf same" draw option, only lines are drawn
5. Implement new polar draw options "POLF" and "POLN" for `TH2`
6. Implement tooltips handling for `TScatter`
7. Adjust automatic colors handling in `THStack` and `TMultiGraph`
8. Let copy and paste histogram title, `TLatex` text and `TPave` label via context menu
9. Use "JSROOT" label for main pad button, hide it after 5 seconds from the drawing
10. Let preserve `BigInt` values when calling `rntupleProcess()` function #418 (@undefined-panda)
11. Let use primitive "player" for `RNTuple` to allow edititing draw expressions
12. Use `8.6g`/`10.8g` format for float/double histogram content-to-text conversion in tooltips
13. Add `@vite-ignore` comment to dynamic imports to suppress Vite/Rollup analysis warnings #409 (@prawnsgupta)
14. Upgrade three.js r183 -> r186 #424
15. Upgrade openui5 1.135.0 -> 1.152.0
16. Upgrade svg2pdf.js 2.6.0 -> 2.8.1
17. Upgrade jsPDF 3.0.3 -> 4.2.1
18. Upgrade lil-gui 0.20.0 -> 0.21.0
19. Fix - read all cluster groups from ntuples #415 (@undefined-panda)
20. Fix - correctly handle empty clusters in ntuples #420 (@undefined-panda)
21. Fix - reading of RNTuple std::bitset of 32 to 48 bits #430 (@sebxt)
22. Fix - decoding large LZMA buffers #431 (@Prafyl)


## Changes in 7.11.4
1. Fix - bug in `TH2` overflow counts display in stat box
2. Fix - reading of objects with custom streamer stored in `TTree` branch #432 (@Prafyl)
3. Fix - `TH3` stats calculation
4. Fix - large angle display in `TPieSlice`
5. Fix - interactive change of `TGraph` exclusion side and width
6. Fix - multiple typos in tooltips and stats (AI assisted)


## Changes in 7.11.3
1. Fix - reading of negative 64-bit integers #422 (@Prafyl)
2. Fix - include first value in TTree::Draw histogram range #427 (@sebxt)
3. Fix - `TH2` scat drawing for large histogram stats #428 (@Prafyl)


## Changes in 7.11.2
1. Fix - exclude @resvg/resvg-js from browser bundlers #421
1. Fix - exclude @resvg/resvg-js from browser bundlers #421 (@wiso)
2. Fix - hstack autocolor handling in `TWebCanvas`


Expand All @@ -27,11 +50,11 @@
2. Fix - JSON production for TWebCanvas
3. Fix - check evaluated value of TF1
4. Fix - corrupted page layout in SWAN after calling %rootbrowse
5. Fix - RNtuple decodeZigzag64 for SplitInt64 columns #410
5. Fix - RNTuple decodeZigzag64 for SplitInt64 columns #410 (@undefined-panda)


## Changes in 7.11.0
1. Implement new data types in `RNtuple`
1. Implement new data types in `RNTuple`
- reduced float types kFloat16, kReal32Trunc, kReal32Quant
- `std::vector`
- `std::map`, `std::unordered_map`, `std::multimap`, `std::unordered_multimap` with `std::pair`
Expand Down Expand Up @@ -69,8 +92,8 @@
## Changes in 7.10.2
1. Fix - correctly process `TLeafB` arrays in tree draw #384
2. Fix - better detect default ranges in `TGraph` histogram
3. Fix - convert BigInt before `RNtuple` drawing
4. Fix - pages and clusters processing in `RNtuple` #390
3. Fix - convert BigInt before `RNTuple` drawing
4. Fix - pages and clusters processing in `RNTuple` #390
5. Fix - extra row for legend header, proper horizontal align https://github.com/root-project/root/issues/21173


Expand All @@ -80,7 +103,7 @@


## Changes in 7.10.0
1. `RNtuple` support, thanks to Kriti Mahajan https://github.com/Krmjn09
1. `RNTuple` support, thanks to Kriti Mahajan https://github.com/Krmjn09
2. Implement `RTreeMapPainter` to display `RNTuple` structure, thanks to Patryk Pilichowski https://github.com/magnustymoteus
3. Implement `build3d` function for building three.js objects for `TH1/2/3`, `TLatex` `TGeo`, `TGraph2D` classes #368
4. Draw `TAnnotation3D` in real 3D with handling scene rotation
Expand Down
8 changes: 4 additions & 4 deletions js/modules/base/BasePainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const prSVG = 'data:image/svg+xml;charset=utf-8,',

/** @summary Returns visible rect of element
* @param {object} elem - d3.select object with element
* @param {string} [kind] - which size method is used
* @desc kind = 'bbox' use getBBox, works only with SVG
* kind = 'full' - full size of element, using getBoundingClientRect function
* kind = 'nopadding' - excludes padding area
* @param {string} [sizearg] - which size method is used
* @desc sizearg = 'bbox' use getBBox, works only with SVG
* sizearg = 'full' - full size of element, using getBoundingClientRect function
* sizearg = 'nopadding' - excludes padding area
* With node.js can use 'width' and 'height' attributes when provided in element
* @private */
function getElementRect(elem, sizearg) {
Expand Down
2 changes: 1 addition & 1 deletion js/modules/base/FontHandler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class FontHandler {
addCustomFontToSvg(svg) {
if (!this.base64 || !this.name)
return;
const clname = 'custom_font_' + this.name, fmt = 'ttf';
const clname = 'custom_font_' + this.name.replace(/[^a-zA-Z0-9]/g, '_'), fmt = 'ttf';
let defs = svg.selectChild('.canvas_defs');
if (defs.empty())
defs = svg.insert('svg:defs', ':first-child').attr('class', 'canvas_defs');
Expand Down
55 changes: 27 additions & 28 deletions js/modules/base/ObjectPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import { FontHandler } from './FontHandler.mjs';
import { getRootColors } from './colors.mjs';


/** @summary returns true if pad painter @private */
/** @summary returns true if pad painter
* @private */
function isPadPainter(p) {
return isFunc(p?.getRootPad) && isFunc(p?.forEachPainterInPad);
}

/** @summary returns canvas painter from DOM element @private */
/** @summary returns canvas painter from DOM element
* @private */
function getDomCanvasPainter(dom) {
const elem = dom?.select('.root_canvas');
return !elem || elem.empty() ? null : elem.property('pad_painter');
Expand All @@ -41,7 +43,7 @@ class ObjectPainter extends BasePainter {
#options_store; // stored draw options used to check changes
#user_tooltip_handler; // configured user tooltip handler
#user_tooltip_timeout; // timeout configured with tooltip handler
#user_toottip_handle; // timeout handle processing user tooltip
#user_tooltip_timerid; // setTimemout id for processing user tooltip
#user_context_menu; // function for user context menu
#special_draw_area; // current special draw area like projection
#root_colors; // custom colors list
Expand Down Expand Up @@ -223,7 +225,7 @@ class ObjectPainter extends BasePainter {
getDrawDom() { return this.getPadPainter() || this.getDom(); }

/** @summary Return actual draw options as string
* @param ignore_pad - do not include pad settings into histogram draw options
* @param {boolean} ignore_pad - do not include pad settings into histogram draw options
* @desc if options are not modified - returns original string which was specified for object draw */
getDrawOpt(ignore_pad) {
if (!this.#options)
Expand Down Expand Up @@ -288,9 +290,9 @@ class ObjectPainter extends BasePainter {
/** @summary Generic method to update object content.
* @desc Default implementation just copies first-level members to current object
* @param {object} obj - object with new data
* @param {string} [opt] - option which will be used for redrawing
* @param {string} [_opt] - option which will be used for redrawing
* @protected */
updateObject(obj /* , opt */) {
updateObject(obj, _opt) {
if (!this.matchObjectType(obj))
return false;
Object.assign(this.getObject(), obj);
Expand Down Expand Up @@ -496,9 +498,7 @@ class ObjectPainter extends BasePainter {
* @protected */
getCanvSvg() { return this.selectDom().select('.root_canvas'); }

/** @summary Method selects current pad name
* @param {string} [new_name] - when specified, new current pad name will be configured
* @return {string} previous selected pad or actual pad when new_name not specified
/** @summary Method did selects current pad name, now does nothing
* @private
* @deprecated to be removed in v8 */
selectCurrentPad() {
Expand All @@ -510,7 +510,7 @@ class ObjectPainter extends BasePainter {
* @desc X and Y coordinates can be converted by calling func.x(x) and func.y(y)
* Only can be used for painting in the pad, means CreateG() should be called without arguments
* @param {boolean} isndc - if NDC coordinates will be used
* @param {boolean} [noround] - if set, return coordinates will not be rounded
* @param {boolean} [nornd] - if set, return coordinates will not be rounded
* @param {boolean} [use_frame_coordinates] - use frame coordinates even when drawing on the pad
* @protected */
getAxisToSvgFunc(isndc, nornd, use_frame_coordinates) {
Expand Down Expand Up @@ -1247,8 +1247,7 @@ class ObjectPainter extends BasePainter {
* @desc The only legal way to draw text, support plain, latex and math text output
* @param {object} arg - different text draw options
* @param {string} arg.text - text to draw
* @param {number} [arg.align = 12] - int value like 12 or 31
* @param {string} [arg.align = undefined] - end;bottom
* @param {number|string} [arg.align = 12] - int value like 12 or 31 or string 'end;bottom'
* @param {number} [arg.x = 0] - x position
* @param {number} [arg.y = 0] - y position
* @param {number} [arg.width] - when specified, adjust font size in the specified box
Expand All @@ -1259,7 +1258,7 @@ class ObjectPainter extends BasePainter {
* @param {number} [arg.rotate] - rotation angle
* @param {number} [arg.font_size] - fixed font size
* @param {object} [arg.draw_g] - element where to place text, if not specified central draw_g container is used
* @param {function} [arg.post_process] - optional function called when specified text is drawn
* @param {Function} [arg.post_process] - optional function called when specified text is drawn
* @protected */
drawText(arg) {
if (!arg.text)
Expand Down Expand Up @@ -1389,7 +1388,7 @@ class ObjectPainter extends BasePainter {

/** @summary Finish text drawing
* @desc Should be called to complete all text drawing operations
* @param {function} [draw_g] - <g> element for text drawing, default is getG()
* @param {Function} [draw_g] - <g> element for text drawing, default is getG()
* @return {Promise} when text drawing completed
* @protected */
async finishTextDrawing(draw_g, try_optimize) {
Expand All @@ -1410,7 +1409,7 @@ class ObjectPainter extends BasePainter {
* Arguments fillmenu_func are (menu,kind)
* First is menu object, second is object sub-element like axis 'x' or 'y'
* Function should return promise with menu when items are filled
* @param {function} fillmenu_func - function to fill custom context menu for object */
* @param {Function} fillmenu_func - function to fill custom context menu for object */
configureUserContextMenu(fillmenu_func) {
this.#user_context_menu = isFunc(fillmenu_func) ? fillmenu_func : undefined;
}
Expand Down Expand Up @@ -1545,7 +1544,7 @@ class ObjectPainter extends BasePainter {
/** @summary Configure user-defined tooltip handler
* @desc Hook for the users to get tooltip information when mouse cursor moves over then object
* Handler function will be called every time when new data is selected
* @param {function} handler - function called when tooltip is produced
* @param {Function} handler - function called when tooltip is produced
* @param {number} [tmout = 100] - delay in ms before tooltip delivered */
configureUserTooltipHandler(handler, tmout = 100) {
if (!handler || !isFunc(handler)) {
Expand All @@ -1561,7 +1560,7 @@ class ObjectPainter extends BasePainter {
* @desc Function will be called every time when frame click was performed
* As argument, tooltip object with selected bins will be provided
* If handler function returns true, default handling of click will be disabled
* @param {function} handler - function called when mouse click is done */
* @param {Function} handler - function called when mouse click is done */
configureUserClickHandler(handler) {
const fp = this.getFramePainter();
if (isFunc(fp?.configureUserClickHandler))
Expand All @@ -1572,7 +1571,7 @@ class ObjectPainter extends BasePainter {
* @desc Function will be called every time when double click was called
* As argument, tooltip object with selected bins will be provided
* If handler function returns true, default handling of dblclick (unzoom) will be disabled
* @param {function} handler - function called when mouse double click is done */
* @param {Function} handler - function called when mouse double click is done */
configureUserDblclickHandler(handler) {
const fp = this.getFramePainter();
if (isFunc(fp?.configureUserDblclickHandler))
Expand All @@ -1595,24 +1594,24 @@ class ObjectPainter extends BasePainter {
if (this.#user_tooltip_timeout <= 0)
return this.#user_tooltip_handler(data);

if (this.#user_toottip_handle) {
clearTimeout(this.#user_toottip_handle);
this.#user_toottip_handle = undefined;
if (this.#user_tooltip_timerid) {
clearTimeout(this.#user_tooltip_timerid);
this.#user_tooltip_timerid = undefined;
}

if (!data)
return this.#user_tooltip_handler(data);

// only after timeout user function will be called
this.#user_toottip_handle = setTimeout(() => {
this.#user_toottip_handle = undefined;
this.#user_tooltip_timerid = setTimeout(() => {
this.#user_tooltip_timerid = undefined;
if (this.#user_tooltip_handler)
this.#user_tooltip_handler(data);
}, this.#user_tooltip_timeout);
}

/** @summary Provide projection areas
* @param kind - 'X', 'Y', 'XY' or ''
* @param {string} kind - 'X', 'Y', 'XY' or ''
* @private */
async provideSpecialDrawArea(kind) {
if (kind === this.#special_draw_area)
Expand All @@ -1625,9 +1624,9 @@ class ObjectPainter extends BasePainter {
}

/** @summary Draw in special projection areas
* @param obj - object to draw
* @param opt - draw option
* @param kind - '', 'X', 'Y'
* @param {object} obj - object to draw
* @param {string} opt - draw option
* @param {string} kind - '', 'X', 'Y'
* @private */
async drawInSpecialArea(obj, opt, kind) {
const canp = this.getCanvPainter();
Expand All @@ -1638,7 +1637,7 @@ class ObjectPainter extends BasePainter {
}

/** @summary Get tooltip for painter and specified event position
* @param {Object} evnt - object with clientX and clientY positions
* @param {object} evnt - object with clientX and clientY positions
* @private */
getToolTip(evnt) {
if ((evnt?.clientX === undefined) || (evnt?.clientY === undefined))
Expand Down
8 changes: 4 additions & 4 deletions js/modules/base/RObjectPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class RObjectPainter extends ObjectPainter {
}

/** @summary Evaluate RAttrText properties
* @return {Object} FontHandler, can be used directly for the text drawing */
* @return {object} FontHandler, can be used directly for the text drawing */
v7EvalFont(name, dflts, fontScale) {
if (!dflts)
dflts = {};
Expand Down Expand Up @@ -347,9 +347,9 @@ class RObjectPainter extends ObjectPainter {
}

/** @summary Submit request to server-side drawable
* @param kind defines request kind, only single request a time can be submitted
* @param req is object derived from DrawableRequest, including correct _typename
* @param method is method of painter object which will be called when getting reply */
* @param {string} kind defines request kind, only single request a time can be submitted
* @param {object} req is object derived from DrawableRequest, including correct _typename
* @param {string} method is method of painter object which will be called when getting reply */
v7SubmitRequest(kind, req, method) {
const canp = this.getCanvPainter();
if (!isFunc(canp?.submitDrawableRequest))
Expand Down
6 changes: 3 additions & 3 deletions js/modules/base/TAttLineHandler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const root_line_styles = [
class TAttLineHandler {

/** @summary constructor
* @param {object} attr - attributes, see {@link TAttLineHandler#setArgs} */
* @param {object} args - attributes or arguments of {@link TAttLineHandler#setArgs} */
constructor(args) {
this.func = this.apply.bind(this);
this.used = true;
Expand Down Expand Up @@ -59,7 +59,7 @@ class TAttLineHandler {
if (Math.abs(this.width) > 99) {
// exclusion graph
this.excl_side = (this.width < 0) ? -1 : 1;
this.excl_width = Math.floor(this.width / 100) * 5;
this.excl_width = Math.floor(Math.abs(this.width) / 100) * 5;
this.width = Math.abs(this.width % 100); // line width
}
}
Expand All @@ -75,7 +75,7 @@ class TAttLineHandler {
this.excl_width = width;
if (side !== undefined) {
this.excl_side = side;
if ((this.excl_width === 0) && this.excl_side)
if (side && !this.excl_width)
this.excl_width = 20;
}
this.changed = true;
Expand Down
7 changes: 5 additions & 2 deletions js/modules/base/TAttMarkerHandler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const root_50_67 = [2, 3, 5, 4, 25, 26, 27, 28, 30, 32, 35, 36, 37, 38, 40, 42,
class TAttMarkerHandler {

/** @summary constructor
* @param {object} args - attributes, see {@link TAttMarkerHandler#setArgs} for details */
* @param {object} args - attributes or arguments of {@link TAttMarkerHandler#setArgs} */
constructor(args) {
this.x0 = this.y0 = 0;
this.color = 'black';
Expand Down Expand Up @@ -173,6 +173,9 @@ class TAttMarkerHandler {
s34 = (size * 3 / 4).toFixed(this.ndig);

switch (shape) {
case 0: // empty
this.marker = '';
break;
case 1: // dot
this.marker = 'h1';
break;
Expand Down Expand Up @@ -289,7 +292,7 @@ class TAttMarkerHandler {
getFillColor() { return this.fill ? this.color : 'none'; }

/** @summary returns true if marker attributes will produce empty (invisible) output */
empty() { return (this.color === 'none') || (!this.fill && !this.stroke); }
empty() { return (this.color === 'none') || (!this.fill && !this.stroke) || !this.marker; }

/** @summary Apply marker styles to created element */
apply(selection) {
Expand Down
Loading
Loading