cfbb21b9bb
# Conflicts: # src/jmap/shape/Section/index.js # src/jmap/shape/Switch/index.js
71 lines
1.6 KiB
JavaScript
71 lines
1.6 KiB
JavaScript
// import Group from 'zrender/src/container/Group';
|
|
import Text from 'zrender/src/graphic/Text';
|
|
|
|
/** 名称元素*/
|
|
export default function ETextName(model) {
|
|
const TextName = new Text({
|
|
_subType: 'Text',
|
|
zlevel: model.zlevel,
|
|
z: model.z,
|
|
silent: model.silent || false,
|
|
style: {
|
|
x: model.x,
|
|
y: model.y,
|
|
fontWeight: model.fontWeight,
|
|
fontSize: model.fontSize,
|
|
fontFamily: model.fontFamily,
|
|
text: model.text,
|
|
textFill: model.textFill,
|
|
textAlign: model.textAlign,
|
|
textPosition: model.textPosition || 'inside',
|
|
textVerticalAlign: model.textVerticalAlign || null
|
|
}
|
|
});
|
|
return TextName;
|
|
}
|
|
// export default class ETextName extends Group {
|
|
// constructor(model) {
|
|
// super();
|
|
// this.model = model;
|
|
// this.zlevel = model.zlevel;
|
|
// this.z = model.z;
|
|
// this.create();
|
|
// }
|
|
|
|
// create() {
|
|
// this.TextName = new Text({
|
|
// _subType: this.model._subType,
|
|
// zlevel: this.zlevel,
|
|
// z: this.z,
|
|
// silent: this.model.silent || false,
|
|
// style: {
|
|
// x: this.model.x,
|
|
// y: this.model.y,
|
|
// text: this.model.text,
|
|
// textFont: this.model.textFont,
|
|
// textFill: this.model.textFill,
|
|
// textAlign: this.model.textAlign,
|
|
// textPosition: this.model.textPosition || 'inside',
|
|
// textVerticalAlign: this.model.textVerticalAlign || null
|
|
// }
|
|
// });
|
|
// this.add(this.TextName);
|
|
// }
|
|
|
|
// setStyle(model) {
|
|
// this.TextName.setStyle(model);
|
|
// }
|
|
|
|
// setColor(color) {
|
|
// this.TextName.setStyle('textFill', color);
|
|
// }
|
|
|
|
// hide() {
|
|
// this.TextName.hide();
|
|
// }
|
|
|
|
// show() {
|
|
// this.TextName.show();
|
|
// }
|
|
// }
|