Integrated snap.svg and starting to render content
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
grammar JavascriptRegexp
|
||||
root <- ( ( "/" regexp "/" fl:[igm]* ) / regexp ) <Root>
|
||||
regexp <- match ( "|" regexp )? <Regexp>
|
||||
regexp <- match ( "|" match )* <Regexp>
|
||||
match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end?
|
||||
anchor_start <- "^"
|
||||
anchor_end <- "$"
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
export default {
|
||||
render(container) {
|
||||
this.rect = this.container.rect().attr({
|
||||
x: 5,
|
||||
y: 5,
|
||||
rx: 10,
|
||||
ry: 10,
|
||||
fill: '#f00'
|
||||
});
|
||||
this.text = this.container.text(0, 0, this.textValue).attr({
|
||||
fill: '#fff',
|
||||
fontWeight: 'bold'
|
||||
});
|
||||
},
|
||||
|
||||
position() {
|
||||
var box = this.text.getBBox();
|
||||
|
||||
this.container.attr({
|
||||
width: box.width + 20,
|
||||
height: box.height + 20
|
||||
});
|
||||
|
||||
this.text.attr({
|
||||
x: 10,
|
||||
y: box.height + 5
|
||||
});
|
||||
|
||||
this.rect.attr({
|
||||
width: box.width + 10,
|
||||
height: box.height + 10
|
||||
});
|
||||
},
|
||||
|
||||
flags() {
|
||||
var flags;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user