File tree 4 files changed +13
-10
lines changed 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { ConfigType , TypeofTypes } from 'src/config.types' ;
2
2
3
3
const config : ConfigType = {
4
+ indent : 4 , // Number of spaces
4
5
colors : {
5
- main_text : '#ffffff' ,
6
- background : '#1e1e1e' ,
7
- header : '#252526' ,
8
- icon_color : '#ffd700' ,
9
- indent_lines : '#404040' ,
10
- line_index : '#6e7681' ,
11
- keys : '#9cdcfe'
6
+ main_text : '#ffffff' , // Comma, colon color
7
+ background : '#1e1e1e' , // Main background color
8
+ header : '#252526' , // Color of header
9
+ icon_color : '#ffd700' , // Color of `{}` icon in filename
10
+ indent_lines : '#404040' , // Color of indent lines
11
+ line_index : '#6e7681' , // Color of indexes of lines
12
+ keys : '#9cdcfe' // Color of JSON keys
12
13
} ,
13
14
/**
14
15
* Get the color associated with a JavaScript data type.
Original file line number Diff line number Diff line change 1
1
export type TypeofTypes = 'string' | 'boolean' | 'function' | 'number' | 'object' | 'symbol' | 'undefined' | 'bigint' ;
2
2
3
3
export type ConfigType = {
4
+ indent : number ,
4
5
colors : {
5
6
main_text : string ,
6
7
background : string ,
Original file line number Diff line number Diff line change 31
31
{{{ json }}}
32
32
</text >
33
33
34
- <g style =" transform: translate(70px , 45px);" >
34
+ <g style =" transform: translate({{ indent_x }} px , 45px);" >
35
35
{{{ indents }}}
36
36
</g >
37
37
</svg >
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export class WidgetController {
19
19
@Res ( { passthrough : true } ) res : Response
20
20
) {
21
21
const json = await this . widgetService . generate ( ) ;
22
- const content = this . parserService . parse ( json , 30 ) ;
22
+ const content = this . parserService . parse ( json , config . indent * 7.5 ) ;
23
23
24
24
const indents = this . parserService . parseObjectStructure ( json ) ;
25
25
@@ -30,10 +30,11 @@ export class WidgetController {
30
30
return {
31
31
json : content ,
32
32
indexes : indexes ,
33
- indents : this . widgetService . generateIndentLines ( indents , 30 ) ,
33
+ indents : this . widgetService . generateIndentLines ( indents , config . indent * 7.5 ) ,
34
34
height : 52 + ( lines_count * 19 ) ,
35
35
height_ : 60 + ( lines_count * 19 ) ,
36
36
height_main_line : ( lines_count - 2 ) * 19 ,
37
+ indent_x : 40 + config . indent * 7.5 ,
37
38
38
39
background_color : config . colors . background ,
39
40
header_color : config . colors . header ,
You can’t perform that action at this time.
0 commit comments