Skip to content

Commit

Permalink
Support inband OutputElementStyle for annotations
Browse files Browse the repository at this point in the history
To provide annotation markers the output styles needed to defined
in the list of style provided through the fetch style method which
are referenced by the parent style key in the annotation itself.

This patch makes it possible to supply the OutputElementStyle inside
the annotation without using the parent style key.

Signed-off-by: Bernd Hufmann <[email protected]>
  • Loading branch information
bhufmann committed Jan 12, 2021
1 parent f87b732 commit 116c65f
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,23 +377,24 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent<Timegr
if (metadata && metadata.style) {
const elementStyle: OutputElementStyle = metadata.style;
const modelStyle = styleModel.styles[elementStyle.parentKey];
let currentStyle = Object.assign({}, elementStyle.values);
if (modelStyle) {
const currentStyle = Object.assign({}, modelStyle.values, elementStyle.values);
if (currentStyle) {
let color = 0;
if (currentStyle['color']) {
color = this.hexStringToNumber(currentStyle['color']);
}
let symbolSize = this.props.style.rowHeight * 0.8 / 2;
if (currentStyle['height']) {
symbolSize = currentStyle['height'] * symbolSize;
}
return {
symbol: currentStyle['symbol-type'],
size: symbolSize,
color: color
};
currentStyle = Object.assign({}, modelStyle.values, elementStyle.values);
}
if (currentStyle) {
let color = 0;
if (currentStyle['color']) {
color = this.hexStringToNumber(currentStyle['color']);
}
let symbolSize = this.props.style.rowHeight * 0.8 / 2;
if (currentStyle['height']) {
symbolSize = currentStyle['height'] * symbolSize;
}
return {
symbol: currentStyle['symbol-type'],
size: symbolSize,
color: color
};
}
}
}
Expand Down

0 comments on commit 116c65f

Please sign in to comment.