@@ -322,23 +322,39 @@ pub enum GlobalMappingItem {
322322
323323pub struct Layer {
324324 pub geom : Geom , // Geometric object type
325+ pub position : Position , // Position adjustment (from SETTING position)
325326 pub aesthetics : HashMap <String , AestheticValue >, // Aesthetic mappings (from MAPPING)
326327 pub parameters : HashMap <String , ParameterValue >, // Geom parameters (from SETTING)
328+ pub source : Option <DataSource >, // Data source (from MAPPING ... FROM or PLACE)
327329 pub filter : Option <FilterExpression >, // Layer filter (from FILTER)
328330 pub partition_by : Vec <String >, // Grouping columns (from PARTITION BY)
329331}
330332
331333pub enum Geom {
332334 // Basic geoms
333- Point , Line , Path , Bar , Col , Area , Tile , Polygon , Ribbon ,
335+ Point , Line , Path , Bar , Col , Area , Rect , Polygon , Ribbon ,
334336 // Statistical geoms
335337 Histogram , Density , Smooth , Boxplot , Violin ,
336338 // Annotation geoms
337- Text , Label , Segment , Arrow , Rule , Linear , ErrorBar ,
339+ Text , Segment , Arrow , Rule , Linear , ErrorBar ,
340+ }
341+
342+ pub enum DataSource {
343+ Identifier (String ), // Table/CTE name
344+ FilePath (String ), // File path (quoted)
345+ Annotation , // PLACE clause (no external data)
346+ }
347+
348+ pub enum Position {
349+ Identity , // No adjustment
350+ Stack , // Stack elements (bars, areas)
351+ Dodge , // Dodge side-by-side (bars)
352+ Jitter , // Jitter points randomly
338353}
339354
340355pub enum AestheticValue {
341- Column (String ), // Unquoted column reference: revenue AS x
356+ Column (String ), // Column from data: revenue AS x
357+ AnnotationColumn (String ), // Annotation literal (PLACE): uses identity scale
342358 Literal (ParameterValue ), // Quoted literal: 'value' AS fill
343359}
344360
@@ -1178,6 +1194,7 @@ Where `<global_mapping>` can be:
11781194| ----------- | ---------- | ----------------- | ----------------------------------------- |
11791195| ` VISUALISE ` | ✅ Yes | Entry point | ` VISUALISE date AS x, revenue AS y ` |
11801196| ` DRAW ` | ✅ Yes | Define layers | ` DRAW line MAPPING date AS x, value AS y ` |
1197+ | ` PLACE ` | ✅ Yes | Annotation layers | ` PLACE point SETTING x => 5, y => 10 ` |
11811198| ` SCALE ` | ✅ Yes | Configure scales | ` SCALE x VIA date ` |
11821199| ` FACET ` | ❌ No | Small multiples | ` FACET region ` |
11831200| ` PROJECT ` | ❌ No | Coordinate system | ` PROJECT TO cartesian ` |
@@ -1200,7 +1217,7 @@ All clauses (MAPPING, SETTING, PARTITION BY, FILTER) are optional.
12001217
12011218** Geom Types** :
12021219
1203- - ** Basic** : ` point ` , ` line ` , ` path ` , ` bar ` , ` col ` , ` area ` , ` tile ` , ` polygon ` , ` ribbon `
1220+ - ** Basic** : ` point ` , ` line ` , ` path ` , ` bar ` , ` col ` , ` area ` , ` rect ` , ` polygon ` , ` ribbon `
12041221- ** Statistical** : ` histogram ` , ` density ` , ` smooth ` , ` boxplot ` , ` violin `
12051222- ** Annotation** : ` text ` , ` label ` , ` segment ` , ` arrow ` , ` rule ` , ` linear ` , ` errorbar `
12061223
@@ -1211,7 +1228,7 @@ Maps data values (columns or literals) to visual aesthetics. Syntax: `value AS a
12111228- ** Position** : ` x ` , ` y ` , ` xmin ` , ` xmax ` , ` ymin ` , ` ymax `
12121229- ** Color** : ` color ` , ` fill ` , ` stroke ` , ` opacity `
12131230- ** Size/Shape** : ` size ` , ` shape ` , ` linetype ` , ` linewidth `
1214- - ** Text** : ` label ` , ` family ` , ` fontface `
1231+ - ** Text** : ` label ` , ` typeface ` , ` fontweight ` , ` italic `
12151232
12161233** Literal vs Column** :
12171234
@@ -1289,6 +1306,29 @@ DRAW line
12891306 FILTER year >= 2020
12901307```
12911308
1309+ ### PLACE Clause (Annotation Layers)
1310+
1311+ ** Syntax** :
1312+
1313+ ``` sql
1314+ PLACE < geom> SETTING < aesthetic/ parameter> => < value> , ...
1315+ ```
1316+
1317+ Creates annotation layers with literal values only (no data mappings). All aesthetics set via SETTING; supports arrays that are recycled to longest length. No FILTER/PARTITION BY/ORDER BY support.
1318+
1319+ ** Examples** :
1320+
1321+ ``` sql
1322+ -- Single annotation
1323+ PLACE point SETTING x => 5 , y => 10 , color => ' red'
1324+
1325+ -- Multiple annotations (array recycling)
1326+ PLACE point SETTING x => [1 , 2 , 3 ], y => [10 , 20 , 30 ]
1327+
1328+ -- Reference line
1329+ PLACE rule SETTING x => 5 , color => ' red'
1330+ ```
1331+
12921332### SCALE Clause
12931333
12941334** Syntax** :
0 commit comments