Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
ec538f03
Commit
ec538f03
authored
8 years ago
by
Attila Bagoly
Committed by
Enric Tejedor Saavedra
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
JsMVA: jsmva magic extra lines fix
parent
3603094e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/pyroot/JsMVA/JPyInterface.py
+15
-14
15 additions, 14 deletions
bindings/pyroot/JsMVA/JPyInterface.py
bindings/pyroot/JsMVA/OutputTransformer.py
+4
-2
4 additions, 2 deletions
bindings/pyroot/JsMVA/OutputTransformer.py
with
19 additions
and
16 deletions
bindings/pyroot/JsMVA/JPyInterface.py
+
15
−
14
View file @
ec538f03
...
...
@@ -208,16 +208,17 @@ class JsDraw:
</script>
"""
)
## Template containing requirejs configuration with JsMVA location
__jsCodeRequireJSConfig
=
Template
(
"""
<script type=
"
text/javascript
"
>
require.config({
paths: {
'
JsMVA
'
:
'
$PATH/JsMVA.min
'
}
});
</script>
"""
)
## Template containing JsMVA initialization code (adding JsMVA script location, and CSS)
__JsMVAInitCode
=
Template
(
"""
<script type=
"
text/javascript
"
>
require.config({
paths: {
'
JsMVA
'
:
'
$PATH/JsMVA.min
'
}
});
</script>
<link rel=
"
stylesheet
"
href=
"
$CSSFile
"
></link>
"""
)
## Template containing data insertion JavaScript code
__jsCodeForDataInsert
=
Template
(
"""
<script id=
"
dataInserterScript
"
>
...
...
@@ -233,13 +234,13 @@ jsmva.$funcName('$divid', '$dat');
});
</script>
"""
)
## Inserts
requirejs config script
## Inserts
initialization codes to notebook
@staticmethod
def
InitJsMVA
():
display
(
HTML
(
JsDraw
.
__jsCodeRequireJSConfig
.
substitute
({
'
PATH
'
:
JsDraw
.
__jsMVASourceDir
display
(
HTML
(
JsDraw
.
__JsMVAInitCode
.
substitute
({
'
PATH
'
:
JsDraw
.
__jsMVASourceDir
,
'
CSSFile
'
:
JsDraw
.
__jsMVACSSDir
+
'
/TMVAHTMLOutput.min.css
'
})))
JsDraw
.
InsertCSS
(
"
TMVAHTMLOutput.min.css
"
)
## Inserts the draw area and drawing JavaScript to output
# @param obj ROOT object (will be converted to JSON) or JSON string containing the data to be drawed
...
...
This diff is collapsed.
Click to expand it.
bindings/pyroot/JsMVA/OutputTransformer.py
+
4
−
2
View file @
ec538f03
...
...
@@ -311,7 +311,7 @@ class transformTMVAOutputToHTML:
self
.
err
=
""
if
str
(
error
).
find
(
"
, time left:
"
)
==-
1
:
self
.
err
=
error
self
.
out
=
"
<table class=
'
tmva_output_table
'
>
"
self
.
out
=
""
self
.
lines
=
output
.
splitlines
()
self
.
iterLines
=
iter
(
xrange
(
len
(
self
.
lines
)))
for
self
.
lineIndex
in
self
.
iterLines
:
...
...
@@ -357,5 +357,7 @@ class transformTMVAOutputToHTML:
self
.
out
+=
"
<tr><td>
"
+
lines
[
ii
]
+
"
</td></tr>
"
else
:
self
.
out
+=
line
self
.
out
+=
"
</table>
"
if
len
(
self
.
out
)
<
1
and
len
(
self
.
err
)
<
1
:
return
(
""
,
""
,
""
)
self
.
out
=
"
<table class=
'
tmva_output_table
'
>
"
+
self
.
out
+
"
</table>
"
return
(
self
.
out
,
self
.
err
,
"
html
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment