types#Metadata TypeScript Examples
The following examples show how to use
types#Metadata.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CoordinateSpaceClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 6 votes |
constructor(
id: number,
linkURL: LinkURLClass,
meta: Metadata[],
lowerLimit: LowerLimitClass[],
label: string,
textObj: TextObject,
mainMetric: Metric,
metrics: Metric[],
colorMode: boolean,
traceBack: boolean,
traceBorder: boolean,
positionParameter: PositionParameterClass
) {
this.id = id;
this.linkURL = linkURL;
this.meta = meta;
this.lowerLimit = lowerLimit;
this.label = label;
this.textObj = textObj;
this.mainMetric = mainMetric;
this.metrics = metrics;
this.colorMode = colorMode;
this.traceBack = traceBack;
this.traceBorder = traceBorder;
this.positionParameter = positionParameter;
}
Example #2
Source File: RegionClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 6 votes |
constructor(
id: number,
linkURL: LinkURLClass,
meta: Metadata[],
lowerLimitClass: LowerLimitClass[],
label: string,
textObj: TextObject,
mainMetric: Metric,
metrics: Metric[],
colorMode: boolean,
traceBack: boolean,
traceBorder: boolean,
positionParameter: PositionParameterClass,
idSVG: string,
orientedLink: OrientedLinkClass[],
coords: Coord4D,
coordsDefault: Coord4D,
mode: boolean,
img: string,
widthInitialSpaceDefault: string,
heightInitialSpaceDefault: string
) {
super(id, linkURL, meta, lowerLimitClass, label, textObj, mainMetric, metrics, colorMode, traceBack, traceBorder, positionParameter);
this.idSVG = idSVG;
this.mode = mode;
this.orientedLink = orientedLink;
this.coords = coords;
this.coordsDefault = coordsDefault;
this.img = img;
this.widthInitialSpaceDefault = widthInitialSpaceDefault;
this.heightInitialSpaceDefault = heightInitialSpaceDefault;
}
Example #3
Source File: manageMetada.tsx From grafana-weathermap-panel with Apache License 2.0 | 6 votes |
onMetaStrChanged = (event: { currentTarget: HTMLInputElement }) => {
if (this.props.type === 'point') {
let newData: Metadata = this.getCurrentPoint().meta[parseInt(event.currentTarget.id, 10)];
newData.meta = event.currentTarget.value;
this.getCurrentPoint().meta[parseInt(event.currentTarget.id, 10)].meta = newData.meta;
this.props.onOptionsChange({ ...this.props.options, arrayPoints: this.props.options.arrayPoints });
}
if (this.props.type === 'region') {
let newData: Metadata = this.getCurrentRegion().meta[parseInt(event.currentTarget.id, 10)];
newData.meta = event.currentTarget.value;
this.getCurrentRegion().meta[parseInt(event.currentTarget.id, 10)].meta = newData.meta;
this.props.onOptionsChange({ ...this.props.options, regionCoordinateSpace: this.props.options.regionCoordinateSpace });
}
if (this.props.type === 'link') {
let newData: Metadata = this.getCurrentLink().meta[parseInt(event.currentTarget.id, 10)];
newData.meta = event.currentTarget.value;
this.getCurrentLink().meta[parseInt(event.currentTarget.id, 10)].meta = newData.meta;
this.props.onOptionsChange({ ...this.props.options, arrayOrientedLinks: this.props.options.arrayOrientedLinks });
}
};
Example #4
Source File: CoordinateSpaceClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
meta: Metadata[];
Example #5
Source File: LinkClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
constructor(
id: number,
linkURL: LinkURLClass,
meta: Metadata[],
lowerLimitClass: LowerLimitClass[],
label: string,
textObj: TextObject,
mainMetric: Metric,
metrics: Metric[],
colorMode: boolean,
traceBack: boolean,
traceBorder: boolean,
positionParameter: PositionParameterClass,
name: string,
defineHowToGetCoordonate: SelectableValue<string>,
orientationLink: SelectableValue<string>,
pointAPositionX: string,
pointAPositionY: string,
colorCoordinateA: string,
pointBPositionX: string,
pointBPositionY: string,
colorCoordinateB: string,
pointIn: SelectableValue<PointClass>,
pointOut: SelectableValue<PointClass>,
regionIn: SelectableValue<RegionClass>,
colorRegionIn: string,
regionOut: SelectableValue<RegionClass>,
colorRegionOut: string,
labelLinkA: string,
positionXLabelA: string,
positionYLabelA: string,
labelLinkB: string,
positionXLabelB: string,
positionYLabelB: string
) {
super(id, linkURL, meta, lowerLimitClass, label, textObj, mainMetric, metrics, colorMode, traceBack, traceBorder, positionParameter);
this.name = name;
this.defineHowToGetCoordonate = defineHowToGetCoordonate;
this.orientationLink = orientationLink;
this.pointAPositionX = pointAPositionX;
this.pointAPositionY = pointAPositionY;
this.colorCoordinateA = colorCoordinateA;
this.pointBPositionX = pointBPositionX;
this.pointBPositionY = pointBPositionY;
this.colorCoordinateB = colorCoordinateB;
this.pointIn = pointIn;
this.pointOut = pointOut;
this.regionIn = regionIn;
this.colorRegionIn = colorRegionIn;
this.regionOut = regionOut;
this.colorRegionOut = colorRegionOut;
this.labelLinkA = labelLinkA;
this.positionXLabelA = positionXLabelA;
this.positionYLabelA = positionYLabelA;
this.labelLinkB = labelLinkB;
this.positionXLabelB = positionXLabelB;
this.positionYLabelB = positionYLabelB;
}
Example #6
Source File: OrientedLinkClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
constructor(
id: number,
linkURL: LinkURLClass,
meta: Metadata[],
lowerLimitClass: LowerLimitClass[],
label: string,
textObj: TextObject,
mainMetric: Metric,
metrics: Metric[],
colorMode: boolean,
traceBack: boolean,
traceBorder: boolean,
positionParameter: PositionParameterClass,
name: string,
orientationLink: SelectableValue<string>,
size: string,
pointAPositionX: string,
pointAPositionY: string,
colorCoordinateA: string,
pointBPositionX: string,
pointBPositionY: string,
colorCoordinateB: string,
valueMainMetricA: string,
valueMainMetricB: string,
pointIn: string,
pointOut: string,
regionIn: string,
regionOut: string,
zIndex: number,
pointCPositionX: string,
pointCPositionY: string,
isIncurved: SelectableValue<boolean>,
mainMetricB: Metric,
metricsB: Metric[],
widthInitialSpaceDefault: string,
heightInitialSpaceDefault: string,
pointAPositionXDefault: string,
pointAPositionYDefault: string,
pointBPositionXDefault: string,
pointBPositionYDefault: string,
pointCPositionXDefault: string,
pointCPositionYDefault: string
) {
super(id, linkURL, meta, lowerLimitClass, label, textObj, mainMetric, metrics, colorMode, traceBack, traceBorder, positionParameter);
this.name = name;
this.orientationLink = orientationLink;
this.size = size;
this.pointAPositionX = pointAPositionX;
this.pointAPositionY = pointAPositionY;
this.colorCoordinateA = colorCoordinateA;
this.pointBPositionX = pointBPositionX;
this.pointBPositionY = pointBPositionY;
this.colorCoordinateB = colorCoordinateB;
this.valueMainMetricA = valueMainMetricA;
this.valueMainMetricB = valueMainMetricB;
this.pointIn = pointIn;
this.pointOut = pointOut;
this.regionIn = regionIn;
this.regionOut = regionOut;
this.zIndex = zIndex;
this.pointCPositionX = pointCPositionX;
this.pointCPositionY = pointCPositionY;
this.isIncurved = isIncurved;
this.mainMetricB = mainMetricB;
this.metricsB = metricsB;
this.widthInitialSpaceDefault = widthInitialSpaceDefault;
this.heightInitialSpaceDefault = heightInitialSpaceDefault;
this.pointAPositionXDefault = pointAPositionXDefault;
this.pointAPositionYDefault = pointAPositionYDefault;
this.pointBPositionXDefault = pointBPositionXDefault;
this.pointBPositionYDefault = pointBPositionYDefault;
this.pointCPositionXDefault = pointCPositionXDefault;
this.pointCPositionYDefault = pointCPositionYDefault;
}
Example #7
Source File: PointClass.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
constructor(
id: number,
linkURL: LinkURLClass,
meta: Metadata[],
lowerLimitClass: LowerLimitClass[],
label: string,
textObj: TextObject,
mainMetric: Metric,
metrics: Metric[],
colorMode: boolean,
traceBack: boolean,
traceBorder: boolean,
positionParameter: PositionParameterClass,
name: string,
valueMetric: string,
drawGraphicMarker: SelectableValue<string>,
shape: SelectableValue<string>,
//sizeWidth: SelectableValue<string>,
sizeWidth: string,
sizeHeight: SelectableValue<string>,
rotateArrow: string,
positionShapeX: string,
positionShapeY: string,
color: string,
associateOrientedLinksIn: any[],
associateOrientedLinksOut: any[],
widthInitialSpaceDefault: string,
heightInitialSpaceDefault: string,
positionXDefault: string,
positionYDefault: string
) {
super(id, linkURL, meta, lowerLimitClass, label, textObj, mainMetric, metrics, colorMode, traceBack, traceBorder, positionParameter);
this.name = name;
this.valueMetric = valueMetric;
this.drawGraphicMarker = drawGraphicMarker;
this.shape = shape;
this.sizeWidth = sizeWidth;
this.sizeHeight = sizeHeight;
this.rotateArrow = rotateArrow;
this.positionShapeX = positionShapeX;
this.positionShapeY = positionShapeY;
this.color = color;
this.associateOrientedLinksIn = associateOrientedLinksIn;
this.associateOrientedLinksOut = associateOrientedLinksOut;
this.widthInitialSpaceDefault = widthInitialSpaceDefault;
this.heightInitialSpaceDefault = heightInitialSpaceDefault;
this.positionXDefault = positionXDefault;
this.positionYDefault = positionYDefault;
}
Example #8
Source File: SimplePanel.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
private displayMetaDataRegionSVG = (region: RegionClass): JSX.Element => {
let resultHtml: JSX.Element[] = [];
const arrayMeta: Metadata[] = region.meta;
if (arrayMeta.length !== 0) {
resultHtml.push(
<p
key={'titleMetadataRegionSVG' + region.id + region.idSVG}
style={{
fontFamily: this.props.options.display.police,
fontSize: '10px',
marginTop: '5px',
marginBottom: '0px',
color: 'white',
}}
>
Metadata
</p>
);
let indexMeta = 0;
arrayMeta.forEach((meta) => {
const styleContentMetaData = {
color: meta.obj.colorText,
backgroundColor: meta.obj.colorBack,
fontWeight: meta.obj.style.bold ? 'bold' : 'normal',
fontStyle: meta.obj.style.italic ? 'italic' : 'normal',
textDecoration: meta.obj.style.underline ? 'underline' : 'none',
fontFamily: this.props.options.display.police,
fontSize: '9px',
marginLeft: '10px',
marginBottom: '0px',
} as CSSProperties;
resultHtml.push(
<p key={indexMeta + 'textMetadataRegionSVG' + region.id} style={styleContentMetaData}>
{meta.meta}
</p>
);
indexMeta++;
});
}
return (
<div key={'metadataTooltipRegionSVG' + region.id + region.idSVG} id="metadataTooltipSVG">
{resultHtml}
</div>
);
};
Example #9
Source File: coordinateSpace.tsx From grafana-weathermap-panel with Apache License 2.0 | 5 votes |
// meta
saveMetaData = (meta: Metadata[]) => {
const old = this.state.arrayCoor;
old.meta = meta;
this.setState({
arrayCoor: old,
});
};
Example #10
Source File: manageMetada.tsx From grafana-weathermap-panel with Apache License 2.0 | 4 votes |
// element for one Meta
displayMetaList = (props: any): JSX.Element => {
const l10n = require('Localization/en.json');
if (props.type === 'point' && this.props.options.arrayPoints.length !== 0) {
let point: PointClass = this.getCurrentPoint();
const list = point.meta.map((meta: Metadata, index: number) => (
<div
key={'point' + this.props.idCoordinate + 'EditorMetadata'}
style={{
marginTop: '5px',
border: '1px solid black',
padding: '10px',
}}
>
<p style={{ fontSize: '16px', fontWeight: 'normal', textAlign: 'left', paddingLeft: '8px' }}>Metadata {index + 1}</p>
<div
key={'Meta' + index}
style={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-around',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<FormField
id={index.toString()}
key={'Meta' + index.toString()}
label={'Text metadata'}
labelWidth={10}
inputWidth={23}
type="string"
value={meta.meta || ''}
onChange={this.onMetaStrChanged.bind(this)}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorBack}
keyInt={index}
text={l10n.textObject.colorBackground}
_onChange={this.onChangeBackColor}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorText}
keyInt={index}
text={l10n.textObject.colorText}
_onChange={this.onChangeTextColor}
/>
</div>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Bold</FormLabel>
<Switch
label=""
checked={meta.obj.style.bold}
onChange={() => {
let newArrayPoint: PointClass[] = this.props.options.arrayPoints;
if (this.getCurrentPoint().meta[index].obj.style.bold) {
this.getCurrentPoint().meta[index].obj.style.bold = false;
} else {
this.getCurrentPoint().meta[index].obj.style.bold = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayPoints: newArrayPoint });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Italic</FormLabel>
<Switch
label=""
checked={meta.obj.style.italic}
onChange={() => {
let newArrayPoint: PointClass[] = this.props.options.arrayPoints;
if (this.getCurrentPoint().meta[index].obj.style.italic) {
this.getCurrentPoint().meta[index].obj.style.italic = false;
} else {
this.getCurrentPoint().meta[index].obj.style.italic = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayPoints: newArrayPoint });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Underline</FormLabel>
<Switch
label=""
checked={meta.obj.style.underline}
onChange={() => {
let newArrayPoint: PointClass[] = this.props.options.arrayPoints;
if (this.getCurrentPoint().meta[index].obj.style.underline) {
this.getCurrentPoint().meta[index].obj.style.underline = false;
} else {
this.getCurrentPoint().meta[index].obj.style.underline = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayPoints: newArrayPoint });
}}
/>
</div>
</div>
</div>
<div
style={{
display: 'flex',
justifyContent: 'right',
margin: '10px 0px',
}}
>
<Button
variant={'danger'}
onClick={() => {
let newArrayPoints: PointClass[] = this.props.options.arrayPoints;
this.getCurrentPoint().meta.splice(index, 1);
this.props.onOptionsChange({ ...this.props.options, arrayPoints: newArrayPoints });
}}
>
Delete
</Button>
</div>
</div>
));
return <div>{list}</div>;
}
if (props.type === 'region' && this.props.options.regionCoordinateSpace.length !== 0) {
let region: RegionClass = this.getCurrentRegion();
const list = region.meta.map((meta: Metadata, index: number) => (
<div
key={'region' + this.props.idCoordinate + 'EditorMetadata' + index}
style={{
marginTop: '5px',
border: '1px solid black',
padding: '10px',
}}
>
<p style={{ fontSize: '16px', fontWeight: 'normal', textAlign: 'center', paddingLeft: '8px' }}>Metadata {index + 1}</p>
<div
key={'Meta' + index}
style={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-around',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<FormField
id={index.toString()}
key={'Meta' + index.toString()}
label={'Text metadata'}
labelWidth={10}
inputWidth={23}
type="string"
value={meta.meta || ''}
onChange={this.onMetaStrChanged.bind(this)}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorBack}
keyInt={index}
text={l10n.textObject.colorBackground}
_onChange={this.onChangeBackColor}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorText}
keyInt={index}
text={l10n.textObject.colorText}
_onChange={this.onChangeTextColor}
/>
</div>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Bold</FormLabel>
<Switch
label=""
checked={meta.obj.style.bold}
onChange={() => {
let newArrayRegion: RegionClass[] = this.props.options.regionCoordinateSpace;
if (this.getCurrentRegion().meta[index].obj.style.bold) {
this.getCurrentRegion().meta[index].obj.style.bold = false;
} else {
this.getCurrentRegion().meta[index].obj.style.bold = true;
}
this.props.onOptionsChange({ ...this.props.options, regionCoordinateSpace: newArrayRegion });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Italic</FormLabel>
<Switch
label=""
checked={meta.obj.style.italic}
onChange={() => {
let newArrayRegion: RegionClass[] = this.props.options.regionCoordinateSpace;
if (this.getCurrentRegion().meta[index].obj.style.italic) {
this.getCurrentRegion().meta[index].obj.style.italic = false;
} else {
this.getCurrentRegion().meta[index].obj.style.italic = true;
}
this.props.onOptionsChange({ ...this.props.options, regionCoordinateSpace: newArrayRegion });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Underline</FormLabel>
<Switch
label=""
checked={meta.obj.style.underline}
onChange={() => {
let newArrayRegion: RegionClass[] = this.props.options.regionCoordinateSpace;
if (this.getCurrentRegion().meta[index].obj.style.underline) {
this.getCurrentRegion().meta[index].obj.style.underline = false;
} else {
this.getCurrentRegion().meta[index].obj.style.underline = true;
}
this.props.onOptionsChange({ ...this.props.options, regionCoordinateSpace: newArrayRegion });
}}
/>
</div>
</div>
</div>
<div
style={{
display: 'flex',
justifyContent: 'right',
margin: '10px',
}}
>
<Button
variant={'danger'}
onClick={() => {
let newArrayRegion: RegionClass[] = this.props.options.regionCoordinateSpace;
this.getCurrentRegion().meta.splice(index, 1);
this.props.onOptionsChange({ ...this.props.options, regionCoordinateSpace: newArrayRegion });
}}
>
Delete
</Button>
</div>
</div>
));
return <div>{list}</div>;
}
if (props.type === 'link' && this.props.options.arrayOrientedLinks.length !== 0) {
let link: OrientedLinkClass = this.getCurrentLink();
const list = link.meta.map((meta: Metadata, index: number) => (
<div
key={'link' + this.props.idCoordinate + 'EditorMetadata'}
style={{
marginTop: '5px',
border: '1px solid black',
padding: '10px',
}}
>
<p style={{ fontSize: '16px', fontWeight: 'normal', textAlign: 'center', paddingLeft: '8px' }}>Metadata {index + 1}</p>
<div
key={'Meta' + index}
style={{
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-around',
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<FormField
id={index.toString()}
key={'Meta' + index.toString()}
label={'Text metadata'}
labelWidth={10}
inputWidth={23}
type="string"
value={meta.meta || ''}
onChange={this.onMetaStrChanged.bind(this)}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorBack}
keyInt={index}
text={l10n.textObject.colorBackground}
_onChange={this.onChangeBackColor}
/>
<InputSeriesColorPicker
width={30}
color={meta.obj.colorText}
keyInt={index}
text={l10n.textObject.colorText}
_onChange={this.onChangeTextColor}
/>
</div>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Bold</FormLabel>
<Switch
label=""
checked={meta.obj.style.bold}
onChange={() => {
let newArrayOrientedLink: OrientedLinkClass[] = this.props.options.arrayOrientedLinks;
if (this.getCurrentLink().meta[index].obj.style.bold) {
this.getCurrentLink().meta[index].obj.style.bold = false;
} else {
this.getCurrentLink().meta[index].obj.style.bold = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayOrientedLinks: newArrayOrientedLink });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Italic</FormLabel>
<Switch
label=""
checked={meta.obj.style.italic}
onChange={() => {
let newArrayOrientedLink: OrientedLinkClass[] = this.props.options.arrayOrientedLinks;
if (this.getCurrentLink().meta[index].obj.style.italic) {
this.getCurrentLink().meta[index].obj.style.italic = false;
} else {
this.getCurrentLink().meta[index].obj.style.italic = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayOrientedLinks: newArrayOrientedLink });
}}
/>
</div>
<div id={index.toString()} style={{ display: 'flex' }}>
<FormLabel width={30}>Underline</FormLabel>
<Switch
label=""
checked={meta.obj.style.underline}
onChange={() => {
let newArrayOrientedLink: OrientedLinkClass[] = this.props.options.arrayOrientedLinks;
if (this.getCurrentLink().meta[index].obj.style.underline) {
this.getCurrentLink().meta[index].obj.style.underline = false;
} else {
this.getCurrentLink().meta[index].obj.style.underline = true;
}
this.props.onOptionsChange({ ...this.props.options, arrayOrientedLinks: newArrayOrientedLink });
}}
/>
</div>
</div>
</div>
<div
style={{
display: 'flex',
justifyContent: 'right',
marginBottom: '10px',
}}
>
<Button
variant={'danger'}
onClick={() => {
let newArrayOrientedLink: OrientedLinkClass[] = this.props.options.arrayOrientedLinks;
this.getCurrentLink().meta.splice(index, 1);
this.props.onOptionsChange({ ...this.props.options, arrayOrientedLinks: newArrayOrientedLink });
}}
>
Delete
</Button>
</div>
</div>
));
return <div>{list}</div>;
}
return <div></div>;
};