|
HTMLExtensions Plugin contains definitions and implementations of HTML-like
tags that allow JAS3 to include live plots into HTML pages. Java implementation
of AIDA IPlotter is used to display plots, so corresponding tags were designed
to mimic the structure of IPlotter. Look here for more information on
IPlotter,
IPlotterRegion,
IPlotterStyle,
and AIDA interfaces in
general.
Here is simple example of HTML code that displays two histograms from a Root
file rootdemo.root.
If you want to see exact same pictures, you need to:
- Download file rootdemo.root
- In JAS3 main menu go to File -> Open Data Source, select
Root File (.root) and follow through
- rootdemo.root node should appear in the JAS3 Tree window (left
top)
Please note that "plotData" attribute of <aidaplot> tag specifies
the full path to a particular histogram in JAS3 Tree (tree in JAS3 left frame).
<HTML>
<HEAD>
<TITLE>Test of JAS3 HTML
Plots</TITLE>
</HEAD>
<BODY>
More from the Root demo file: <br>
<aidaplotter regionX="2" regionY="1" width="600" height="300">
<aidaregion>
<aidaplot plotData="/rootdemo.root/h10">
</aidaplot>
</aidaregion>
<aidaregion>
<aidaplot plotData="/rootdemo.root/h1028">
</aidaplot>
</aidaregion>
</aidaplotter>
</BODY>
</HTML>
And that is what you'll see in JAS3 web browser window:

So, there is aidaplotter that contains one or more regions. Exact
layout of regions can be controlled by optional "regionX" and "regionY"
attributes. The size of aidaplotter is defined by "width" and "height"
attributes.
One or more histograms can be displayed inside each aidaregion, the
region described by the following code will have two overlaid plots inside:
<aidaregion>
<aidaplot plotData="/rootdemo.root/h100">
</aidaplot>
<aidaplot plotData="/rootdemo.root/h_9999">
</aidaplot>
</aidaregion>
AIDA standard introduced
IPlotterStyle
to give user control over the way the plot is drawn. Styles may contain other
styles as well as parameters (attributes). For example, top level
IPlotterStyle
contains
IDataStyle, that in turn contains
IMarkerStyle. So all properties of a marker - size, color, shape, etc. are
defined in
IMarkerStyle.
If you have AIDAStyleEditorPlugin installed, you can create, edit, and
save
IPlotterStyle
by going to "AIDA Style Editor" menu (under Tools),
or by right-clicking on a particular histogram in JAS3 Tree and selecting
"Create AIDA Style". Such exercise can be also useful for understanding
hierarchy and structure of AIDA
IPlotterStyle
.
Top level IPlotterStyle is represented by aidaplotterstyle tag. All
lower level styles are represented by aidastyle tag with appropriate
type attribute:
- IDataStyle :: <aidastyle
type="dataStyle">
- IMarkerStyle :: <aidastyle type="markerStyle">
There are two ways to define aidaplotterstyle:
- Using "styleRef" attribute to specify location
of XML file with style definition.
- Define particular style parameters directly in HTML,
using aidastyle and aidastyleattribute tags.
You can also combine both ways in one tag. In this case HTML definition
overwrites any parameters defined in XML file. In the example below style is
read from MyPlotterStyle.xml file, then color, shape, and size of the marker are
modified by the HTML tags.
<aidaplotterstyle styleRef="./xml/MyPlotterStyle.xml>
<aidastyle type="dataStyle">
<aidastyle type="markerStyle">
<aidastyleattribute
attributeName="color" attributeValue="red">
<aidastyleattribute
attributeName="shape" attributeValue="dot">
<aidastyleattribute
attributeName="size" attributeValue="6">
</aidastyle>
</aidastyle>
</aidaplotterstyle>
All three tags: aidaplotter, aidaregion, and aidaplot
can contain aidaplotterstyle definition. It is also possible to set the
global style for the whole HTML page by providing aidaplotterstyle tag
outside the scope of aidaplotter.
To understand the way styles work it is important to understand the
hierarchical structure of the AIDA styles. When plot is created, a cascade of
styles is taken into account: the style for a particular HTML page (if any), the
style associated with the aidaplotter, the style associated with the
aidaregion, the default style for a given type of data, and the style
associated with aidaplot. When retrieving the value of a give style
parameter we first start from the aidaplot styles (if any) and navigate
down through all the above styles until we find a style for which the given
style parameter has been set. This means that the style parameters set in a
aidaplot will always overwrite the parameter set in aidaregion,
aidaplotter, and HTML page.
In the example below we define global style for the whole page and define
style for plotter.
First region in the plotter does not specify any additional styles, so it is
just using plotter and page styles exactly as they are defined in XML files.
Second region also uses plotter and page styles, but in addition it defines
several extra parameters, in particular it makes marker visible.
<HTML>
<HEAD>
<TITLE>Test of JAS3 HTML Plots with
STYLES</TITLE>
</HEAD>
<BODY>
<!-- Global Style for this page -->
<aidaplotterstyle styleRef="./xml/MyPageStyle.xml>
</aidaplotterstyle>
Compare MC (left) and DATA (right) : <BR>
<aidaplotter width="600" height="300">
<!-- Define Style for this
plotter -->
<aidaplotterstyle styleRef="./xml/MyMonteCarloStyle.xml>
</aidaplotterstyle>
<!-- This region does not specify any additional style, use already
defined plotter and page styles -->
<aidaregion>
<aidaplot plotData="/MC/h10-mc">
</aidaplot>
</aidaregion>
<!-- This region adds to already defined plotter and page styles to show
marker and switch the fill off -->
<aidaregion>
<aidaplotterstyle>
<aidastyle type="dataStyle">
<aidastyle type="markerStyle">
<aidastyleattribute
attributeName="isVisible" attributeValue="true">
<aidastyleattribute
attributeName="color" attributeValue="red">
<aidastyleattribute
attributeName="shape" attributeValue="dot">
<aidastyleattribute
attributeName="size" attributeValue="6">
</aidastyle>
<aidastyle type="fillStyle">
<aidastyleattribute
attributeName="isVisible" attributeValue="false">
</aidastyle>
</aidastyle>
</aidaplotterstyle>
<aidaplot plotData="/DATA/h10-data">
</aidaplot>
</aidaregion>
</aidaplotter>
</BODY>
</HTML>
This section contains list of all extra HTML tags and attributes that are
used to display plots.
- <aidaplotter>
- Possible attributes:
- height
- width
- regionX
- regionY
- May include:
- aidaregion
- aidaplotterstyle
- <aidaregion>
- Possible attributes:
- May include:
- aidaplot
- aidaplotterstyle
- <aidaplot>
- Possible attributes:
- plotName
- plotData
- plotOptions
- May include:
- <aidaplotterstyle>
- Possible attributes:
- May include:
- aidastyle
- aidastyleattribute
- <aidastyle>
- Possible attributes:
- May include:
- aidastyle
- aidastyleattribute
- <aidastyleattribute>
- Possible attributes:
- attributeName
- attributeValue
- May include:
|