@@ -6,6 +6,8 @@ import 'package:built_collection/built_collection.dart';
66import '../state/domain_name_mismatch.dart' ;
77import '../state/design.dart' ;
88import '../state/domain.dart' ;
9+ import '../state/helix.dart' ;
10+ import '../state/group.dart' ;
911import 'pure_component.dart' ;
1012import 'design_main_warning_star.dart' ;
1113import '../util.dart' as util;
@@ -19,7 +21,7 @@ mixin DesignMainDomainNameMismatchesProps on UiProps {
1921 late Design design;
2022 late bool only_display_selected_helices;
2123 late BuiltSet <int > side_selected_helix_idxs;
22- late BuiltMap <int , Point < double >> helix_idx_to_svg_position_map ;
24+ late BuiltMap <int , num > helix_idx_to_svg_position_y_map ;
2325}
2426
2527class DesignMainDomainNameMismatchesComponent extends UiComponent2 <DesignMainDomainNameMismatchesProps >
@@ -33,13 +35,14 @@ class DesignMainDomainNameMismatchesComponent extends UiComponent2<DesignMainDom
3335 List <ReactElement > _create_mismatch_components () {
3436 List <ReactElement > mismatch_components = [];
3537
36- for (var helix in props.design.helices.values) {
38+ for (Helix helix in props.design.helices.values) {
3739 if (props.only_display_selected_helices && ! props.side_selected_helix_idxs.contains (helix.idx)) {
3840 continue ;
3941 }
4042
4143 BuiltList <DomainNameMismatch > domain_name_mismatches = props.design.domain_name_mismatches[helix.idx]! ;
4244
45+ List <ReactElement > untransformed_mismatch_components = [];
4346 for (var domain_name_mismatch in domain_name_mismatches) {
4447 Domain forward_domain = domain_name_mismatch.forward_domain;
4548 Domain reverse_domain = domain_name_mismatch.reverse_domain;
@@ -52,12 +55,8 @@ class DesignMainDomainNameMismatchesComponent extends UiComponent2<DesignMainDom
5255 var helix = props.design.helices[domain.helix]! ;
5356 var group = props.design.groups[helix.group]! ;
5457 var geometry = group.geometry ?? props.design.geometry;
55- var base_svg_pos = helix.svg_base_pos (
56- mid,
57- domain.forward,
58- props.helix_idx_to_svg_position_map[helix.idx]! .y,
59- geometry,
60- );
58+ var svg_position_y = props.helix_idx_to_svg_position_y_map[helix.idx]! ;
59+ var base_svg_pos = helix.svg_base_pos (mid, domain.forward, svg_position_y, geometry);
6160 String key = '${domain .helix };${domain .forward };${domain .start };${mid };${domain .end }' ;
6261 var mismatch_component =
6362 (DesignMainWarningStar ()
@@ -67,9 +66,21 @@ class DesignMainDomainNameMismatchesComponent extends UiComponent2<DesignMainDom
6766 ..color = 'blue'
6867 ..domain_name_mismatch = domain_name_mismatch
6968 ..key = key)();
70- mismatch_components .add (mismatch_component);
69+ untransformed_mismatch_components .add (mismatch_component);
7170 }
7271 }
72+
73+ HelixGroup group = props.design.groups[helix.group]! ;
74+ String transform_str = group.transform_str (props.design.geometry);
75+
76+ if (untransformed_mismatch_components.isNotEmpty) {
77+ mismatch_components.add (
78+ (Dom .g ()
79+ ..transform = transform_str
80+ ..className = 'mismatch-domain-names-group'
81+ ..key = util.id_helix (helix))(untransformed_mismatch_components),
82+ );
83+ }
7384 }
7485 return mismatch_components;
7586 }
0 commit comments