@@ -2,7 +2,7 @@ import * as d3 from 'd3';
2
2
import idCache from './id-cache.js' ;
3
3
import stateDb from './stateDb' ;
4
4
import utils from '../../utils' ;
5
- import { getConfig , conf } from '../../config' ;
5
+ import { getConfig } from '../../config' ;
6
6
7
7
// let conf;
8
8
@@ -131,15 +131,15 @@ export const drawDescrState = (g, stateDef) => {
131
131
*/
132
132
export const addIdAndBox = ( g , stateDef ) => {
133
133
// TODO Move hardcodings to conf
134
- const addTspan = function ( textEl , txt , isFirst ) {
135
- const tSpan = textEl
136
- . append ( 'tspan' )
137
- . attr ( 'x' , 2 * getConfig ( ) . state . padding )
138
- . text ( txt ) ;
139
- if ( ! isFirst ) {
140
- tSpan . attr ( 'dy' , getConfig ( ) . state . textHeight ) ;
141
- }
142
- } ;
134
+ // const addTspan = function(textEl, txt, isFirst) {
135
+ // const tSpan = textEl
136
+ // .append('tspan')
137
+ // .attr('x', 2 * getConfig().state.padding)
138
+ // .text(txt);
139
+ // if (!isFirst) {
140
+ // tSpan.attr('dy', getConfig().state.textHeight);
141
+ // }
142
+ // };
143
143
const title = g
144
144
. append ( 'text' )
145
145
. attr ( 'x' , 2 * getConfig ( ) . state . padding )
@@ -148,7 +148,7 @@ export const addIdAndBox = (g, stateDef) => {
148
148
. attr ( 'class' , 'state-title' )
149
149
. text ( stateDef . id ) ;
150
150
151
- const titleHeight = title . node ( ) . getBBox ( ) . height ;
151
+ const titleBox = title . node ( ) . getBBox ( ) ;
152
152
153
153
const lineY = 1 - getConfig ( ) . state . textHeight ;
154
154
const descrLine = g
@@ -159,7 +159,7 @@ export const addIdAndBox = (g, stateDef) => {
159
159
. attr ( 'class' , 'descr-divider' ) ;
160
160
161
161
const graphBox = g . node ( ) . getBBox ( ) ;
162
- title . attr ( 'x' , graphBox . width / 2 - title . node ( ) . getBBox ( ) . width / 2 ) ;
162
+ title . attr ( 'x' , graphBox . width / 2 - titleBox . width / 2 ) ;
163
163
descrLine . attr ( 'x2' , graphBox . width + getConfig ( ) . state . padding ) ;
164
164
165
165
// White color
@@ -241,7 +241,7 @@ const drawForkJoinState = (g, stateDef) => {
241
241
. attr ( 'y' , getConfig ( ) . state . padding ) ;
242
242
} ;
243
243
244
- export const drawText = function ( elem , textData , width ) {
244
+ export const drawText = function ( elem , textData ) {
245
245
// Remove and ignore br:s
246
246
const nText = textData . text . replace ( / < b r \/ ? > / gi, ' ' ) ;
247
247
@@ -264,7 +264,7 @@ export const drawText = function(elem, textData, width) {
264
264
265
265
const _drawLongText = ( _text , x , y , g ) => {
266
266
let textHeight = 0 ;
267
- let textWidth = 0 ;
267
+
268
268
const textElem = g . append ( 'text' ) ;
269
269
textElem . style ( 'text-anchor' , 'start' ) ;
270
270
textElem . attr ( 'class' , 'noteText' ) ;
@@ -317,8 +317,7 @@ export const drawNote = (text, g) => {
317
317
* @param {* } stateDef
318
318
*/
319
319
320
- let cnt = 0 ;
321
- export const drawState = function ( elem , stateDef , graph , doc ) {
320
+ export const drawState = function ( elem , stateDef ) {
322
321
const id = stateDef . id ;
323
322
const stateInfo = {
324
323
id : id ,
0 commit comments