mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
Replace 'var ' with 'const '
This commit is contained in:
@@ -8,13 +8,11 @@ describe('when parsing an info graph it', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should handle an info definition', function () {
|
it('should handle an info definition', function () {
|
||||||
var str = 'info\nsay: hello'
|
const str = 'info\nsay: hello'
|
||||||
|
|
||||||
parser.parse(str)
|
parser.parse(str)
|
||||||
})
|
})
|
||||||
it('should handle an showMessage statement definition', function () {
|
it('should handle an showMessage statement definition', function () {
|
||||||
var str = 'info\nshowInfo'
|
const str = 'info\nshowInfo'
|
||||||
|
|
||||||
parser.parse(str)
|
parser.parse(str)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { logger } from '../../logger'
|
import { logger } from '../../logger'
|
||||||
|
|
||||||
var message = ''
|
let message = ''
|
||||||
var info = false
|
let info = false
|
||||||
|
|
||||||
export const setMessage = function (txt) {
|
export const setMessage = function (txt) {
|
||||||
logger.debug('Setting message to: ' + txt)
|
logger.debug('Setting message to: ' + txt)
|
||||||
|
@@ -10,17 +10,16 @@ import { logger } from '../../logger'
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const draw = function (txt, id, ver) {
|
export const draw = function (txt, id, ver) {
|
||||||
var parser
|
const parser = exampleParser.parser
|
||||||
parser = exampleParser.parser
|
|
||||||
parser.yy = db
|
parser.yy = db
|
||||||
logger.debug('Renering example diagram')
|
logger.debug('Renering example diagram')
|
||||||
// Parse the graph definition
|
// Parse the graph definition
|
||||||
parser.parse(txt)
|
parser.parse(txt)
|
||||||
|
|
||||||
// Fetch the default direction, use TD if none was found
|
// Fetch the default direction, use TD if none was found
|
||||||
var svg = d3.select('#' + id)
|
const svg = d3.select('#' + id)
|
||||||
|
|
||||||
var g = svg.append('g')
|
const g = svg.append('g')
|
||||||
|
|
||||||
g.append('text') // text label for the x axis
|
g.append('text') // text label for the x axis
|
||||||
.attr('x', 100)
|
.attr('x', 100)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user