mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 08:19:43 +02:00
gantt: add a topAxis directive to allow per diagram configuration
This commit is contained in:
@@ -16,6 +16,7 @@ let currentSection = '';
|
|||||||
const tags = ['active', 'done', 'crit', 'milestone'];
|
const tags = ['active', 'done', 'crit', 'milestone'];
|
||||||
let funs = [];
|
let funs = [];
|
||||||
let inclusiveEndDates = false;
|
let inclusiveEndDates = false;
|
||||||
|
let topAxis = false;
|
||||||
|
|
||||||
// The serial order of the task in the script
|
// The serial order of the task in the script
|
||||||
let lastOrder = 0;
|
let lastOrder = 0;
|
||||||
@@ -39,6 +40,7 @@ export const clear = function() {
|
|||||||
todayMarker = '';
|
todayMarker = '';
|
||||||
excludes = [];
|
excludes = [];
|
||||||
inclusiveEndDates = false;
|
inclusiveEndDates = false;
|
||||||
|
topAxis = false;
|
||||||
lastOrder = 0;
|
lastOrder = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -70,6 +72,14 @@ export const endDatesAreInclusive = function() {
|
|||||||
return inclusiveEndDates;
|
return inclusiveEndDates;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const enableTopAxis = function() {
|
||||||
|
topAxis = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const topAxisEnabled = function() {
|
||||||
|
return topAxis;
|
||||||
|
};
|
||||||
|
|
||||||
export const getDateFormat = function() {
|
export const getDateFormat = function() {
|
||||||
return dateFormat;
|
return dateFormat;
|
||||||
};
|
};
|
||||||
@@ -594,6 +604,8 @@ export default {
|
|||||||
getDateFormat,
|
getDateFormat,
|
||||||
enableInclusiveEndDates,
|
enableInclusiveEndDates,
|
||||||
endDatesAreInclusive,
|
endDatesAreInclusive,
|
||||||
|
enableTopAxis,
|
||||||
|
topAxisEnabled,
|
||||||
setAxisFormat,
|
setAxisFormat,
|
||||||
getAxisFormat,
|
getAxisFormat,
|
||||||
setTodayMarker,
|
setTodayMarker,
|
||||||
|
@@ -68,6 +68,7 @@ that id.
|
|||||||
"gantt" return 'gantt';
|
"gantt" return 'gantt';
|
||||||
"dateFormat"\s[^#\n;]+ return 'dateFormat';
|
"dateFormat"\s[^#\n;]+ return 'dateFormat';
|
||||||
"inclusiveEndDates" return 'inclusiveEndDates';
|
"inclusiveEndDates" return 'inclusiveEndDates';
|
||||||
|
"topAxis" return 'topAxis';
|
||||||
"axisFormat"\s[^#\n;]+ return 'axisFormat';
|
"axisFormat"\s[^#\n;]+ return 'axisFormat';
|
||||||
"excludes"\s[^#\n;]+ return 'excludes';
|
"excludes"\s[^#\n;]+ return 'excludes';
|
||||||
"todayMarker"\s[^\n;]+ return 'todayMarker';
|
"todayMarker"\s[^\n;]+ return 'todayMarker';
|
||||||
@@ -108,6 +109,7 @@ line
|
|||||||
statement
|
statement
|
||||||
: dateFormat {yy.setDateFormat($1.substr(11));$$=$1.substr(11);}
|
: dateFormat {yy.setDateFormat($1.substr(11));$$=$1.substr(11);}
|
||||||
| inclusiveEndDates {yy.enableInclusiveEndDates();$$=$1.substr(18);}
|
| inclusiveEndDates {yy.enableInclusiveEndDates();$$=$1.substr(18);}
|
||||||
|
| topAxis {yy.TopAxis();$$=$1.substr(8);}
|
||||||
| axisFormat {yy.setAxisFormat($1.substr(11));$$=$1.substr(11);}
|
| axisFormat {yy.setAxisFormat($1.substr(11));$$=$1.substr(11);}
|
||||||
| excludes {yy.setExcludes($1.substr(9));$$=$1.substr(9);}
|
| excludes {yy.setExcludes($1.substr(9));$$=$1.substr(9);}
|
||||||
| todayMarker {yy.setTodayMarker($1.substr(12));$$=$1.substr(12);}
|
| todayMarker {yy.setTodayMarker($1.substr(12));$$=$1.substr(12);}
|
||||||
|
Reference in New Issue
Block a user