Skip to content

Commit

Permalink
Added a workaround to make TeX work with getDefaultVars template
Browse files Browse the repository at this point in the history
  • Loading branch information
pl0xz0rz committed Feb 10, 2024
1 parent d91f278 commit 967ff7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def getDefaultVars(normalization=None, variables=None, defaultVariables={}, weig
#
['descriptionTable', {"name":"description"}],
['selectionTable', {"name":"selection"}],
[['bin_center_0'], ['bin_count'], {"source":"histoXYData", "name":"tex_hack", "xAxisTitle": "$$X_0$$"}],
figureGlobalOption
]
figureLayoutDesc={
Expand All @@ -281,6 +282,7 @@ def getDefaultVars(normalization=None, variables=None, defaultVariables={}, weig
}
figureLayoutDesc["selection"] = ["selection", {'plot_height': 200, 'sizing_mode': 'scale_width'}]
figureLayoutDesc["description"] = ["description", {'plot_height': 200, 'sizing_mode': 'scale_width'}]
figureLayoutDesc["ignoreme"] = ["tex_hack", {'plot_height': 200, 'sizing_mode': 'scale_width'}]

print("Default RootInteractive variables are defined.")
return aliasArray, variables, parameterArray, widgetParams, widgetLayoutDesc, histoArray, figureArray, figureLayoutDesc
Expand Down Expand Up @@ -570,6 +572,7 @@ def getDefaultVarsNormAll(variables=None, defaultVariables={}, weights=None, mul
#
['descriptionTable', {"name":"description"}],
['selectionTable', {"name":"selection"}],
[['bin_center_0'], ['bin_count'], {"source":"histoXYData", "name":"tex_hack", "xAxisTitle": "$$X_0$$"}],
figureGlobalOption
]
figureLayoutDesc={
Expand All @@ -582,6 +585,7 @@ def getDefaultVarsNormAll(variables=None, defaultVariables={}, weights=None, mul
}
figureLayoutDesc["selection"] = ["selection", {'plot_height': 200, 'sizing_mode': 'scale_width'}]
figureLayoutDesc["description"] = ["description", {'plot_height': 200, 'sizing_mode': 'scale_width'}]
figureLayoutDesc["ignoreme"] = ["tex_hack", {'plot_height': 200, 'sizing_mode': 'scale_width'}]

print("Default RootInteractive variables are defined.")
return aliasArray, transformArray, variables, parameterArray, widgetParams, widgetLayoutDesc, histoArray, figureArray, figureLayoutDesc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
df['errY']=df.A*0.02+0.02
df.head(10)
df.meta.metaData = {'A.AxisTitle': "A (cm)", 'B.AxisTitle': "B (cm/s)", 'C.AxisTitle': "C (s)",
'D.AxisTitle': "D (a.u.)", 'Bool.AxisTitle': "A>half"}
'D.AxisTitle': r"\[x\pi\]", 'Bool.AxisTitle': "A>half"}

#widgets="slider.A(0,1,0.05,0,1), slider.B(0,1,0.05,0,1), slider.C(0,1,0.01,0.1,1), slider.D(0,1,0.01,0,1), checkbox.Bool(1), multiselect.E(0,1,2,3,4)"
widgets="slider.A(0,1,0.05,0,1), slider.B(0,1,0.05,0,1), slider.C(0,1,0.01,0.1,1), slider.D(0,1,0.01,0,1), checkbox.Bool(1)"
Expand Down Expand Up @@ -458,7 +458,7 @@ def test_interactiveTemplateMultiDiff():
jsFunctionArray=jsFunctionArray)

def test_interactiveTemplateMultiYDiff():
output_file("test_histogramTemplateMultiY.html")
output_file("test_histogramTemplateMultiYDiff.html")
aliasArray, jsFunctionArray, variables, parameterArray, widgetParams, widgetLayoutDesc, histoArray, figureArray, figureLayoutDesc = getDefaultVarsNormAll(variables=["A", "B", "C", "D"], multiAxis="varY")
widgetsSelect = [
['range', ['A'], {"name":"A"}],
Expand All @@ -472,3 +472,4 @@ def test_interactiveTemplateMultiYDiff():
widgetLayout=widgetLayoutDesc, sizing_mode="scale_width", histogramArray=histoArray, aliasArray=aliasArray, arrayCompression=arrayCompressionRelative16,
jsFunctionArray=jsFunctionArray)

test_interactiveTemplateMultiY()
4 changes: 2 additions & 2 deletions RootInteractive/InteractiveDrawing/bokeh/test_bokehDrawSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
df['maskAC']=2*(df['A']>.5)|1*(df['C']>.5)
df['ones']=1
df.head(10)
df.meta.metaData = {'A.AxisTitle': "A (cm)", 'B.AxisTitle': "B (cm/s)", 'C.AxisTitle': "C (s)", 'D.AxisTitle': "D (a.u.)", 'E.AxisTitle': "Category", "A.Description": "The distance A"}
df.meta.metaData = {'A.AxisTitle': r"\[x\pi\]", 'B.AxisTitle': "B (cm/s)", 'C.AxisTitle': "C (s)", 'D.AxisTitle': "D (a.u.)", 'E.AxisTitle': "Category", "A.Description": "The distance A"}

parameterArray = [
{"name": "colorZ", "value":"A", "options":["A", "B", "EE"]},
Expand All @@ -73,7 +73,7 @@
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"}],
[['X'], ['C+A', 'C-A', 'A/A'], {"name": "fig1"}],
[['X'], ['C+A', 'C-A', 'A/A'], {"name": "fig1", "xAxisTitle":r"\[x\pi\]", "plotTitle":"C+A, C-A vs {X}" }],
[['B'], ['C+B', 'C-B'], { "colorZvar": "B", "errY": "errY", "rescaleColorMapper": True, "colorAxisLabel": "B (cm/s)"}],
[['D'], ['(A+B+C)*DD'], {"colorZvar": "colorZ", "size": 10, "errY": "errY"} ],
# [['D'], ['D*10'], {"size": 10, "errY": "errY","markers":markerFactor, "color":colorFactor,"legend_field":"DDC"}],
Expand Down

0 comments on commit 967ff7f

Please sign in to comment.