Merged with mainline develop

This commit is contained in:
Chris Moran
2020-06-08 14:58:42 -04:00
27 changed files with 786 additions and 358 deletions

View File

@@ -268,8 +268,13 @@ export const getClasses = function(text) {
const parser = flow.parser;
parser.yy = flowDb;
// Parse the graph definition
parser.parse(text);
try {
// Parse the graph definition
parser.parse(text);
} catch (e) {
return;
}
return flowDb.getClasses();
};
@@ -278,6 +283,7 @@ export const getClasses = function(text) {
* @param text
* @param id
*/
export const draw = function(text, id) {
logger.info('Drawing flowchart');
flowDb.clear();
@@ -285,11 +291,11 @@ export const draw = function(text, id) {
parser.yy = flowDb;
// Parse the graph definition
try {
parser.parse(text);
} catch (err) {
logger.debug('Parsing failed');
}
// try {
parser.parse(text);
// } catch (err) {
// logger.debug('Parsing failed');
// }
// Fetch the default direction, use TD if none was found
let dir = flowDb.getDirection();

View File

@@ -247,12 +247,16 @@ export const addEdges = function(edges, g) {
export const getClasses = function(text) {
logger.info('Extracting classes');
flowDb.clear();
const parser = flow.parser;
parser.yy = flowDb;
try {
const parser = flow.parser;
parser.yy = flowDb;
// Parse the graph definition
parser.parse(text);
return flowDb.getClasses();
// Parse the graph definition
parser.parse(text);
return flowDb.getClasses();
} catch (e) {
return;
}
};
/**
@@ -267,11 +271,11 @@ export const draw = function(text, id) {
parser.yy = flowDb;
// Parse the graph definition
try {
parser.parse(text);
} catch (err) {
logger.debug('Parsing failed');
}
// try {
parser.parse(text);
// } catch (err) {
// logger.debug('Parsing failed');
// }
// Fetch the default direction, use TD if none was found
let dir = flowDb.getDirection();