Skip to content

Commit

Permalink
Fix for issue #174
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jun 14, 2015
1 parent eb555f7 commit 342b83a
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 57 deletions.
15 changes: 6 additions & 9 deletions dist/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -24999,6 +24999,7 @@ module.exports={
"gulp-concat": "~2.4.1",
"gulp-data": "^1.1.1",
"gulp-ext-replace": "~0.1.0",
"gulp-filelog": "^0.4.1",
"gulp-hogan": "^1.1.0",
"gulp-insert": "^0.4.0",
"gulp-istanbul": "^0.4.0",
Expand Down Expand Up @@ -26381,6 +26382,7 @@ exports.setClass = function (id,className) {
}
}
};
var clickEvents = [];
/**
* Called by parser when a graph definition is found, stores the direction of the chart.
* @param dir
Expand All @@ -26407,7 +26409,6 @@ exports.setClickEvent = function (id,functionName) {
funs.push(function(){
var elem = document.getElementById(id);
if(elem !== null){
//console.log('id was NOT null: '+id);
elem.onclick = function(){eval(functionName+'(\'' + id + '\')');}; // jshint ignore:line
}
else{
Expand All @@ -26421,12 +26422,9 @@ exports.setClickEvent = function (id,functionName) {
};

exports.bindFunctions = function(){
//setTimeout(function(){
funs.forEach(function(fun){
fun();
});
//},1000);

funs.forEach(function(fun){
fun();
});
};
exports.getDirection = function () {
return direction;
Expand Down Expand Up @@ -26462,7 +26460,7 @@ exports.clear = function () {
vertices = {};
classes = {};
edges = [];
funs = [];
//funs = [];
subGraphs = [];
subCount = 0;
};
Expand Down Expand Up @@ -26528,7 +26526,6 @@ var indexNodes = function (id, pos) {
}
//var nPos = getPosForId(subGraphs[pos].id);
posCrossRef[secCount]=pos;
console.log('Setting ',' ',secCount,' to ',pos);
// Check if match
if(subGraphs[pos].id === id){
return {
Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.min.js

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions dist/mermaid.slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -15783,6 +15783,7 @@ module.exports={
"gulp-concat": "~2.4.1",
"gulp-data": "^1.1.1",
"gulp-ext-replace": "~0.1.0",
"gulp-filelog": "^0.4.1",
"gulp-hogan": "^1.1.0",
"gulp-insert": "^0.4.0",
"gulp-istanbul": "^0.4.0",
Expand Down Expand Up @@ -17165,6 +17166,7 @@ exports.setClass = function (id,className) {
}
}
};
var clickEvents = [];
/**
* Called by parser when a graph definition is found, stores the direction of the chart.
* @param dir
Expand All @@ -17191,7 +17193,6 @@ exports.setClickEvent = function (id,functionName) {
funs.push(function(){
var elem = document.getElementById(id);
if(elem !== null){
//console.log('id was NOT null: '+id);
elem.onclick = function(){eval(functionName+'(\'' + id + '\')');}; // jshint ignore:line
}
else{
Expand All @@ -17205,12 +17206,9 @@ exports.setClickEvent = function (id,functionName) {
};

exports.bindFunctions = function(){
//setTimeout(function(){
funs.forEach(function(fun){
fun();
});
//},1000);

funs.forEach(function(fun){
fun();
});
};
exports.getDirection = function () {
return direction;
Expand Down Expand Up @@ -17246,7 +17244,7 @@ exports.clear = function () {
vertices = {};
classes = {};
edges = [];
funs = [];
//funs = [];
subGraphs = [];
subCount = 0;
};
Expand Down Expand Up @@ -17312,7 +17310,6 @@ var indexNodes = function (id, pos) {
}
//var nPos = getPosForId(subGraphs[pos].id);
posCrossRef[secCount]=pos;
console.log('Setting ',' ',secCount,' to ',pos);
// Check if match
if(subGraphs[pos].id === id){
return {
Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.slim.min.js

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions dist/mermaidAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -24666,6 +24666,7 @@ module.exports={
"gulp-concat": "~2.4.1",
"gulp-data": "^1.1.1",
"gulp-ext-replace": "~0.1.0",
"gulp-filelog": "^0.4.1",
"gulp-hogan": "^1.1.0",
"gulp-insert": "^0.4.0",
"gulp-istanbul": "^0.4.0",
Expand Down Expand Up @@ -26048,6 +26049,7 @@ exports.setClass = function (id,className) {
}
}
};
var clickEvents = [];
/**
* Called by parser when a graph definition is found, stores the direction of the chart.
* @param dir
Expand All @@ -26074,7 +26076,6 @@ exports.setClickEvent = function (id,functionName) {
funs.push(function(){
var elem = document.getElementById(id);
if(elem !== null){
//console.log('id was NOT null: '+id);
elem.onclick = function(){eval(functionName+'(\'' + id + '\')');}; // jshint ignore:line
}
else{
Expand All @@ -26088,12 +26089,9 @@ exports.setClickEvent = function (id,functionName) {
};

exports.bindFunctions = function(){
//setTimeout(function(){
funs.forEach(function(fun){
fun();
});
//},1000);

funs.forEach(function(fun){
fun();
});
};
exports.getDirection = function () {
return direction;
Expand Down Expand Up @@ -26129,7 +26127,7 @@ exports.clear = function () {
vertices = {};
classes = {};
edges = [];
funs = [];
//funs = [];
subGraphs = [];
subCount = 0;
};
Expand Down Expand Up @@ -26195,7 +26193,6 @@ var indexNodes = function (id, pos) {
}
//var nPos = getPosForId(subGraphs[pos].id);
posCrossRef[secCount]=pos;
console.log('Setting ',' ',secCount,' to ',pos);
// Check if match
if(subGraphs[pos].id === id){
return {
Expand Down
17 changes: 7 additions & 10 deletions dist/mermaidAPI.slim.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/mermaidAPI.slim.min.js

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions src/diagrams/flowchart/graphDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ exports.setClass = function (id,className) {
}
}
};
var clickEvents = [];
/**
* Called by parser when a graph definition is found, stores the direction of the chart.
* @param dir
Expand All @@ -162,7 +163,6 @@ exports.setClickEvent = function (id,functionName) {
funs.push(function(){
var elem = document.getElementById(id);
if(elem !== null){
//console.log('id was NOT null: '+id);
elem.onclick = function(){eval(functionName+'(\'' + id + '\')');}; // jshint ignore:line
}
else{
Expand All @@ -176,12 +176,9 @@ exports.setClickEvent = function (id,functionName) {
};

exports.bindFunctions = function(){
//setTimeout(function(){
funs.forEach(function(fun){
fun();
});
//},1000);

funs.forEach(function(fun){
fun();
});
};
exports.getDirection = function () {
return direction;
Expand Down Expand Up @@ -217,7 +214,7 @@ exports.clear = function () {
vertices = {};
classes = {};
edges = [];
funs = [];
//funs = [];
subGraphs = [];
subCount = 0;
};
Expand Down Expand Up @@ -283,7 +280,6 @@ var indexNodes = function (id, pos) {
}
//var nPos = getPosForId(subGraphs[pos].id);
posCrossRef[secCount]=pos;
console.log('Setting ',' ',secCount,' to ',pos);
// Check if match
if(subGraphs[pos].id === id){
return {
Expand Down
38 changes: 37 additions & 1 deletion test/gantt.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
numberSectionStyles:3,
axisFormatter: [
// Within a day
["%I:%M", function (d) {
["X%I:%M", function (d) {
return d.getHours();
}],
// Monday a week
Expand All @@ -43,6 +43,42 @@
}]
]
};
mermaid.initialize({
sequenceDiagram:{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":45,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35, "mirrorActors":false},
gantt: {
titleTopMargin:25,
barHeight:20,
barGap:4,
topPadding:50,
sidePadding:75,
gridLineStartPadding:35,
fontSize:11,
numberSectionStyles:3,
axisFormatter: [
// Within a day
["X%I:%M", function (d) {
return d.getHours();
}],
// Monday a week
["w. %U", function (d) {
return d.getDay() == 1;
}],
// Day within a week (not monday)
["%a %d", function (d) {
return d.getDay() && d.getDate() != 1;
}],
// within a month
["%b %d", function (d) {
return d.getDate() != 1;
}],
// Month
["%m-%y", function (d) {
return d.getMonth();
}]
]
}

})
</script>

</head>
Expand Down
7 changes: 4 additions & 3 deletions test/web.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
mermaid.flowchartConfig = {width:'100%'};
</script>
<script>
function apa(){
console.log('CLICKED');
function coolAction(){
console.log('Got callback in user defiend function');
}
</script>
<style>
Expand All @@ -37,11 +37,12 @@ <h1>Issue 141</h1>
%% Example diagram
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
click A coolAction
B --> D{Rhombus}
C --> D
A("test(vcc) a a ") --> B;


</div>
<h1>Issue 140</h1>
<div class="mermaid" id="i140">
Expand Down

0 comments on commit 342b83a

Please sign in to comment.