miranov25 / RootInteractive

5 stars 12 forks source link

Client side histogramming in bokeh interface - unbinned and binned data #90

Open miranov25 opened 3 years ago

miranov25 commented 3 years ago

Proposal: syntax for unbinned data histogramming on client

Standard syntax example: https://github.com/miranov25/RootInteractive/blob/master/RootInteractive/InteractiveDrawing/bokeh/test_bokehDrawSA.py

figureArray = [
#   ['A'], ['C-A'], {"color": "red", "size": 7, "colorZvar":"C", "filter": "A<0.5"}],
    [['A'], ['A*A-C*C'], {"color": "red", "size": 2, "colorZvar": "A", "varZ": "C", "errY": "errY", "errX":"0.01"}],
    [['A'], ['C+A', 'C-A', 'A/A']],
...
    [['D'], ['D*10'], {"size": 10, "errY": "errY"}],
]

->

figureArray = [
   ['A'], ['histo'], {"color": "red", "size": 7,nBins=10, range=() ],
   ['A','B'], ['histo'], {"color": "red", "size": 7, nBins=10 , range=()],
   ['A','B'], ['histo2D'], {"color": "red", "size": 7, nBins=10 , range=()],
]
miranov25 commented 3 years ago

Histogramming on server, slicing on client

miranov25 commented 3 years ago

Unbined histogramming on client:

figureArray = [
   ['A'], ['histo(A/B-C)'], {"color": "red", "size": 7,nBins=10, range=() ],
   ['A','B'], ['histo'], {"color": "red", "size": 7, nBins=10 , range=()],
   ['A','B'], ['histo2D'], {"color": "red", "size": 7, nBins=10 , range=()],
]
miranov25 commented 3 years ago

Summary of pull requests for the 1 dimensional histograms

Benchmark - 2 10^6 points with weights - solutions improvements as reported by Marian in pull requests above

Solution speedup factor commit time per 210^6 bins
Starting point 5 s
Caching bin calculation ~2 https://github.com/miranov25/RootInteractive/pull/93/commits/40b1f423c73363dca8b7971060b862b3342c5f75 ~??? s
Directo function call instead of callback ~3 https://github.com/miranov25/RootInteractive/pull/93/commits/379116962d0c8d555495d67d73d90fad6fb52ab6 Histogramming took 1073.6 ms
??? ~2 https://github.com/miranov25/RootInteractive/pull/93/commits/90ad2a6678af4e2b6f82958b09d3e9fa9a300e98 Histogramming took 730.9 milliseconds.
NEW using build in ~3 https://github.com/miranov25/RootInteractive/pull/94/commits/969368b92dbd3b744d84c58e02e233b34d362c28 Histogramming took 323.8 milliseconds.
miranov25 commented 3 years ago

2d histogram and histogram of functions and functions of histograms an categories histogramming - user interface

Histogram - parameters - in Dictionary {}

Function on top of histograms:

miranov25 commented 3 years ago
histogramArray = [
    {"name":"histo0", "title": "histo0", type="histo", variables=["X","Y"], "weight":"C" },
    {"name":"histo1", "title": "histo1", type="histo", variables=["X","Y"], "weight":"C" },
]

to be used in figure array using names.

miranov25 commented 3 years ago

Histogram drawing options to be defined:

miranov25 commented 3 years ago

Automatic resize of histograms on client

In case histogram ranges not specified - automatic ranges should be recalculated, or we should support auto mode