@@ -4,10 +4,10 @@ import fastaParser from "./../helpers/fasta";
4
4
import computeLabelWidth from "../helpers/computeLabelWidth" ;
5
5
import BaseAlignment from "./BaseAlignment.jsx" ;
6
6
import SiteAxis from "./SiteAxis.jsx" ;
7
- import Placeholder from "./Placeholder.jsx" ;
8
7
import SequenceAxis from "./SequenceAxis.jsx" ;
9
8
import Scaffold from "./Scaffold.jsx" ;
10
9
import ScrollBroadcaster from "./../helpers/ScrollBroadcaster" ;
10
+ import css_grid_format from "../helpers/format" ;
11
11
import { nucleotide_color , nucleotide_text_color } from "./../helpers/colors" ;
12
12
13
13
class ScaffoldViewer extends Component {
@@ -18,14 +18,8 @@ class ScaffoldViewer extends Component {
18
18
}
19
19
setScrollingEvents ( props ) {
20
20
if ( props . fasta ) {
21
- const {
22
- width,
23
- height,
24
- axis_height,
25
- alignment_width,
26
- alignment_height
27
- } = props ;
28
- const { full_pixel_width, full_pixel_height, label_width } = this ;
21
+ const { alignment_width, alignment_height } = props ;
22
+ const { full_pixel_width, full_pixel_height } = this ;
29
23
this . scroll_broadcaster = new ScrollBroadcaster ( {
30
24
width : full_pixel_width ,
31
25
height : full_pixel_height ,
@@ -48,7 +42,7 @@ class ScaffoldViewer extends Component {
48
42
}
49
43
initialize ( props ) {
50
44
if ( props . fasta ) {
51
- const { fasta, site_size, width , height , axis_height } = props ;
45
+ const { fasta, site_size } = props ;
52
46
this . sequence_data = fastaParser ( fasta ) ;
53
47
const { sequence_data } = this ;
54
48
const { label_padding } = this . props ;
@@ -64,13 +58,14 @@ class ScaffoldViewer extends Component {
64
58
return < div style = { container_style } id = "alignmentjs-main-div" /> ;
65
59
}
66
60
const { alignment_width, alignment_height, scaffold_width } = this . props ,
67
- gridTemplateColumns = `${
68
- this . label_width
69
- } px ${ alignment_width } px ${ scaffold_width } px`,
70
61
container_style = {
71
62
display : "grid" ,
72
- gridTemplateColumns : gridTemplateColumns ,
73
- gridTemplateRows : `20px 20px ${ alignment_height } px`
63
+ gridTemplateColumns : css_grid_format ( [
64
+ this . label_width ,
65
+ alignment_width ,
66
+ scaffold_width
67
+ ] ) ,
68
+ gridTemplateRows : css_grid_format ( [ 20 , 20 , alignment_height ] )
74
69
} ,
75
70
reference_sequence_data = this . sequence_data . slice ( 0 , 1 ) ,
76
71
remaining_sequence_data = this . sequence_data . slice ( 1 ) ;
0 commit comments