@@ -169,6 +169,12 @@ class ArrowChart(BaseChart):
169169 description = "The column to label by" ,
170170 )
171171
172+ #: The column to group arrows by
173+ groups_column : str | None = Field (
174+ default = None ,
175+ description = "The column to group arrows by" ,
176+ )
177+
172178 #
173179 # Features
174180 #
@@ -180,13 +186,6 @@ class ArrowChart(BaseChart):
180186 description = "Label on the first arrow that shows column names" ,
181187 )
182188
183- #: Enables the group-by-column feature, works with "Group" field
184- group_by_column : bool = Field (
185- default = False ,
186- alias = "group-by-column" ,
187- description = "Enables the group-by-column feature, works with 'Group' field" ,
188- )
189-
190189 @field_validator ("replace_flags" )
191190 @classmethod
192191 def validate_replace_flags (
@@ -224,7 +223,7 @@ def serialize_model(self) -> dict:
224223 "range-extent" : self .range_extent ,
225224 "value-label-format" : self .value_label_format ,
226225 "color-by-column" : bool (self .color_category ),
227- "group-by-column" : self .group_by_column ,
226+ "group-by-column" : self .groups_column is not None ,
228227 "replace-flags" : ReplaceFlags .serialize (self .replace_flags ),
229228 "show-arrow-key" : self .arrow_key ,
230229 }
@@ -240,6 +239,8 @@ def serialize_model(self) -> dict:
240239 axes_dict ["colors" ] = self .color_column
241240 if self .label_column is not None :
242241 axes_dict ["labels" ] = self .label_column
242+ if self .groups_column is not None :
243+ axes_dict ["groups" ] = self .groups_column
243244
244245 # Only add axes section if there are fields to include
245246 if axes_dict :
@@ -319,10 +320,10 @@ def deserialize_model(cls, api_response: dict[str, Any]) -> dict[str, Any]:
319320 init_data ["color_column" ] = axes ["colors" ]
320321 if "labels" in axes :
321322 init_data ["label_column" ] = axes ["labels" ]
323+ if "groups" in axes :
324+ init_data ["groups_column" ] = axes ["groups" ]
322325
323326 # Features
324- if "group-by-column" in visualize :
325- init_data ["group_by_column" ] = visualize ["group-by-column" ]
326327 if "show-arrow-key" in visualize :
327328 init_data ["arrow_key" ] = visualize ["show-arrow-key" ]
328329
0 commit comments