|
1 |
| -// flowchart, v1.2.8 |
| 1 | +// flowchart, v1.2.9 |
2 | 2 | // Copyright (c)2014 Adriano Raiano (adrai).
|
3 | 3 | // Distributed under MIT license
|
4 | 4 | // http://adrai.github.io/flowchart.js
|
|
93 | 93 | 'text-margin': 10,
|
94 | 94 | 'font-size': 14,
|
95 | 95 | 'font-color': 'black',
|
| 96 | + // 'font': 'normal', |
| 97 | + // 'font-family': 'calibri', |
| 98 | + // 'font-weight': 'normal', |
96 | 99 | 'line-color': 'black',
|
97 | 100 | 'element-color': 'black',
|
98 | 101 | 'fill': 'white',
|
|
172 | 175 | var symbol = chart.paper.path(path, pathValues);
|
173 | 176 | symbol.attr('stroke', chart.options['element-color']);
|
174 | 177 | symbol.attr('stroke-width', chart.options['line-width']);
|
| 178 | + |
| 179 | + var font = chart.options['font']; |
| 180 | + var fontF = chart.options['font-family']; |
| 181 | + var fontW = chart.options['font-weight']; |
| 182 | + |
| 183 | + if (font) symbol.attr({ 'font': font }); |
| 184 | + if (fontF) symbol.attr({ 'font-family': fontF }); |
| 185 | + if (fontW) symbol.attr({ 'font-weight': fontW }); |
| 186 | + |
175 | 187 | return symbol;
|
176 | 188 | }
|
177 | 189 |
|
|
199 | 211 | 'arrow-end': chart.options['arrow-end']
|
200 | 212 | });
|
201 | 213 |
|
| 214 | + var font = chart.options['font']; |
| 215 | + var fontF = chart.options['font-family']; |
| 216 | + var fontW = chart.options['font-weight']; |
| 217 | + |
| 218 | + if (font) line.attr({ 'font': font }); |
| 219 | + if (fontF) line.attr({ 'font-family': fontF }); |
| 220 | + if (fontW) line.attr({ 'font-weight': fontW }); |
| 221 | + |
202 | 222 | if (text) {
|
203 | 223 |
|
204 | 224 | var centerText = false;
|
|
255 | 275 | x: x,
|
256 | 276 | y: y
|
257 | 277 | });
|
| 278 | + |
| 279 | + if (font) textPath.attr({ 'font': font }); |
| 280 | + if (fontF) textPath.attr({ 'font-family': fontF }); |
| 281 | + if (fontW) textPath.attr({ 'font-weight': fontW }); |
258 | 282 | }
|
259 | 283 |
|
260 | 284 | return line;
|
|
417 | 441 | 'x': (this.chart.options.symbols[this.symbolType]['text-margin'] || this.chart.options['text-margin']),
|
418 | 442 | stroke: (this.chart.options.symbols[this.symbolType]['font-color'] || this.chart.options['font-color'])
|
419 | 443 | });
|
| 444 | + |
| 445 | + var font = (this.chart.options.symbols[this.symbolType]['font'] || this.chart.options['font']); |
| 446 | + var fontF = (this.chart.options.symbols[this.symbolType]['font-family'] || this.chart.options['font-family']); |
| 447 | + var fontW = (this.chart.options.symbols[this.symbolType]['font-weight'] || this.chart.options['font-weight']); |
| 448 | + |
| 449 | + if (font) this.text.attr({ 'font': font }); |
| 450 | + if (fontF) this.text.attr({ 'font-family': fontF }); |
| 451 | + if (fontW) this.text.attr({ 'font-weight': fontW }); |
| 452 | + |
420 | 453 | if (options.link) { this.text.attr('href', options.link); }
|
421 | 454 | if (options.target) { this.text.attr('target', options.target); }
|
422 | 455 | if (this.chart.options.symbols[this.symbolType]['maxWidth'] || this.chart.options['maxWidth']) {
|
|
691 | 724 | maxX = right.x + lineLength/2;
|
692 | 725 | } else if ((origin && origin === 'right') && isRight) {
|
693 | 726 | line = drawLine(this.chart, right, [
|
694 |
| - {x: symbolRight.x + lineLength/2, y: right.y}, |
695 |
| - {x: symbolRight.x + lineLength/2, y: symbolTop.y - lineLength/2}, |
696 |
| - {x: symbolTop.x, y: symbolTop.y - lineLength/2}, |
| 727 | + {x: symbolTop.x, y: right.y}, |
697 | 728 | {x: symbolTop.x, y: symbolTop.y}
|
698 | 729 | ], text);
|
699 | 730 | this.rightStart = true;
|
700 | 731 | symbol.topEnd = true;
|
701 |
| - maxX = symbolRight.x + lineLength/2; |
| 732 | + maxX = right.x + lineLength/2; |
702 | 733 | } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {
|
703 | 734 | line = drawLine(this.chart, bottom, [
|
704 | 735 | {x: bottom.x, y: bottom.y + lineLength/2},
|
|
868 | 899 | height: this.text.getBBox().height + 2 * (this.chart.options.symbols[this.symbolType]['text-margin'] || this.chart.options['text-margin']),
|
869 | 900 | fill: (this.chart.options.symbols[this.symbolType]['fill'] || this.chart.options['fill'])
|
870 | 901 | });
|
| 902 | + |
| 903 | + var font = (this.chart.options.symbols[this.symbolType]['font'] || this.chart.options['font']); |
| 904 | + var fontF = (this.chart.options.symbols[this.symbolType]['font-family'] || this.chart.options['font-family']); |
| 905 | + var fontW = (this.chart.options.symbols[this.symbolType]['font-weight'] || this.chart.options['font-weight']); |
| 906 | + |
| 907 | + if (font) innerWrap.attr({ 'font': font }); |
| 908 | + if (fontF) innerWrap.attr({ 'font-family': fontF }); |
| 909 | + if (fontW) innerWrap.attr({ 'font-weight': fontW }); |
| 910 | + |
871 | 911 | if (options.link) { innerWrap.attr('href', options.link); }
|
872 | 912 | if (options.target) { innerWrap.attr('target', options.target); }
|
873 | 913 | this.group.push(innerWrap);
|
|
0 commit comments