@@ -524,8 +524,8 @@ mod integration_tests {
524524 let query = r#"
525525 SELECT 1 as x, 10 as y
526526 VISUALISE x, y
527- DRAW line MAPPING 'value' AS color
528- DRAW point MAPPING 'value2' AS color
527+ DRAW line MAPPING 'value' AS linetype
528+ DRAW point MAPPING 'value2' AS shape
529529 "# ;
530530
531531 // Prepare data - this parses, injects constants into global data, and replaces literals with columns
@@ -553,12 +553,12 @@ mod integration_tests {
553553 let global_df = prepared. data . get ( naming:: GLOBAL_DATA_KEY ) . unwrap ( ) ;
554554 let col_names = global_df. get_column_names ( ) ;
555555 assert ! (
556- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_0__ " ) ,
556+ col_names. iter( ) . any( |c| * c == "__ggsql_const_linetype_0__ " ) ,
557557 "Global data should have layer 0 color constant: {:?}" ,
558558 col_names
559559 ) ;
560560 assert ! (
561- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_1__ " ) ,
561+ col_names. iter( ) . any( |c| * c == "__ggsql_const_shape_1__ " ) ,
562562 "Global data should have layer 1 color constant: {:?}" ,
563563 col_names
564564 ) ;
@@ -572,18 +572,18 @@ mod integration_tests {
572572 assert_eq ! ( vl_spec[ "layer" ] . as_array( ) . unwrap( ) . len( ) , 2 ) ;
573573
574574 // Verify the color aesthetic is mapped to layer-indexed synthetic columns
575- let layer0_color = & vl_spec[ "layer" ] [ 0 ] [ "encoding" ] [ "color " ] ;
576- let layer1_color = & vl_spec[ "layer" ] [ 1 ] [ "encoding" ] [ "color " ] ;
575+ let layer0_color = & vl_spec[ "layer" ] [ 0 ] [ "encoding" ] [ "linetype " ] ;
576+ let layer1_color = & vl_spec[ "layer" ] [ 1 ] [ "encoding" ] [ "shape " ] ;
577577
578- // Color should be field-mapped to layer-indexed columns
578+ // Constants should be field-mapped to layer-indexed columns
579579 assert_eq ! (
580580 layer0_color[ "field" ] . as_str( ) . unwrap( ) ,
581- "__ggsql_const_color_0__ " ,
581+ "__ggsql_const_linetype_0__ " ,
582582 "Layer 0 color should map to layer-indexed column"
583583 ) ;
584584 assert_eq ! (
585585 layer1_color[ "field" ] . as_str( ) . unwrap( ) ,
586- "__ggsql_const_color_1__ " ,
586+ "__ggsql_const_shape_1__ " ,
587587 "Layer 1 color should map to layer-indexed column"
588588 ) ;
589589
@@ -594,18 +594,18 @@ mod integration_tests {
594594 // Verify constant values appear in the global data with layer-indexed names
595595 let data_row = & global_data. as_array ( ) . unwrap ( ) [ 0 ] ;
596596 assert_eq ! (
597- data_row[ "__ggsql_const_color_0__ " ] , "value" ,
597+ data_row[ "__ggsql_const_linetype_0__ " ] , "value" ,
598598 "Layer 0 constant should be 'value'"
599599 ) ;
600600 assert_eq ! (
601- data_row[ "__ggsql_const_color_1__ " ] , "value2" ,
601+ data_row[ "__ggsql_const_shape_1__ " ] , "value2" ,
602602 "Layer 1 constant should be 'value2'"
603603 ) ;
604604 }
605605
606606 #[ test]
607- fn test_end_to_end_facet_with_constant_colors ( ) {
608- // Test faceting with multiple layers that have constant color mappings
607+ fn test_end_to_end_facet_with_constant_strokes ( ) {
608+ // Test faceting with multiple layers that have constant stroke mappings
609609 // This verifies the fix for faceting compatibility with constants
610610
611611 let reader = DuckDBReader :: from_connection_string ( "duckdb://memory" ) . unwrap ( ) ;
@@ -629,10 +629,10 @@ mod integration_tests {
629629 SELECT month, region, category, revenue, quantity * 10 as qty_scaled
630630 FROM facet_test
631631 VISUALISE month AS x
632- DRAW line MAPPING revenue AS y, 'value' AS color
633- DRAW point MAPPING revenue AS y, 'value2' AS color SETTING size => 30
634- DRAW line MAPPING qty_scaled AS y, 'value3' AS color
635- DRAW point MAPPING qty_scaled AS y, 'value4' AS color SETTING size => 30
632+ DRAW line MAPPING revenue AS y, 'value' AS stroke
633+ DRAW point MAPPING revenue AS y, 'value2' AS stroke SETTING size => 30
634+ DRAW line MAPPING qty_scaled AS y, 'value3' AS stroke
635+ DRAW point MAPPING qty_scaled AS y, 'value4' AS stroke SETTING size => 30
636636 SCALE x SETTING type => 'date'
637637 FACET region BY category
638638 "# ;
@@ -667,19 +667,19 @@ mod integration_tests {
667667 let global_df = prepared. data . get ( naming:: GLOBAL_DATA_KEY ) . unwrap ( ) ;
668668 let col_names = global_df. get_column_names ( ) ;
669669 assert ! (
670- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_0__ " ) ,
670+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_0__ " ) ,
671671 "Should have layer 0 color constant"
672672 ) ;
673673 assert ! (
674- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_1__ " ) ,
674+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_1__ " ) ,
675675 "Should have layer 1 color constant"
676676 ) ;
677677 assert ! (
678- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_2__ " ) ,
678+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_2__ " ) ,
679679 "Should have layer 2 color constant"
680680 ) ;
681681 assert ! (
682- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_3__ " ) ,
682+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_3__ " ) ,
683683 "Should have layer 3 color constant"
684684 ) ;
685685
@@ -699,7 +699,7 @@ mod integration_tests {
699699 #[ test]
700700 fn test_end_to_end_global_constant_in_visualise ( ) {
701701 // Test that global constants in VISUALISE clause work correctly
702- // e.g., VISUALISE date AS x, value AS y, 'value' AS color
702+ // e.g., VISUALISE date AS x, value AS y, 'value' AS stroke
703703
704704 let reader = DuckDBReader :: from_connection_string ( "duckdb://memory" ) . unwrap ( ) ;
705705
@@ -716,10 +716,10 @@ mod integration_tests {
716716 )
717717 . unwrap ( ) ;
718718
719- // Query with global constant color in VISUALISE clause
719+ // Query with global constant stroke in VISUALISE clause
720720 let query = r#"
721721 SELECT date, value FROM timeseries
722- VISUALISE date AS x, value AS y, 'value' AS color
722+ VISUALISE date AS x, value AS y, 'value' AS stroke
723723 DRAW line
724724 DRAW point SETTING size => 50
725725 SCALE x SETTING type => 'date'
@@ -738,13 +738,13 @@ mod integration_tests {
738738 let global_df = prepared. data . get ( naming:: GLOBAL_DATA_KEY ) . unwrap ( ) ;
739739 let col_names = global_df. get_column_names ( ) ;
740740 assert ! (
741- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_0__ " ) ,
742- "Should have layer 0 color constant: {:?}" ,
741+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_0__ " ) ,
742+ "Should have layer 0 stroke constant: {:?}" ,
743743 col_names
744744 ) ;
745745 assert ! (
746- col_names. iter( ) . any( |c| * c == "__ggsql_const_color_1__ " ) ,
747- "Should have layer 1 color constant: {:?}" ,
746+ col_names. iter( ) . any( |c| * c == "__ggsql_const_stroke_1__ " ) ,
747+ "Should have layer 1 stroke constant: {:?}" ,
748748 col_names
749749 ) ;
750750
@@ -756,23 +756,23 @@ mod integration_tests {
756756 // Both layers should have color field-mapped to their indexed constant columns
757757 assert_eq ! ( vl_spec[ "layer" ] . as_array( ) . unwrap( ) . len( ) , 2 ) ;
758758 assert_eq ! (
759- vl_spec[ "layer" ] [ 0 ] [ "encoding" ] [ "color " ] [ "field" ]
759+ vl_spec[ "layer" ] [ 0 ] [ "encoding" ] [ "stroke " ] [ "field" ]
760760 . as_str( )
761761 . unwrap( ) ,
762- "__ggsql_const_color_0__ "
762+ "__ggsql_const_stroke_0__ "
763763 ) ;
764764 assert_eq ! (
765- vl_spec[ "layer" ] [ 1 ] [ "encoding" ] [ "color " ] [ "field" ]
765+ vl_spec[ "layer" ] [ 1 ] [ "encoding" ] [ "stroke " ] [ "field" ]
766766 . as_str( )
767767 . unwrap( ) ,
768- "__ggsql_const_color_1__ "
768+ "__ggsql_const_stroke_1__ "
769769 ) ;
770770
771771 // Both constants should have the same value "value"
772772 let data = & vl_spec[ "datasets" ] [ naming:: GLOBAL_DATA_KEY ]
773773 . as_array ( )
774774 . unwrap ( ) [ 0 ] ;
775- assert_eq ! ( data[ "__ggsql_const_color_0__ " ] , "value" ) ;
776- assert_eq ! ( data[ "__ggsql_const_color_1__ " ] , "value" ) ;
775+ assert_eq ! ( data[ "__ggsql_const_stroke_0__ " ] , "value" ) ;
776+ assert_eq ! ( data[ "__ggsql_const_stroke_1__ " ] , "value" ) ;
777777 }
778778}
0 commit comments