scateu.me-jekyll-theme 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/css/main.scss +56 -0
- data/feed.xml +30 -0
- data/index.html +22 -0
- data/js/.DS_Store +0 -0
- data/js/flowchart-latest.js +991 -0
- data/js/jquery-3.1.1.min.js +4 -0
- data/js/qrcode.min.js +1 -0
- data/js/raphael-min.js +11 -0
- data/js/reveal.js/.gitignore +13 -0
- data/js/reveal.js/.travis.yml +5 -0
- data/js/reveal.js/CONTRIBUTING.md +23 -0
- data/js/reveal.js/Gruntfile.js +176 -0
- data/js/reveal.js/LICENSE +19 -0
- data/js/reveal.js/README.md +1148 -0
- data/js/reveal.js/bower.json +27 -0
- data/js/reveal.js/css/print/paper.css +202 -0
- data/js/reveal.js/css/print/pdf.css +160 -0
- data/js/reveal.js/css/reveal.css +1344 -0
- data/js/reveal.js/css/reveal.scss +1412 -0
- data/js/reveal.js/css/theme/README.md +21 -0
- data/js/reveal.js/css/theme/beige.css +291 -0
- data/js/reveal.js/css/theme/black.css +287 -0
- data/js/reveal.js/css/theme/blood.css +310 -0
- data/js/reveal.js/css/theme/league.css +293 -0
- data/js/reveal.js/css/theme/moon.css +291 -0
- data/js/reveal.js/css/theme/night.css +285 -0
- data/js/reveal.js/css/theme/serif.css +287 -0
- data/js/reveal.js/css/theme/simple.css +287 -0
- data/js/reveal.js/css/theme/sky.css +294 -0
- data/js/reveal.js/css/theme/solarized.css +291 -0
- data/js/reveal.js/css/theme/source/beige.scss +39 -0
- data/js/reveal.js/css/theme/source/black.scss +49 -0
- data/js/reveal.js/css/theme/source/blood.scss +79 -0
- data/js/reveal.js/css/theme/source/league.scss +34 -0
- data/js/reveal.js/css/theme/source/moon.scss +57 -0
- data/js/reveal.js/css/theme/source/night.scss +35 -0
- data/js/reveal.js/css/theme/source/serif.scss +35 -0
- data/js/reveal.js/css/theme/source/simple.scss +38 -0
- data/js/reveal.js/css/theme/source/sky.scss +46 -0
- data/js/reveal.js/css/theme/source/solarized.scss +63 -0
- data/js/reveal.js/css/theme/source/white.scss +49 -0
- data/js/reveal.js/css/theme/template/mixins.scss +29 -0
- data/js/reveal.js/css/theme/template/settings.scss +43 -0
- data/js/reveal.js/css/theme/template/theme.scss +346 -0
- data/js/reveal.js/css/theme/white.css +287 -0
- data/js/reveal.js/demo.html +410 -0
- data/js/reveal.js/index.html +50 -0
- data/js/reveal.js/js/reveal.js +4744 -0
- data/js/reveal.js/lib/css/zenburn.css +80 -0
- data/js/reveal.js/lib/font/league-gothic/LICENSE +2 -0
- data/js/reveal.js/lib/font/league-gothic/league-gothic.css +10 -0
- data/js/reveal.js/lib/font/league-gothic/league-gothic.eot +0 -0
- data/js/reveal.js/lib/font/league-gothic/league-gothic.ttf +0 -0
- data/js/reveal.js/lib/font/league-gothic/league-gothic.woff +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/LICENSE +45 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- data/js/reveal.js/lib/font/source-sans-pro/source-sans-pro.css +39 -0
- data/js/reveal.js/lib/js/classList.js +2 -0
- data/js/reveal.js/lib/js/head.min.js +9 -0
- data/js/reveal.js/lib/js/html5shiv.js +7 -0
- data/js/reveal.js/package.json +44 -0
- data/js/reveal.js/plugin/highlight/highlight.js +31 -0
- data/js/reveal.js/plugin/markdown/example.html +129 -0
- data/js/reveal.js/plugin/markdown/markdown.js +405 -0
- data/js/reveal.js/plugin/markdown/marked.js +6 -0
- data/js/reveal.js/plugin/math/math.js +67 -0
- data/js/reveal.js/plugin/multiplex/client.js +13 -0
- data/js/reveal.js/plugin/multiplex/index.js +64 -0
- data/js/reveal.js/plugin/multiplex/master.js +31 -0
- data/js/reveal.js/plugin/multiplex/package.json +19 -0
- data/js/reveal.js/plugin/notes-server/client.js +65 -0
- data/js/reveal.js/plugin/notes-server/index.js +69 -0
- data/js/reveal.js/plugin/notes-server/notes.html +407 -0
- data/js/reveal.js/plugin/notes/notes.html +414 -0
- data/js/reveal.js/plugin/notes/notes.js +136 -0
- data/js/reveal.js/plugin/print-pdf/print-pdf.js +48 -0
- data/js/reveal.js/plugin/search/search.js +196 -0
- data/js/reveal.js/plugin/zoom-js/zoom.js +278 -0
- data/js/reveal.js/test/examples/assets/image1.png +0 -0
- data/js/reveal.js/test/examples/assets/image2.png +0 -0
- data/js/reveal.js/test/examples/barebones.html +41 -0
- data/js/reveal.js/test/examples/embedded-media.html +49 -0
- data/js/reveal.js/test/examples/math.html +185 -0
- data/js/reveal.js/test/examples/slide-backgrounds.html +144 -0
- data/js/reveal.js/test/examples/slide-transitions.html +101 -0
- data/js/reveal.js/test/qunit-1.12.0.css +244 -0
- data/js/reveal.js/test/qunit-1.12.0.js +2212 -0
- data/js/reveal.js/test/test-markdown-element-attributes.html +134 -0
- data/js/reveal.js/test/test-markdown-element-attributes.js +46 -0
- data/js/reveal.js/test/test-markdown-slide-attributes.html +128 -0
- data/js/reveal.js/test/test-markdown-slide-attributes.js +47 -0
- data/js/reveal.js/test/test-markdown.html +52 -0
- data/js/reveal.js/test/test-markdown.js +15 -0
- data/js/reveal.js/test/test-pdf.html +83 -0
- data/js/reveal.js/test/test-pdf.js +15 -0
- data/js/reveal.js/test/test.html +86 -0
- data/js/reveal.js/test/test.js +597 -0
- data/js/sequence-diagram-min.js +8 -0
- data/js/underscore-min.js +1 -0
- metadata +111 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e4d1c9f1a68bc73d2cd444f58f55a49a04666f6
|
4
|
+
data.tar.gz: 152c2c6989dc5ef29d82f434c056df3f4a14459c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd31e79f4286073e0302168f4ba04a7d4748fbca099a834eb698a10f9944367aa959259ccbc5d4ca5a618248a5c1d9de0e881e476a3f6217500a72434ea9060a
|
7
|
+
data.tar.gz: 753b5c6a08429e6aac4dc1815333790738d21f9f02ed9df7a938af36368b4761bd41dde2c8b26f2b56c8d39fad5c562ae20956cd06acfa2357a6e0af87284d90
|
data/css/main.scss
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
# Only the main Sass file needs front matter (the dashes are enough)
|
3
|
+
---
|
4
|
+
@charset "utf-8";
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
// Our variables
|
9
|
+
//$base-font-family: Helvetica, Arial, sans-serif;
|
10
|
+
//$base-font-family: Microsoft Yahei,Hiragino Sans GB,Helvetica,Arial,sans-serif;
|
11
|
+
$base-font-family: "lucida grande","lucida sans unicode",lucida,helvetica,"Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;
|
12
|
+
$code-font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
|
13
|
+
$base-font-size: 16px;
|
14
|
+
$small-font-size: $base-font-size * 0.875;
|
15
|
+
$base-line-height: 1.5;
|
16
|
+
|
17
|
+
$spacing-unit: 30px;
|
18
|
+
|
19
|
+
$text-color: #111;
|
20
|
+
$background-color: #fdfdfd;
|
21
|
+
$brand-color: #2a7ae2;
|
22
|
+
|
23
|
+
$grey-color: #828282;
|
24
|
+
$grey-color-light: lighten($grey-color, 40%);
|
25
|
+
$grey-color-dark: darken($grey-color, 25%);
|
26
|
+
|
27
|
+
$on-palm: 600px;
|
28
|
+
$on-laptop: 800px;
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
// Using media queries with like this:
|
33
|
+
// @include media-query($palm) {
|
34
|
+
// .wrapper {
|
35
|
+
// padding-right: $spacing-unit / 2;
|
36
|
+
// padding-left: $spacing-unit / 2;
|
37
|
+
// }
|
38
|
+
// }
|
39
|
+
@mixin media-query($device) {
|
40
|
+
@media screen and (max-width: $device) {
|
41
|
+
@content;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
// Import partials from `sass_dir` (defaults to `_sass`)
|
48
|
+
@import
|
49
|
+
"base",
|
50
|
+
"layout",
|
51
|
+
"syntax-highlighting",
|
52
|
+
"ruby",
|
53
|
+
"details",
|
54
|
+
"toc",
|
55
|
+
"table"
|
56
|
+
;
|
data/feed.xml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
layout: null
|
3
|
+
---
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
6
|
+
<channel>
|
7
|
+
<title>{{ site.title | xml_escape }}</title>
|
8
|
+
<description>{{ site.description | xml_escape }}</description>
|
9
|
+
<link>{{ site.url }}{{ site.baseurl }}/</link>
|
10
|
+
<atom:link href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml" />
|
11
|
+
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
|
12
|
+
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
|
13
|
+
<generator>Jekyll v{{ jekyll.version }}</generator>
|
14
|
+
{% for post in site.posts limit:10 %}
|
15
|
+
<item>
|
16
|
+
<title>{{ post.title | xml_escape }}</title>
|
17
|
+
<description>{{ post.content | xml_escape }}</description>
|
18
|
+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
|
19
|
+
<link>{{ post.url | prepend: site.baseurl | prepend: site.url }}</link>
|
20
|
+
<guid isPermaLink="true">{{ post.url | prepend: site.baseurl | prepend: site.url }}</guid>
|
21
|
+
{% for tag in post.tags %}
|
22
|
+
<category>{{ tag | xml_escape }}</category>
|
23
|
+
{% endfor %}
|
24
|
+
{% for cat in post.categories %}
|
25
|
+
<category>{{ cat | xml_escape }}</category>
|
26
|
+
{% endfor %}
|
27
|
+
</item>
|
28
|
+
{% endfor %}
|
29
|
+
</channel>
|
30
|
+
</rss>
|
data/index.html
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
---
|
4
|
+
|
5
|
+
<div class="home">
|
6
|
+
|
7
|
+
<!--<h1 class="page-heading">Posts</h1>-->
|
8
|
+
|
9
|
+
<ul class="post-list">
|
10
|
+
{% for post in site.posts %}
|
11
|
+
<li>
|
12
|
+
<!--<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>-->
|
13
|
+
<span class="post-meta">{{ post.date | date: "%Y-%m-%d,%A" }}</span>
|
14
|
+
|
15
|
+
<h1>
|
16
|
+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
|
17
|
+
</h1>
|
18
|
+
</li>
|
19
|
+
{% endfor %}
|
20
|
+
</ul>
|
21
|
+
|
22
|
+
</div>
|
data/js/.DS_Store
ADDED
Binary file
|
@@ -0,0 +1,991 @@
|
|
1
|
+
// flowchart.js, v1.6.4
|
2
|
+
// Copyright (c)yyyy Adriano Raiano (adrai).
|
3
|
+
// Distributed under MIT license
|
4
|
+
// http://adrai.github.io/flowchart.js
|
5
|
+
|
6
|
+
!function(root, factory) {
|
7
|
+
if ("object" == typeof exports && "object" == typeof module) module.exports = factory(require("Raphael")); else if ("function" == typeof define && define.amd) define([ "Raphael" ], factory); else {
|
8
|
+
var a = factory("object" == typeof exports ? require("Raphael") : root.Raphael);
|
9
|
+
for (var i in a) ("object" == typeof exports ? exports : root)[i] = a[i];
|
10
|
+
}
|
11
|
+
}(this, function(__WEBPACK_EXTERNAL_MODULE_15__) {
|
12
|
+
/******/
|
13
|
+
return function(modules) {
|
14
|
+
/******/
|
15
|
+
/******/
|
16
|
+
// The require function
|
17
|
+
/******/
|
18
|
+
function __webpack_require__(moduleId) {
|
19
|
+
/******/
|
20
|
+
/******/
|
21
|
+
// Check if module is in cache
|
22
|
+
/******/
|
23
|
+
if (installedModules[moduleId]) /******/
|
24
|
+
return installedModules[moduleId].exports;
|
25
|
+
/******/
|
26
|
+
/******/
|
27
|
+
// Create a new module (and put it into the cache)
|
28
|
+
/******/
|
29
|
+
var module = installedModules[moduleId] = {
|
30
|
+
/******/
|
31
|
+
exports: {},
|
32
|
+
/******/
|
33
|
+
id: moduleId,
|
34
|
+
/******/
|
35
|
+
loaded: !1
|
36
|
+
};
|
37
|
+
/******/
|
38
|
+
/******/
|
39
|
+
// Return the exports of the module
|
40
|
+
/******/
|
41
|
+
/******/
|
42
|
+
/******/
|
43
|
+
// Execute the module function
|
44
|
+
/******/
|
45
|
+
/******/
|
46
|
+
/******/
|
47
|
+
// Flag the module as loaded
|
48
|
+
/******/
|
49
|
+
return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
|
50
|
+
module.loaded = !0, module.exports;
|
51
|
+
}
|
52
|
+
// webpackBootstrap
|
53
|
+
/******/
|
54
|
+
// The module cache
|
55
|
+
/******/
|
56
|
+
var installedModules = {};
|
57
|
+
/******/
|
58
|
+
/******/
|
59
|
+
// Load entry module and return exports
|
60
|
+
/******/
|
61
|
+
/******/
|
62
|
+
/******/
|
63
|
+
/******/
|
64
|
+
// expose the modules object (__webpack_modules__)
|
65
|
+
/******/
|
66
|
+
/******/
|
67
|
+
/******/
|
68
|
+
// expose the module cache
|
69
|
+
/******/
|
70
|
+
/******/
|
71
|
+
/******/
|
72
|
+
// __webpack_public_path__
|
73
|
+
/******/
|
74
|
+
return __webpack_require__.m = modules, __webpack_require__.c = installedModules,
|
75
|
+
__webpack_require__.p = "", __webpack_require__(0);
|
76
|
+
}([ /* 0 */
|
77
|
+
/*!******************!*\
|
78
|
+
!*** ./index.js ***!
|
79
|
+
\******************/
|
80
|
+
/***/
|
81
|
+
function(module, exports, __webpack_require__) {
|
82
|
+
__webpack_require__(/*! ./src/flowchart.shim */ 8);
|
83
|
+
var parse = __webpack_require__(/*! ./src/flowchart.parse */ 4);
|
84
|
+
__webpack_require__(/*! ./src/jquery-plugin */ 14);
|
85
|
+
var FlowChart = {
|
86
|
+
parse: parse
|
87
|
+
};
|
88
|
+
"undefined" != typeof window && (window.flowchart = FlowChart), module.exports = FlowChart;
|
89
|
+
}, /* 1 */
|
90
|
+
/*!**********************************!*\
|
91
|
+
!*** ./src/flowchart.helpers.js ***!
|
92
|
+
\**********************************/
|
93
|
+
/***/
|
94
|
+
function(module, exports) {
|
95
|
+
function _defaults(options, defaultOptions) {
|
96
|
+
if (!options || "function" == typeof options) return defaultOptions;
|
97
|
+
var merged = {};
|
98
|
+
for (var attrname in defaultOptions) merged[attrname] = defaultOptions[attrname];
|
99
|
+
for (attrname in options) options[attrname] && ("object" == typeof merged[attrname] ? merged[attrname] = _defaults(merged[attrname], options[attrname]) : merged[attrname] = options[attrname]);
|
100
|
+
return merged;
|
101
|
+
}
|
102
|
+
function _inherits(ctor, superCtor) {
|
103
|
+
if ("function" == typeof Object.create) // implementation from standard node.js 'util' module
|
104
|
+
ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {
|
105
|
+
constructor: {
|
106
|
+
value: ctor,
|
107
|
+
enumerable: !1,
|
108
|
+
writable: !0,
|
109
|
+
configurable: !0
|
110
|
+
}
|
111
|
+
}); else {
|
112
|
+
// old school shim for old browsers
|
113
|
+
ctor.super_ = superCtor;
|
114
|
+
var TempCtor = function() {};
|
115
|
+
TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
// move dependent functions to a container so that
|
119
|
+
// they can be overriden easier in no jquery environment (node.js)
|
120
|
+
module.exports = {
|
121
|
+
defaults: _defaults,
|
122
|
+
inherits: _inherits
|
123
|
+
};
|
124
|
+
}, /* 2 */
|
125
|
+
/*!*********************************!*\
|
126
|
+
!*** ./src/flowchart.symbol.js ***!
|
127
|
+
\*********************************/
|
128
|
+
/***/
|
129
|
+
function(module, exports, __webpack_require__) {
|
130
|
+
function Symbol(chart, options, symbol) {
|
131
|
+
this.chart = chart, this.group = this.chart.paper.set(), this.symbol = symbol, this.connectedTo = [],
|
132
|
+
this.symbolType = options.symbolType, this.flowstate = options.flowstate || "future",
|
133
|
+
this.next_direction = options.next && options.direction_next ? options.direction_next : void 0,
|
134
|
+
this.text = this.chart.paper.text(0, 0, options.text), //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t
|
135
|
+
options.key && (this.text.node.id = options.key + "t"), this.text.node.setAttribute("class", this.getAttr("class") + "t"),
|
136
|
+
this.text.attr({
|
137
|
+
"text-anchor": "start",
|
138
|
+
x: this.getAttr("text-margin"),
|
139
|
+
fill: this.getAttr("font-color"),
|
140
|
+
"font-size": this.getAttr("font-size")
|
141
|
+
});
|
142
|
+
var font = this.getAttr("font"), fontF = this.getAttr("font-family"), fontW = this.getAttr("font-weight");
|
143
|
+
font && this.text.attr({
|
144
|
+
font: font
|
145
|
+
}), fontF && this.text.attr({
|
146
|
+
"font-family": fontF
|
147
|
+
}), fontW && this.text.attr({
|
148
|
+
"font-weight": fontW
|
149
|
+
}), options.link && this.text.attr("href", options.link), options.target && this.text.attr("target", options.target);
|
150
|
+
var maxWidth = this.getAttr("maxWidth");
|
151
|
+
if (maxWidth) {
|
152
|
+
for (var words = options.text.split(" "), tempText = "", i = 0, ii = words.length; i < ii; i++) {
|
153
|
+
var word = words[i];
|
154
|
+
this.text.attr("text", tempText + " " + word), tempText += this.text.getBBox().width > maxWidth ? "\n" + word : " " + word;
|
155
|
+
}
|
156
|
+
this.text.attr("text", tempText.substring(1));
|
157
|
+
}
|
158
|
+
if (this.group.push(this.text), symbol) {
|
159
|
+
var tmpMargin = this.getAttr("text-margin");
|
160
|
+
symbol.attr({
|
161
|
+
fill: this.getAttr("fill"),
|
162
|
+
stroke: this.getAttr("element-color"),
|
163
|
+
"stroke-width": this.getAttr("line-width"),
|
164
|
+
width: this.text.getBBox().width + 2 * tmpMargin,
|
165
|
+
height: this.text.getBBox().height + 2 * tmpMargin
|
166
|
+
}), symbol.node.setAttribute("class", this.getAttr("class")), options.link && symbol.attr("href", options.link),
|
167
|
+
options.target && symbol.attr("target", options.target), options.key && (symbol.node.id = options.key),
|
168
|
+
this.group.push(symbol), symbol.insertBefore(this.text), this.text.attr({
|
169
|
+
y: symbol.getBBox().height / 2
|
170
|
+
}), this.initialize();
|
171
|
+
}
|
172
|
+
}
|
173
|
+
var drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawLine = drawAPI.drawLine, checkLineIntersection = drawAPI.checkLineIntersection;
|
174
|
+
/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */
|
175
|
+
Symbol.prototype.getAttr = function(attName) {
|
176
|
+
if (this.chart) {
|
177
|
+
var opt1, opt3 = this.chart.options ? this.chart.options[attName] : void 0, opt2 = this.chart.options.symbols ? this.chart.options.symbols[this.symbolType][attName] : void 0;
|
178
|
+
return this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate] && (opt1 = this.chart.options.flowstate[this.flowstate][attName]),
|
179
|
+
opt1 || opt2 || opt3;
|
180
|
+
}
|
181
|
+
}, Symbol.prototype.initialize = function() {
|
182
|
+
this.group.transform("t" + this.getAttr("line-width") + "," + this.getAttr("line-width")),
|
183
|
+
this.width = this.group.getBBox().width, this.height = this.group.getBBox().height;
|
184
|
+
}, Symbol.prototype.getCenter = function() {
|
185
|
+
return {
|
186
|
+
x: this.getX() + this.width / 2,
|
187
|
+
y: this.getY() + this.height / 2
|
188
|
+
};
|
189
|
+
}, Symbol.prototype.getX = function() {
|
190
|
+
return this.group.getBBox().x;
|
191
|
+
}, Symbol.prototype.getY = function() {
|
192
|
+
return this.group.getBBox().y;
|
193
|
+
}, Symbol.prototype.shiftX = function(x) {
|
194
|
+
this.group.transform("t" + (this.getX() + x) + "," + this.getY());
|
195
|
+
}, Symbol.prototype.setX = function(x) {
|
196
|
+
this.group.transform("t" + x + "," + this.getY());
|
197
|
+
}, Symbol.prototype.shiftY = function(y) {
|
198
|
+
this.group.transform("t" + this.getX() + "," + (this.getY() + y));
|
199
|
+
}, Symbol.prototype.setY = function(y) {
|
200
|
+
this.group.transform("t" + this.getX() + "," + y);
|
201
|
+
}, Symbol.prototype.getTop = function() {
|
202
|
+
var y = this.getY(), x = this.getX() + this.width / 2;
|
203
|
+
return {
|
204
|
+
x: x,
|
205
|
+
y: y
|
206
|
+
};
|
207
|
+
}, Symbol.prototype.getBottom = function() {
|
208
|
+
var y = this.getY() + this.height, x = this.getX() + this.width / 2;
|
209
|
+
return {
|
210
|
+
x: x,
|
211
|
+
y: y
|
212
|
+
};
|
213
|
+
}, Symbol.prototype.getLeft = function() {
|
214
|
+
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX();
|
215
|
+
return {
|
216
|
+
x: x,
|
217
|
+
y: y
|
218
|
+
};
|
219
|
+
}, Symbol.prototype.getRight = function() {
|
220
|
+
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width;
|
221
|
+
return {
|
222
|
+
x: x,
|
223
|
+
y: y
|
224
|
+
};
|
225
|
+
}, Symbol.prototype.render = function() {
|
226
|
+
if (this.next) {
|
227
|
+
var lineLength = this.getAttr("line-length");
|
228
|
+
if ("right" === this.next_direction) {
|
229
|
+
var rightPoint = this.getRight();
|
230
|
+
if (!this.next.isPositioned) {
|
231
|
+
this.next.setY(rightPoint.y - this.next.height / 2), this.next.shiftX(this.group.getBBox().x + this.width + lineLength);
|
232
|
+
var self = this;
|
233
|
+
!function shift() {
|
234
|
+
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {
|
235
|
+
symb = self.chart.symbols[i];
|
236
|
+
var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);
|
237
|
+
if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width / 2) {
|
238
|
+
hasSymbolUnder = !0;
|
239
|
+
break;
|
240
|
+
}
|
241
|
+
}
|
242
|
+
hasSymbolUnder && (self.next.setX(symb.getX() + symb.width + lineLength), shift());
|
243
|
+
}(), this.next.isPositioned = !0, this.next.render();
|
244
|
+
}
|
245
|
+
} else {
|
246
|
+
var bottomPoint = this.getBottom();
|
247
|
+
this.next.isPositioned || (this.next.shiftY(this.getY() + this.height + lineLength),
|
248
|
+
this.next.setX(bottomPoint.x - this.next.width / 2), this.next.isPositioned = !0,
|
249
|
+
this.next.render());
|
250
|
+
}
|
251
|
+
}
|
252
|
+
}, Symbol.prototype.renderLines = function() {
|
253
|
+
this.next && (this.next_direction ? this.drawLineTo(this.next, "", this.next_direction) : this.drawLineTo(this.next));
|
254
|
+
}, Symbol.prototype.drawLineTo = function(symbol, text, origin) {
|
255
|
+
this.connectedTo.indexOf(symbol) < 0 && this.connectedTo.push(symbol);
|
256
|
+
var line, x = this.getCenter().x, y = this.getCenter().y, right = this.getRight(), bottom = this.getBottom(), left = this.getLeft(), symbolX = symbol.getCenter().x, symbolY = symbol.getCenter().y, symbolTop = symbol.getTop(), symbolRight = symbol.getRight(), symbolLeft = symbol.getLeft(), isOnSameColumn = x === symbolX, isOnSameLine = y === symbolY, isUnder = y < symbolY, isUpper = y > symbolY || this === symbol, isLeft = x > symbolX, isRight = x < symbolX, maxX = 0, lineLength = this.getAttr("line-length"), lineWith = this.getAttr("line-width");
|
257
|
+
if (origin && "bottom" !== origin || !isOnSameColumn || !isUnder) if (origin && "right" !== origin || !isOnSameLine || !isRight) if (origin && "left" !== origin || !isOnSameLine || !isLeft) if (origin && "right" !== origin || !isOnSameColumn || !isUpper) if (origin && "right" !== origin || !isOnSameColumn || !isUnder) if (origin && "bottom" !== origin || !isLeft) if (origin && "bottom" !== origin || !isRight) if (origin && "right" === origin && isLeft) line = drawLine(this.chart, right, [ {
|
258
|
+
x: right.x + lineLength / 2,
|
259
|
+
y: right.y
|
260
|
+
}, {
|
261
|
+
x: right.x + lineLength / 2,
|
262
|
+
y: symbolTop.y - lineLength / 2
|
263
|
+
}, {
|
264
|
+
x: symbolTop.x,
|
265
|
+
y: symbolTop.y - lineLength / 2
|
266
|
+
}, {
|
267
|
+
x: symbolTop.x,
|
268
|
+
y: symbolTop.y
|
269
|
+
} ], text), this.rightStart = !0, symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && "right" === origin && isRight) line = drawLine(this.chart, right, [ {
|
270
|
+
x: symbolTop.x,
|
271
|
+
y: right.y
|
272
|
+
}, {
|
273
|
+
x: symbolTop.x,
|
274
|
+
y: symbolTop.y
|
275
|
+
} ], text), this.rightStart = !0, symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && "bottom" === origin && isOnSameColumn && isUpper) line = drawLine(this.chart, bottom, [ {
|
276
|
+
x: bottom.x,
|
277
|
+
y: bottom.y + lineLength / 2
|
278
|
+
}, {
|
279
|
+
x: right.x + lineLength / 2,
|
280
|
+
y: bottom.y + lineLength / 2
|
281
|
+
}, {
|
282
|
+
x: right.x + lineLength / 2,
|
283
|
+
y: symbolTop.y - lineLength / 2
|
284
|
+
}, {
|
285
|
+
x: symbolTop.x,
|
286
|
+
y: symbolTop.y - lineLength / 2
|
287
|
+
}, {
|
288
|
+
x: symbolTop.x,
|
289
|
+
y: symbolTop.y
|
290
|
+
} ], text), this.bottomStart = !0, symbol.topEnd = !0, maxX = bottom.x + lineLength / 2; else if ("left" === origin && isOnSameColumn && isUpper) {
|
291
|
+
var diffX = left.x - lineLength / 2;
|
292
|
+
symbolLeft.x < left.x && (diffX = symbolLeft.x - lineLength / 2), line = drawLine(this.chart, left, [ {
|
293
|
+
x: diffX,
|
294
|
+
y: left.y
|
295
|
+
}, {
|
296
|
+
x: diffX,
|
297
|
+
y: symbolTop.y - lineLength / 2
|
298
|
+
}, {
|
299
|
+
x: symbolTop.x,
|
300
|
+
y: symbolTop.y - lineLength / 2
|
301
|
+
}, {
|
302
|
+
x: symbolTop.x,
|
303
|
+
y: symbolTop.y
|
304
|
+
} ], text), this.leftStart = !0, symbol.topEnd = !0, maxX = left.x;
|
305
|
+
} else "left" === origin && (line = drawLine(this.chart, left, [ {
|
306
|
+
x: symbolTop.x + (left.x - symbolTop.x) / 2,
|
307
|
+
y: left.y
|
308
|
+
}, {
|
309
|
+
x: symbolTop.x + (left.x - symbolTop.x) / 2,
|
310
|
+
y: symbolTop.y - lineLength / 2
|
311
|
+
}, {
|
312
|
+
x: symbolTop.x,
|
313
|
+
y: symbolTop.y - lineLength / 2
|
314
|
+
}, {
|
315
|
+
x: symbolTop.x,
|
316
|
+
y: symbolTop.y
|
317
|
+
} ], text), this.leftStart = !0, symbol.topEnd = !0, maxX = left.x); else line = drawLine(this.chart, bottom, [ {
|
318
|
+
x: bottom.x,
|
319
|
+
y: bottom.y + lineLength / 2
|
320
|
+
}, {
|
321
|
+
x: bottom.x + (bottom.x - symbolTop.x) / 2,
|
322
|
+
y: bottom.y + lineLength / 2
|
323
|
+
}, {
|
324
|
+
x: bottom.x + (bottom.x - symbolTop.x) / 2,
|
325
|
+
y: symbolTop.y - lineLength / 2
|
326
|
+
}, {
|
327
|
+
x: symbolTop.x,
|
328
|
+
y: symbolTop.y - lineLength / 2
|
329
|
+
}, {
|
330
|
+
x: symbolTop.x,
|
331
|
+
y: symbolTop.y
|
332
|
+
} ], text), this.bottomStart = !0, symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else line = this.leftEnd && isUpper ? drawLine(this.chart, bottom, [ {
|
333
|
+
x: bottom.x,
|
334
|
+
y: bottom.y + lineLength / 2
|
335
|
+
}, {
|
336
|
+
x: bottom.x + (bottom.x - symbolTop.x) / 2,
|
337
|
+
y: bottom.y + lineLength / 2
|
338
|
+
}, {
|
339
|
+
x: bottom.x + (bottom.x - symbolTop.x) / 2,
|
340
|
+
y: symbolTop.y - lineLength / 2
|
341
|
+
}, {
|
342
|
+
x: symbolTop.x,
|
343
|
+
y: symbolTop.y - lineLength / 2
|
344
|
+
}, {
|
345
|
+
x: symbolTop.x,
|
346
|
+
y: symbolTop.y
|
347
|
+
} ], text) : drawLine(this.chart, bottom, [ {
|
348
|
+
x: bottom.x,
|
349
|
+
y: symbolTop.y - lineLength / 2
|
350
|
+
}, {
|
351
|
+
x: symbolTop.x,
|
352
|
+
y: symbolTop.y - lineLength / 2
|
353
|
+
}, {
|
354
|
+
x: symbolTop.x,
|
355
|
+
y: symbolTop.y
|
356
|
+
} ], text), this.bottomStart = !0, symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else line = drawLine(this.chart, right, [ {
|
357
|
+
x: right.x + lineLength / 2,
|
358
|
+
y: right.y
|
359
|
+
}, {
|
360
|
+
x: right.x + lineLength / 2,
|
361
|
+
y: symbolTop.y - lineLength / 2
|
362
|
+
}, {
|
363
|
+
x: symbolTop.x,
|
364
|
+
y: symbolTop.y - lineLength / 2
|
365
|
+
}, {
|
366
|
+
x: symbolTop.x,
|
367
|
+
y: symbolTop.y
|
368
|
+
} ], text), this.rightStart = !0, symbol.topEnd = !0, maxX = right.x + lineLength / 2; else line = drawLine(this.chart, right, [ {
|
369
|
+
x: right.x + lineLength / 2,
|
370
|
+
y: right.y
|
371
|
+
}, {
|
372
|
+
x: right.x + lineLength / 2,
|
373
|
+
y: symbolTop.y - lineLength / 2
|
374
|
+
}, {
|
375
|
+
x: symbolTop.x,
|
376
|
+
y: symbolTop.y - lineLength / 2
|
377
|
+
}, {
|
378
|
+
x: symbolTop.x,
|
379
|
+
y: symbolTop.y
|
380
|
+
} ], text), this.rightStart = !0, symbol.topEnd = !0, maxX = right.x + lineLength / 2; else line = drawLine(this.chart, left, symbolRight, text),
|
381
|
+
this.leftStart = !0, symbol.rightEnd = !0, maxX = symbolRight.x; else line = drawLine(this.chart, right, symbolLeft, text),
|
382
|
+
this.rightStart = !0, symbol.leftEnd = !0, maxX = symbolLeft.x; else line = drawLine(this.chart, bottom, symbolTop, text),
|
383
|
+
this.bottomStart = !0, symbol.topEnd = !0, maxX = bottom.x;
|
384
|
+
if (line) {
|
385
|
+
for (var l = 0, llen = this.chart.lines.length; l < llen; l++) for (var len, otherLine = this.chart.lines[l], ePath = otherLine.attr("path"), lPath = line.attr("path"), iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {
|
386
|
+
var newPath = [];
|
387
|
+
newPath.push([ "M", ePath[iP][1], ePath[iP][2] ]), newPath.push([ "L", ePath[iP + 1][1], ePath[iP + 1][2] ]);
|
388
|
+
for (var line1_from_x = newPath[0][1], line1_from_y = newPath[0][2], line1_to_x = newPath[1][1], line1_to_y = newPath[1][2], lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {
|
389
|
+
var newLinePath = [];
|
390
|
+
newLinePath.push([ "M", lPath[lP][1], lPath[lP][2] ]), newLinePath.push([ "L", lPath[lP + 1][1], lPath[lP + 1][2] ]);
|
391
|
+
var line2_from_x = newLinePath[0][1], line2_from_y = newLinePath[0][2], line2_to_x = newLinePath[1][1], line2_to_y = newLinePath[1][2], res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);
|
392
|
+
if (res.onLine1 && res.onLine2) {
|
393
|
+
var newSegment;
|
394
|
+
line2_from_y === line2_to_y ? line2_from_x > line2_to_x ? (newSegment = [ "L", res.x + 2 * lineWith, line2_from_y ],
|
395
|
+
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", res.x + 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x - 2 * lineWith, line2_from_y ],
|
396
|
+
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : (newSegment = [ "L", res.x - 2 * lineWith, line2_from_y ],
|
397
|
+
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", res.x - 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x + 2 * lineWith, line2_from_y ],
|
398
|
+
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : line2_from_y > line2_to_y ? (newSegment = [ "L", line2_from_x, res.y + 2 * lineWith ],
|
399
|
+
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", line2_from_x, res.y + 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y - 2 * lineWith ],
|
400
|
+
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)) : (newSegment = [ "L", line2_from_x, res.y - 2 * lineWith ],
|
401
|
+
lPath.splice(lP + 1, 0, newSegment), newSegment = [ "C", line2_from_x, res.y - 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y + 2 * lineWith ],
|
402
|
+
lPath.splice(lP + 2, 0, newSegment), line.attr("path", lPath)), lP += 2, len += 2;
|
403
|
+
}
|
404
|
+
}
|
405
|
+
}
|
406
|
+
this.chart.lines.push(line);
|
407
|
+
}
|
408
|
+
(!this.chart.maxXFromLine || this.chart.maxXFromLine && maxX > this.chart.maxXFromLine) && (this.chart.maxXFromLine = maxX);
|
409
|
+
}, module.exports = Symbol;
|
410
|
+
}, /* 3 */
|
411
|
+
/*!************************************!*\
|
412
|
+
!*** ./src/flowchart.functions.js ***!
|
413
|
+
\************************************/
|
414
|
+
/***/
|
415
|
+
function(module, exports) {
|
416
|
+
function drawPath(chart, location, points) {
|
417
|
+
var i, len, path = "M{0},{1}";
|
418
|
+
for (i = 2, len = 2 * points.length + 2; i < len; i += 2) path += " L{" + i + "},{" + (i + 1) + "}";
|
419
|
+
var pathValues = [ location.x, location.y ];
|
420
|
+
for (i = 0, len = points.length; i < len; i++) pathValues.push(points[i].x), pathValues.push(points[i].y);
|
421
|
+
var symbol = chart.paper.path(path, pathValues);
|
422
|
+
symbol.attr("stroke", chart.options["element-color"]), symbol.attr("stroke-width", chart.options["line-width"]);
|
423
|
+
var font = chart.options.font, fontF = chart.options["font-family"], fontW = chart.options["font-weight"];
|
424
|
+
return font && symbol.attr({
|
425
|
+
font: font
|
426
|
+
}), fontF && symbol.attr({
|
427
|
+
"font-family": fontF
|
428
|
+
}), fontW && symbol.attr({
|
429
|
+
"font-weight": fontW
|
430
|
+
}), symbol;
|
431
|
+
}
|
432
|
+
function drawLine(chart, from, to, text) {
|
433
|
+
var i, len;
|
434
|
+
"[object Array]" !== Object.prototype.toString.call(to) && (to = [ to ]);
|
435
|
+
var path = "M{0},{1}";
|
436
|
+
for (i = 2, len = 2 * to.length + 2; i < len; i += 2) path += " L{" + i + "},{" + (i + 1) + "}";
|
437
|
+
var pathValues = [ from.x, from.y ];
|
438
|
+
for (i = 0, len = to.length; i < len; i++) pathValues.push(to[i].x), pathValues.push(to[i].y);
|
439
|
+
var line = chart.paper.path(path, pathValues);
|
440
|
+
line.attr({
|
441
|
+
stroke: chart.options["line-color"],
|
442
|
+
"stroke-width": chart.options["line-width"],
|
443
|
+
"arrow-end": chart.options["arrow-end"]
|
444
|
+
});
|
445
|
+
var font = chart.options.font, fontF = chart.options["font-family"], fontW = chart.options["font-weight"];
|
446
|
+
if (font && line.attr({
|
447
|
+
font: font
|
448
|
+
}), fontF && line.attr({
|
449
|
+
"font-family": fontF
|
450
|
+
}), fontW && line.attr({
|
451
|
+
"font-weight": fontW
|
452
|
+
}), text) {
|
453
|
+
var centerText = !1, textPath = chart.paper.text(0, 0, text), isHorizontal = !1, firstTo = to[0];
|
454
|
+
from.y === firstTo.y && (isHorizontal = !0);
|
455
|
+
var x = 0, y = 0;
|
456
|
+
centerText ? (x = from.x > firstTo.x ? from.x - (from.x - firstTo.x) / 2 : firstTo.x - (firstTo.x - from.x) / 2,
|
457
|
+
y = from.y > firstTo.y ? from.y - (from.y - firstTo.y) / 2 : firstTo.y - (firstTo.y - from.y) / 2,
|
458
|
+
isHorizontal ? (x -= textPath.getBBox().width / 2, y -= chart.options["text-margin"]) : (x += chart.options["text-margin"],
|
459
|
+
y -= textPath.getBBox().height / 2)) : (x = from.x, y = from.y, isHorizontal ? (x += chart.options["text-margin"] / 2,
|
460
|
+
y -= chart.options["text-margin"]) : (x += chart.options["text-margin"] / 2, y += chart.options["text-margin"])),
|
461
|
+
textPath.attr({
|
462
|
+
"text-anchor": "start",
|
463
|
+
"font-size": chart.options["font-size"],
|
464
|
+
fill: chart.options["font-color"],
|
465
|
+
x: x,
|
466
|
+
y: y
|
467
|
+
}), font && textPath.attr({
|
468
|
+
font: font
|
469
|
+
}), fontF && textPath.attr({
|
470
|
+
"font-family": fontF
|
471
|
+
}), fontW && textPath.attr({
|
472
|
+
"font-weight": fontW
|
473
|
+
});
|
474
|
+
}
|
475
|
+
return line;
|
476
|
+
}
|
477
|
+
function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {
|
478
|
+
// if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point
|
479
|
+
var denominator, a, b, numerator1, numerator2, result = {
|
480
|
+
x: null,
|
481
|
+
y: null,
|
482
|
+
onLine1: !1,
|
483
|
+
onLine2: !1
|
484
|
+
};
|
485
|
+
// if we cast these lines infinitely in both directions, they intersect here:
|
486
|
+
/*
|
487
|
+
// it is worth noting that this should be the same as:
|
488
|
+
x = line2StartX + (b * (line2EndX - line2StartX));
|
489
|
+
y = line2StartX + (b * (line2EndY - line2StartY));
|
490
|
+
*/
|
491
|
+
// if line1 is a segment and line2 is infinite, they intersect if:
|
492
|
+
// if line2 is a segment and line1 is infinite, they intersect if:
|
493
|
+
return denominator = (line2EndY - line2StartY) * (line1EndX - line1StartX) - (line2EndX - line2StartX) * (line1EndY - line1StartY),
|
494
|
+
0 === denominator ? result : (a = line1StartY - line2StartY, b = line1StartX - line2StartX,
|
495
|
+
numerator1 = (line2EndX - line2StartX) * a - (line2EndY - line2StartY) * b, numerator2 = (line1EndX - line1StartX) * a - (line1EndY - line1StartY) * b,
|
496
|
+
a = numerator1 / denominator, b = numerator2 / denominator, result.x = line1StartX + a * (line1EndX - line1StartX),
|
497
|
+
result.y = line1StartY + a * (line1EndY - line1StartY), a > 0 && a < 1 && (result.onLine1 = !0),
|
498
|
+
b > 0 && b < 1 && (result.onLine2 = !0), result);
|
499
|
+
}
|
500
|
+
module.exports = {
|
501
|
+
drawPath: drawPath,
|
502
|
+
drawLine: drawLine,
|
503
|
+
checkLineIntersection: checkLineIntersection
|
504
|
+
};
|
505
|
+
}, /* 4 */
|
506
|
+
/*!********************************!*\
|
507
|
+
!*** ./src/flowchart.parse.js ***!
|
508
|
+
\********************************/
|
509
|
+
/***/
|
510
|
+
function(module, exports, __webpack_require__) {
|
511
|
+
function parse(input) {
|
512
|
+
function getSymbol(s) {
|
513
|
+
var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
|
514
|
+
return startIndex >= 0 && endIndex >= 0 ? chart.symbols[s.substring(0, startIndex - 1)] : chart.symbols[s];
|
515
|
+
}
|
516
|
+
function getNextPath(s) {
|
517
|
+
var next = "next", startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
|
518
|
+
return startIndex >= 0 && endIndex >= 0 && (next = flowSymb.substring(startIndex, endIndex),
|
519
|
+
next.indexOf(",") < 0 && "yes" !== next && "no" !== next && (next = "next, " + next)),
|
520
|
+
next;
|
521
|
+
}
|
522
|
+
input = input || "", input = input.trim();
|
523
|
+
for (var chart = {
|
524
|
+
symbols: {},
|
525
|
+
start: null,
|
526
|
+
drawSVG: function(container, options) {
|
527
|
+
function getDisplaySymbol(s) {
|
528
|
+
if (dispSymbols[s.key]) return dispSymbols[s.key];
|
529
|
+
switch (s.symbolType) {
|
530
|
+
case "start":
|
531
|
+
dispSymbols[s.key] = new Start(diagram, s);
|
532
|
+
break;
|
533
|
+
|
534
|
+
case "end":
|
535
|
+
dispSymbols[s.key] = new End(diagram, s);
|
536
|
+
break;
|
537
|
+
|
538
|
+
case "operation":
|
539
|
+
dispSymbols[s.key] = new Operation(diagram, s);
|
540
|
+
break;
|
541
|
+
|
542
|
+
case "inputoutput":
|
543
|
+
dispSymbols[s.key] = new InputOutput(diagram, s);
|
544
|
+
break;
|
545
|
+
|
546
|
+
case "subroutine":
|
547
|
+
dispSymbols[s.key] = new Subroutine(diagram, s);
|
548
|
+
break;
|
549
|
+
|
550
|
+
case "condition":
|
551
|
+
dispSymbols[s.key] = new Condition(diagram, s);
|
552
|
+
break;
|
553
|
+
|
554
|
+
default:
|
555
|
+
return new Error("Wrong symbol type!");
|
556
|
+
}
|
557
|
+
return dispSymbols[s.key];
|
558
|
+
}
|
559
|
+
var self = this;
|
560
|
+
this.diagram && this.diagram.clean();
|
561
|
+
var diagram = new FlowChart(container, options);
|
562
|
+
this.diagram = diagram;
|
563
|
+
var dispSymbols = {};
|
564
|
+
!function constructChart(s, prevDisp, prev) {
|
565
|
+
var dispSymb = getDisplaySymbol(s);
|
566
|
+
return self.start === s ? diagram.startWith(dispSymb) : prevDisp && prev && !prevDisp.pathOk && (prevDisp instanceof Condition ? (prev.yes === s && prevDisp.yes(dispSymb),
|
567
|
+
prev.no === s && prevDisp.no(dispSymb)) : prevDisp.then(dispSymb)), dispSymb.pathOk ? dispSymb : (dispSymb instanceof Condition ? (s.yes && constructChart(s.yes, dispSymb, s),
|
568
|
+
s.no && constructChart(s.no, dispSymb, s)) : s.next && constructChart(s.next, dispSymb, s),
|
569
|
+
dispSymb);
|
570
|
+
}(this.start), diagram.render();
|
571
|
+
},
|
572
|
+
clean: function() {
|
573
|
+
this.diagram.clean();
|
574
|
+
}
|
575
|
+
}, lines = [], prevBreak = 0, i0 = 1, i0len = input.length; i0 < i0len; i0++) if ("\n" === input[i0] && "\\" !== input[i0 - 1]) {
|
576
|
+
var line0 = input.substring(prevBreak, i0);
|
577
|
+
prevBreak = i0 + 1, lines.push(line0.replace(/\\\n/g, "\n"));
|
578
|
+
}
|
579
|
+
prevBreak < input.length && lines.push(input.substr(prevBreak));
|
580
|
+
for (var l = 1, len = lines.length; l < len; ) {
|
581
|
+
var currentLine = lines[l];
|
582
|
+
currentLine.indexOf("->") < 0 && currentLine.indexOf("=>") < 0 ? (lines[l - 1] += "\n" + currentLine,
|
583
|
+
lines.splice(l, 1), len--) : l++;
|
584
|
+
}
|
585
|
+
for (;lines.length > 0; ) {
|
586
|
+
var line = lines.splice(0, 1)[0];
|
587
|
+
if (line.indexOf("=>") >= 0) {
|
588
|
+
// definition
|
589
|
+
var sub, parts = line.split("=>"), symbol = {
|
590
|
+
key: parts[0],
|
591
|
+
symbolType: parts[1],
|
592
|
+
text: null,
|
593
|
+
link: null,
|
594
|
+
target: null,
|
595
|
+
flowstate: null
|
596
|
+
};
|
597
|
+
/* adding support for links */
|
598
|
+
if (symbol.symbolType.indexOf(": ") >= 0 && (sub = symbol.symbolType.split(": "),
|
599
|
+
symbol.symbolType = sub.shift(), symbol.text = sub.join(": ")), symbol.text && symbol.text.indexOf(":>") >= 0 ? (sub = symbol.text.split(":>"),
|
600
|
+
symbol.text = sub.shift(), symbol.link = sub.join(":>")) : symbol.symbolType.indexOf(":>") >= 0 && (sub = symbol.symbolType.split(":>"),
|
601
|
+
symbol.symbolType = sub.shift(), symbol.link = sub.join(":>")), symbol.symbolType.indexOf("\n") >= 0 && (symbol.symbolType = symbol.symbolType.split("\n")[0]),
|
602
|
+
symbol.link) {
|
603
|
+
var startIndex = symbol.link.indexOf("[") + 1, endIndex = symbol.link.indexOf("]");
|
604
|
+
startIndex >= 0 && endIndex >= 0 && (symbol.target = symbol.link.substring(startIndex, endIndex),
|
605
|
+
symbol.link = symbol.link.substring(0, startIndex - 1));
|
606
|
+
}
|
607
|
+
/* end of link support */
|
608
|
+
/* adding support for flowstates */
|
609
|
+
if (symbol.text && symbol.text.indexOf("|") >= 0) {
|
610
|
+
var txtAndState = symbol.text.split("|");
|
611
|
+
symbol.flowstate = txtAndState.pop().trim(), symbol.text = txtAndState.join("|");
|
612
|
+
}
|
613
|
+
/* end of flowstate support */
|
614
|
+
chart.symbols[symbol.key] = symbol;
|
615
|
+
} else if (line.indexOf("->") >= 0) for (var flowSymbols = line.split("->"), i = 0, lenS = flowSymbols.length; i < lenS; i++) {
|
616
|
+
var flowSymb = flowSymbols[i], realSymb = getSymbol(flowSymb), next = getNextPath(flowSymb), direction = null;
|
617
|
+
if (next.indexOf(",") >= 0) {
|
618
|
+
var condOpt = next.split(",");
|
619
|
+
next = condOpt[0], direction = condOpt[1].trim();
|
620
|
+
}
|
621
|
+
if (chart.start || (chart.start = realSymb), i + 1 < lenS) {
|
622
|
+
var nextSymb = flowSymbols[i + 1];
|
623
|
+
realSymb[next] = getSymbol(nextSymb), realSymb["direction_" + next] = direction,
|
624
|
+
direction = null;
|
625
|
+
}
|
626
|
+
}
|
627
|
+
}
|
628
|
+
return chart;
|
629
|
+
}
|
630
|
+
var FlowChart = __webpack_require__(/*! ./flowchart.chart */ 6), Start = __webpack_require__(/*! ./flowchart.symbol.start */ 12), End = __webpack_require__(/*! ./flowchart.symbol.end */ 9), Operation = __webpack_require__(/*! ./flowchart.symbol.operation */ 11), InputOutput = __webpack_require__(/*! ./flowchart.symbol.inputoutput */ 10), Subroutine = __webpack_require__(/*! ./flowchart.symbol.subroutine */ 13), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);
|
631
|
+
module.exports = parse;
|
632
|
+
}, /* 5 */
|
633
|
+
/*!*******************************************!*\
|
634
|
+
!*** ./src/flowchart.symbol.condition.js ***!
|
635
|
+
\*******************************************/
|
636
|
+
/***/
|
637
|
+
function(module, exports, __webpack_require__) {
|
638
|
+
function Condition(chart, options) {
|
639
|
+
options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr("text-margin"),
|
640
|
+
this.yes_direction = "bottom", this.no_direction = "right", options.yes && options.direction_yes && options.no && !options.direction_no ? "right" === options.direction_yes ? (this.no_direction = "bottom",
|
641
|
+
this.yes_direction = "right") : (this.no_direction = "right", this.yes_direction = "bottom") : options.yes && !options.direction_yes && options.no && options.direction_no ? "right" === options.direction_no ? (this.yes_direction = "bottom",
|
642
|
+
this.no_direction = "right") : (this.yes_direction = "right", this.no_direction = "bottom") : (this.yes_direction = "bottom",
|
643
|
+
this.no_direction = "right"), this.yes_direction = this.yes_direction || "bottom",
|
644
|
+
this.no_direction = this.no_direction || "right", this.text.attr({
|
645
|
+
x: 2 * this.textMargin
|
646
|
+
});
|
647
|
+
var width = this.text.getBBox().width + 3 * this.textMargin;
|
648
|
+
width += width / 2;
|
649
|
+
var height = this.text.getBBox().height + 2 * this.textMargin;
|
650
|
+
height += height / 2, height = Math.max(.5 * width, height);
|
651
|
+
var startX = width / 4, startY = height / 4;
|
652
|
+
this.text.attr({
|
653
|
+
x: startX + this.textMargin / 2
|
654
|
+
});
|
655
|
+
var start = {
|
656
|
+
x: startX,
|
657
|
+
y: startY
|
658
|
+
}, points = [ {
|
659
|
+
x: startX - width / 4,
|
660
|
+
y: startY + height / 4
|
661
|
+
}, {
|
662
|
+
x: startX - width / 4 + width / 2,
|
663
|
+
y: startY + height / 4 + height / 2
|
664
|
+
}, {
|
665
|
+
x: startX - width / 4 + width,
|
666
|
+
y: startY + height / 4
|
667
|
+
}, {
|
668
|
+
x: startX - width / 4 + width / 2,
|
669
|
+
y: startY + height / 4 - height / 2
|
670
|
+
}, {
|
671
|
+
x: startX - width / 4,
|
672
|
+
y: startY + height / 4
|
673
|
+
} ], symbol = drawPath(chart, start, points);
|
674
|
+
symbol.attr({
|
675
|
+
stroke: this.getAttr("element-color"),
|
676
|
+
"stroke-width": this.getAttr("line-width"),
|
677
|
+
fill: this.getAttr("fill")
|
678
|
+
}), options.link && symbol.attr("href", options.link), options.target && symbol.attr("target", options.target),
|
679
|
+
options.key && (symbol.node.id = options.key), symbol.node.setAttribute("class", this.getAttr("class")),
|
680
|
+
this.text.attr({
|
681
|
+
y: symbol.getBBox().height / 2
|
682
|
+
}), this.group.push(symbol), symbol.insertBefore(this.text), this.initialize();
|
683
|
+
}
|
684
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;
|
685
|
+
inherits(Condition, Symbol), Condition.prototype.render = function() {
|
686
|
+
this.yes_direction && (this[this.yes_direction + "_symbol"] = this.yes_symbol),
|
687
|
+
this.no_direction && (this[this.no_direction + "_symbol"] = this.no_symbol);
|
688
|
+
var lineLength = this.getAttr("line-length");
|
689
|
+
if (this.bottom_symbol) {
|
690
|
+
var bottomPoint = this.getBottom();
|
691
|
+
this.bottom_symbol.isPositioned || (this.bottom_symbol.shiftY(this.getY() + this.height + lineLength),
|
692
|
+
this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2), this.bottom_symbol.isPositioned = !0,
|
693
|
+
this.bottom_symbol.render());
|
694
|
+
}
|
695
|
+
if (this.right_symbol) {
|
696
|
+
var rightPoint = this.getRight();
|
697
|
+
if (!this.right_symbol.isPositioned) {
|
698
|
+
this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2), this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);
|
699
|
+
var self = this;
|
700
|
+
!function shift() {
|
701
|
+
for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {
|
702
|
+
symb = self.chart.symbols[i];
|
703
|
+
var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
|
704
|
+
if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {
|
705
|
+
hasSymbolUnder = !0;
|
706
|
+
break;
|
707
|
+
}
|
708
|
+
}
|
709
|
+
hasSymbolUnder && (self.right_symbol.setX(symb.getX() + symb.width + lineLength),
|
710
|
+
shift());
|
711
|
+
}(), this.right_symbol.isPositioned = !0, this.right_symbol.render();
|
712
|
+
}
|
713
|
+
}
|
714
|
+
}, Condition.prototype.renderLines = function() {
|
715
|
+
this.yes_symbol && this.drawLineTo(this.yes_symbol, this.getAttr("yes-text"), this.yes_direction),
|
716
|
+
this.no_symbol && this.drawLineTo(this.no_symbol, this.getAttr("no-text"), this.no_direction);
|
717
|
+
}, module.exports = Condition;
|
718
|
+
}, /* 6 */
|
719
|
+
/*!********************************!*\
|
720
|
+
!*** ./src/flowchart.chart.js ***!
|
721
|
+
\********************************/
|
722
|
+
/***/
|
723
|
+
function(module, exports, __webpack_require__) {
|
724
|
+
function FlowChart(container, options) {
|
725
|
+
options = options || {}, this.paper = new Raphael(container), this.options = defaults(options, defaultOptions),
|
726
|
+
this.symbols = [], this.lines = [], this.start = null;
|
727
|
+
}
|
728
|
+
var Raphael = __webpack_require__(/*! raphael */ 15), defaults = __webpack_require__(/*! ./flowchart.helpers */ 1).defaults, defaultOptions = __webpack_require__(/*! ./flowchart.defaults */ 7), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);
|
729
|
+
FlowChart.prototype.handle = function(symbol) {
|
730
|
+
this.symbols.indexOf(symbol) <= -1 && this.symbols.push(symbol);
|
731
|
+
var flowChart = this;
|
732
|
+
return symbol instanceof Condition ? (symbol.yes = function(nextSymbol) {
|
733
|
+
return symbol.yes_symbol = nextSymbol, symbol.no_symbol && (symbol.pathOk = !0),
|
734
|
+
flowChart.handle(nextSymbol);
|
735
|
+
}, symbol.no = function(nextSymbol) {
|
736
|
+
return symbol.no_symbol = nextSymbol, symbol.yes_symbol && (symbol.pathOk = !0),
|
737
|
+
flowChart.handle(nextSymbol);
|
738
|
+
}) : symbol.then = function(nextSymbol) {
|
739
|
+
return symbol.next = nextSymbol, symbol.pathOk = !0, flowChart.handle(nextSymbol);
|
740
|
+
}, symbol;
|
741
|
+
}, FlowChart.prototype.startWith = function(symbol) {
|
742
|
+
return this.start = symbol, this.handle(symbol);
|
743
|
+
}, FlowChart.prototype.render = function() {
|
744
|
+
var symbol, line, maxWidth = 0, maxHeight = 0, i = 0, len = 0, maxX = 0, maxY = 0, minX = 0, minY = 0;
|
745
|
+
for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.width > maxWidth && (maxWidth = symbol.width),
|
746
|
+
symbol.height > maxHeight && (maxHeight = symbol.height);
|
747
|
+
for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.shiftX(this.options.x + (maxWidth - symbol.width) / 2 + this.options["line-width"]),
|
748
|
+
symbol.shiftY(this.options.y + (maxHeight - symbol.height) / 2 + this.options["line-width"]);
|
749
|
+
// for (i = 0, len = this.symbols.length; i < len; i++) {
|
750
|
+
// symbol = this.symbols[i];
|
751
|
+
// symbol.render();
|
752
|
+
// }
|
753
|
+
for (this.start.render(), i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i],
|
754
|
+
symbol.renderLines();
|
755
|
+
for (maxX = this.maxXFromLine, i = 0, len = this.symbols.length; i < len; i++) {
|
756
|
+
symbol = this.symbols[i];
|
757
|
+
var x = symbol.getX() + symbol.width, y = symbol.getY() + symbol.height;
|
758
|
+
x > maxX && (maxX = x), y > maxY && (maxY = y);
|
759
|
+
}
|
760
|
+
for (i = 0, len = this.lines.length; i < len; i++) {
|
761
|
+
line = this.lines[i].getBBox();
|
762
|
+
var x = line.x, y = line.y, x2 = line.x2, y2 = line.y2;
|
763
|
+
x < minX && (minX = x), y < minY && (minY = y), x2 > maxX && (maxX = x2), y2 > maxY && (maxY = y2);
|
764
|
+
}
|
765
|
+
var scale = this.options.scale, lineWidth = this.options["line-width"];
|
766
|
+
minX < 0 && (minX -= lineWidth), minY < 0 && (minY -= lineWidth);
|
767
|
+
var width = maxX + lineWidth - minX, height = maxY + lineWidth - minY;
|
768
|
+
this.paper.setSize(width * scale, height * scale), this.paper.setViewBox(minX, minY, width, height, !0);
|
769
|
+
}, FlowChart.prototype.clean = function() {
|
770
|
+
if (this.paper) {
|
771
|
+
var paperDom = this.paper.canvas;
|
772
|
+
paperDom.parentNode.removeChild(paperDom);
|
773
|
+
}
|
774
|
+
}, module.exports = FlowChart;
|
775
|
+
}, /* 7 */
|
776
|
+
/*!***********************************!*\
|
777
|
+
!*** ./src/flowchart.defaults.js ***!
|
778
|
+
\***********************************/
|
779
|
+
/***/
|
780
|
+
function(module, exports) {
|
781
|
+
// defaults
|
782
|
+
module.exports = {
|
783
|
+
x: 0,
|
784
|
+
y: 0,
|
785
|
+
"line-width": 3,
|
786
|
+
"line-length": 50,
|
787
|
+
"text-margin": 10,
|
788
|
+
"font-size": 14,
|
789
|
+
"font-color": "black",
|
790
|
+
// 'font': 'normal',
|
791
|
+
// 'font-family': 'calibri',
|
792
|
+
// 'font-weight': 'normal',
|
793
|
+
"line-color": "black",
|
794
|
+
"element-color": "black",
|
795
|
+
fill: "white",
|
796
|
+
"yes-text": "yes",
|
797
|
+
"no-text": "no",
|
798
|
+
"arrow-end": "block",
|
799
|
+
"class": "flowchart",
|
800
|
+
scale: 1,
|
801
|
+
symbols: {
|
802
|
+
start: {},
|
803
|
+
end: {},
|
804
|
+
condition: {},
|
805
|
+
inputoutput: {},
|
806
|
+
operation: {},
|
807
|
+
subroutine: {}
|
808
|
+
}
|
809
|
+
};
|
810
|
+
}, /* 8 */
|
811
|
+
/*!*******************************!*\
|
812
|
+
!*** ./src/flowchart.shim.js ***!
|
813
|
+
\*******************************/
|
814
|
+
/***/
|
815
|
+
function(module, exports) {
|
816
|
+
// add indexOf to non ECMA-262 standard compliant browsers
|
817
|
+
Array.prototype.indexOf || (Array.prototype.indexOf = function(searchElement) {
|
818
|
+
"use strict";
|
819
|
+
if (null === this) throw new TypeError();
|
820
|
+
var t = Object(this), len = t.length >>> 0;
|
821
|
+
if (0 === len) return -1;
|
822
|
+
var n = 0;
|
823
|
+
if (arguments.length > 0 && (n = Number(arguments[1]), n != n ? // shortcut for verifying if it's NaN
|
824
|
+
n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))),
|
825
|
+
n >= len) return -1;
|
826
|
+
for (var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); k < len; k++) if (k in t && t[k] === searchElement) return k;
|
827
|
+
return -1;
|
828
|
+
}), // add lastIndexOf to non ECMA-262 standard compliant browsers
|
829
|
+
Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function(searchElement) {
|
830
|
+
"use strict";
|
831
|
+
if (null === this) throw new TypeError();
|
832
|
+
var t = Object(this), len = t.length >>> 0;
|
833
|
+
if (0 === len) return -1;
|
834
|
+
var n = len;
|
835
|
+
arguments.length > 1 && (n = Number(arguments[1]), n != n ? n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n))));
|
836
|
+
for (var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n); k >= 0; k--) if (k in t && t[k] === searchElement) return k;
|
837
|
+
return -1;
|
838
|
+
}), String.prototype.trim || (String.prototype.trim = function() {
|
839
|
+
return this.replace(/^\s+|\s+$/g, "");
|
840
|
+
});
|
841
|
+
}, /* 9 */
|
842
|
+
/*!*************************************!*\
|
843
|
+
!*** ./src/flowchart.symbol.end.js ***!
|
844
|
+
\*************************************/
|
845
|
+
/***/
|
846
|
+
function(module, exports, __webpack_require__) {
|
847
|
+
function End(chart, options) {
|
848
|
+
var symbol = chart.paper.rect(0, 0, 0, 0, 20);
|
849
|
+
options = options || {}, options.text = options.text || "End", Symbol.call(this, chart, options, symbol);
|
850
|
+
}
|
851
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
|
852
|
+
inherits(End, Symbol), module.exports = End;
|
853
|
+
}, /* 10 */
|
854
|
+
/*!*********************************************!*\
|
855
|
+
!*** ./src/flowchart.symbol.inputoutput.js ***!
|
856
|
+
\*********************************************/
|
857
|
+
/***/
|
858
|
+
function(module, exports, __webpack_require__) {
|
859
|
+
function InputOutput(chart, options) {
|
860
|
+
options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr("text-margin"),
|
861
|
+
this.text.attr({
|
862
|
+
x: 3 * this.textMargin
|
863
|
+
});
|
864
|
+
var width = this.text.getBBox().width + 4 * this.textMargin, height = this.text.getBBox().height + 2 * this.textMargin, startX = this.textMargin, startY = height / 2, start = {
|
865
|
+
x: startX,
|
866
|
+
y: startY
|
867
|
+
}, points = [ {
|
868
|
+
x: startX - this.textMargin,
|
869
|
+
y: height
|
870
|
+
}, {
|
871
|
+
x: startX - this.textMargin + width,
|
872
|
+
y: height
|
873
|
+
}, {
|
874
|
+
x: startX - this.textMargin + width + 2 * this.textMargin,
|
875
|
+
y: 0
|
876
|
+
}, {
|
877
|
+
x: startX - this.textMargin + 2 * this.textMargin,
|
878
|
+
y: 0
|
879
|
+
}, {
|
880
|
+
x: startX,
|
881
|
+
y: startY
|
882
|
+
} ], symbol = drawPath(chart, start, points);
|
883
|
+
symbol.attr({
|
884
|
+
stroke: this.getAttr("element-color"),
|
885
|
+
"stroke-width": this.getAttr("line-width"),
|
886
|
+
fill: this.getAttr("fill")
|
887
|
+
}), options.link && symbol.attr("href", options.link), options.target && symbol.attr("target", options.target),
|
888
|
+
options.key && (symbol.node.id = options.key), symbol.node.setAttribute("class", this.getAttr("class")),
|
889
|
+
this.text.attr({
|
890
|
+
y: symbol.getBBox().height / 2
|
891
|
+
}), this.group.push(symbol), symbol.insertBefore(this.text), this.initialize();
|
892
|
+
}
|
893
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;
|
894
|
+
inherits(InputOutput, Symbol), InputOutput.prototype.getLeft = function() {
|
895
|
+
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.textMargin;
|
896
|
+
return {
|
897
|
+
x: x,
|
898
|
+
y: y
|
899
|
+
};
|
900
|
+
}, InputOutput.prototype.getRight = function() {
|
901
|
+
var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width - this.textMargin;
|
902
|
+
return {
|
903
|
+
x: x,
|
904
|
+
y: y
|
905
|
+
};
|
906
|
+
}, module.exports = InputOutput;
|
907
|
+
}, /* 11 */
|
908
|
+
/*!*******************************************!*\
|
909
|
+
!*** ./src/flowchart.symbol.operation.js ***!
|
910
|
+
\*******************************************/
|
911
|
+
/***/
|
912
|
+
function(module, exports, __webpack_require__) {
|
913
|
+
function Operation(chart, options) {
|
914
|
+
var symbol = chart.paper.rect(0, 0, 0, 0);
|
915
|
+
options = options || {}, Symbol.call(this, chart, options, symbol);
|
916
|
+
}
|
917
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
|
918
|
+
inherits(Operation, Symbol), module.exports = Operation;
|
919
|
+
}, /* 12 */
|
920
|
+
/*!***************************************!*\
|
921
|
+
!*** ./src/flowchart.symbol.start.js ***!
|
922
|
+
\***************************************/
|
923
|
+
/***/
|
924
|
+
function(module, exports, __webpack_require__) {
|
925
|
+
function Start(chart, options) {
|
926
|
+
var symbol = chart.paper.rect(0, 0, 0, 0, 20);
|
927
|
+
options = options || {}, options.text = options.text || "Start", Symbol.call(this, chart, options, symbol);
|
928
|
+
}
|
929
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
|
930
|
+
inherits(Start, Symbol), module.exports = Start;
|
931
|
+
}, /* 13 */
|
932
|
+
/*!********************************************!*\
|
933
|
+
!*** ./src/flowchart.symbol.subroutine.js ***!
|
934
|
+
\********************************************/
|
935
|
+
/***/
|
936
|
+
function(module, exports, __webpack_require__) {
|
937
|
+
function Subroutine(chart, options) {
|
938
|
+
var symbol = chart.paper.rect(0, 0, 0, 0);
|
939
|
+
options = options || {}, Symbol.call(this, chart, options, symbol), symbol.attr({
|
940
|
+
width: this.text.getBBox().width + 4 * this.getAttr("text-margin")
|
941
|
+
}), this.text.attr({
|
942
|
+
x: 2 * this.getAttr("text-margin")
|
943
|
+
});
|
944
|
+
var innerWrap = chart.paper.rect(0, 0, 0, 0);
|
945
|
+
innerWrap.attr({
|
946
|
+
x: this.getAttr("text-margin"),
|
947
|
+
stroke: this.getAttr("element-color"),
|
948
|
+
"stroke-width": this.getAttr("line-width"),
|
949
|
+
width: this.text.getBBox().width + 2 * this.getAttr("text-margin"),
|
950
|
+
height: this.text.getBBox().height + 2 * this.getAttr("text-margin"),
|
951
|
+
fill: this.getAttr("fill")
|
952
|
+
}), options.key && (innerWrap.node.id = options.key + "i");
|
953
|
+
var font = this.getAttr("font"), fontF = this.getAttr("font-family"), fontW = this.getAttr("font-weight");
|
954
|
+
font && innerWrap.attr({
|
955
|
+
font: font
|
956
|
+
}), fontF && innerWrap.attr({
|
957
|
+
"font-family": fontF
|
958
|
+
}), fontW && innerWrap.attr({
|
959
|
+
"font-weight": fontW
|
960
|
+
}), options.link && innerWrap.attr("href", options.link), options.target && innerWrap.attr("target", options.target),
|
961
|
+
this.group.push(innerWrap), innerWrap.insertBefore(this.text), this.initialize();
|
962
|
+
}
|
963
|
+
var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;
|
964
|
+
inherits(Subroutine, Symbol), module.exports = Subroutine;
|
965
|
+
}, /* 14 */
|
966
|
+
/*!******************************!*\
|
967
|
+
!*** ./src/jquery-plugin.js ***!
|
968
|
+
\******************************/
|
969
|
+
/***/
|
970
|
+
function(module, exports, __webpack_require__) {
|
971
|
+
if ("undefined" != typeof jQuery) {
|
972
|
+
var parse = __webpack_require__(/*! ./flowchart.parse */ 4);
|
973
|
+
!function($) {
|
974
|
+
$.fn.flowChart = function(options) {
|
975
|
+
return this.each(function() {
|
976
|
+
var $this = $(this), chart = parse($this.text());
|
977
|
+
$this.html(""), chart.drawSVG(this, options);
|
978
|
+
});
|
979
|
+
};
|
980
|
+
}(jQuery);
|
981
|
+
}
|
982
|
+
}, /* 15 */
|
983
|
+
/*!**************************!*\
|
984
|
+
!*** external "Raphael" ***!
|
985
|
+
\**************************/
|
986
|
+
/***/
|
987
|
+
function(module, exports) {
|
988
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_15__;
|
989
|
+
} ]);
|
990
|
+
});
|
991
|
+
//# sourceMappingURL=flowchart.js.map
|