|
|
The Artefact Table allows displaying a list of child artefacts and one or more of their characteristics in table format, as shown below:
<chart type="ARTEFACTTABLE" id="ARTEFACT_TABLE_EXAMPLE" xLabel="X axis" yLabel="Y axis" onlyDirectChildren="true" targetArtefactTypes="FILE"> <indicator>LC</indicator> <indicator displayValueType="NAME">TESTABILITY</indicator> <indicator displayValueType="RANK">STABILITY</indicator> <indicator displayValueType="MNEMONIC">CHANGEABILITY</indicator> </chart>
In the example above, the indicators use different displayValueType
to show
all the supported values.
The Artefact Table
chart
element may have the following attributes:
targetArtefactTypes
allows to filter descendants according to their type. You can use one or more types.
Concrete and abstract types are supported, so it is possible to use an alias, as described in the section called “Artefact Types”.
onlyDirectChildren
(optional, default: false) includes artefacts that are direct children of the current artefact
when set to true, or all descendants of the current artefact when set to false.
orderByMeasure
(optional, alphabetical if omitted) allows sorting the list of artefacts according to the value of the specified measure ID.
inverted
(optional, default: false) allows reversing the sort order defined by the orderByMeasure
attribute.
The Artefact Table chart takes one or more
indicator
sub-elements, which can point to measures or indicators. Note that
the table cells are automatically coloured according to the corresponding scale level colour when the metric
displayed in the table is an indicator. This behaviour can be overridden by using the
colorFromScale
attribute, which takes a scale ID to apply colour from according to the
rank of the value displayed.
This chart also accepts a
filterMeasure
element, which allows refining which
artefacts are included on the chart. When drawing a chart, Squore checks if the metric specified is within the defined bounds for the artefact,
in order to know if it should be included in or excluded from the chart.
You can use the filterMeasure
(with a mandatory
dataBounds
attribute) as follows:
<chart id="CHART_ID" type="CHART_TYPE"> <measure>METRIC_A</measure> <measure>METRIC_B</measure> <filterMeasure dataBounds="[50;100]">METRIC_C</filterMeasure> </chart>
In the example above, the chart will include the artefact only if METRIC_C
is between 50 and 100.
Filtering artefacts on charts is not possible at model-level.
In addition, you can add a row and column to aggregate the results found in each table row or column using the
row
or column
element. Each of these elements accepts the following
attributes:
aggregationType
(optional, default: AVG in most charts, SUM in table charts) defines how the values for the
metrics on the chart are aggregated. The supported values are:
MIN
MAX
OCC
AVG
DEV
SUM
MED
MOD
label
(mandatory)
is a string that is displayed as the legend of the row or column.
color
(optional, default: GREY)
is the fill colour for the row or column. [colour syntax]
colorFromScale
(optional, default: empty)
allows filling cells with a colour taken from a specific scale.
The Distribution Table is an matrix-like visualisation of two characteristics of an artefact's descendants
<chart type="DISTRIBUTIONTABLE" id="DIST_TABLE_FIXED_COLOR_EXAMPLE" targetArtefactTypes="FILE" xLabel="Testability" yLabel="Number of Artefacts" topColor="ORANGE" bottomColor="BLUE"> <indicator>ROOT</indicator> <indicator>TESTABILITY</indicator> <row aggregationType="SUM" label="Total Col" color="GRAY" /> <column aggregationType="SUM" label="Total Line" color="GRAY" /> </chart>
The Distribution Table
chart
element may have the following attributes:
targetArtefactTypes
allows to filter descendants according to their type. You can use one or more types.
Concrete and abstract types are supported, so it is possible to use an alias, as described in the section called “Artefact Types”.
color
(optional, default: WHITE)
is the colour used to fill all the cells in the table. An example
Distribution Table using color
is shown later in this section. [colour syntax]
Instead of using a single colour for the entire table, you can use
topColor
, middleColor
and bottomColor
to colour the top, middle and
bottom sections of the chart respectively in different colours, as in the main example above. [colour syntax]
colorFromScale
(optional, default: none)
is the colour scale used to fill the cells in the table according to the rank of each cell. An example
Distribution Table using colorFromScale
is shown later in this section.
If several colour attributes are found, they are applied in this order:
The Distribution Table chart takes two
indicator
sub-element that will be used to build a matrix of scale levels.
In addition, you can add a row and column to aggregate the results found in each table row or column using the
row
or column
element. Each of these elements accepts the following
attributes:
aggregationType
(optional, default: AVG in most charts, SUM in table charts) defines how the values for the
metrics on the chart are aggregated. The supported values are:
MIN
MAX
OCC
AVG
DEV
SUM
MED
MOD
label
(mandatory)
is a string that is displayed as the legend of the row or column.
color
(optional, default: GREY)
is the fill colour for the row or column. [colour syntax]
colorFromScale
(optional, default: empty)
allows filling cells with a colour taken from a specific scale.
Some simpler examples of Distribution Table charts can be found below:
<chart type="DISTRIBUTIONTABLE" id="DIST_TABLE_EXAMPLE" targetArtefactTypes="FILE" xLabel="Testability" yLabel="Number of Artefacts"> <indicator>ROOT</indicator> <indicator>ANALYSABILITY</indicator> </chart>
Chart: <chart type="DISTRIBUTIONTABLE" id="DIST_TABLE_SCALE_COLOR_EXAMPLE" targetArtefactTypes="FILE" xLabel="Testability" yLabel="Number of Artefacts" colorFromScale="SCALE_TEST_BASIC"> <indicator>ROOT</indicator> <indicator>TESTABILITY</indicator> </chart> Scale: <Scale scaleId="SCALE_TEST_BASIC"> <ScaleLevel levelId="LEVELA" bounds="];1]" rank="1" /> <ScaleLevel levelId="LEVELB" bounds="]1;2]" rank="2" /> <ScaleLevel levelId="LEVELC" bounds="]2;4]" rank="3" /> <ScaleLevel levelId="LEVELD" bounds="]4;8]" rank="4" /> <ScaleLevel levelId="LEVELE" bounds="]8;16]" rank="5" /> <ScaleLevel levelId="LEVELF" bounds="]16;32]" rank="6" /> <ScaleLevel levelId="LEVELG" bounds="]32;[" rank="7" /> </Scale>
Chart: <chart type="DISTRIBUTIONTABLE" id="DIST_TABLE_SCALE_COLOR_TWO_COLORS_EXAMPLE" targetArtefactTypes="FILE" xLabel="Testability" yLabel="Number of Artefacts" topColorFromScale="SCALE_GREEN" middleColorFromScale="SCALE_RED" bottomColorFromScale="SCALE_RED"> <indicator>ROOT</indicator> <indicator>TESTABILITY</indicator> </chart> Scales: <Scale scaleId="SCALE_GREEN"> <ScaleLevel levelId="BLANK" bounds="];1[" rank="-1" /> <ScaleLevel levelId="LEVELA" bounds="[1;[" rank="1" /> </Scale> <Scale scaleId="SCALE_RED"> <ScaleLevel levelId="BLANK" bounds="];1[" rank="-1" /> <ScaleLevel levelId="LEVELG" bounds="[1;[" rank="1" /> </Scale>