Skip to content

Commit 921fdf7

Browse files
yhoonkimGitHub Actions Bot
andauthored
fix: do not apply the color domain order for the unstacked ungrouped chart (#9687)
As titled; The existing logic applied the order by domain for non-stacked/non-grouped chart (such as color line without stack) so it breaks the order of the path. This PR fixes it. (see the example commit by commit) --------- Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
1 parent cb93216 commit 921fdf7

15 files changed

+250
-73
lines changed

examples/compiled/bar_diverging_stack_transform.svg

Lines changed: 1 addition & 1 deletion
Loading

examples/compiled/bar_diverging_stack_transform.vg.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,6 @@
282282
},
283283
{"type": "formula", "expr": "datum.v1 - datum.offset", "as": "nx"},
284284
{"type": "formula", "expr": "datum.v2 - datum.offset", "as": "nx2"},
285-
{
286-
"type": "formula",
287-
"expr": "indexof([\"Strongly disagree\",\"Disagree\",\"Neither agree nor disagree\",\"Agree\",\"Strongly agree\"], datum['type'])",
288-
"as": "_type_sort_index"
289-
},
290285
{
291286
"type": "filter",
292287
"expr": "isValid(datum[\"nx\"]) && isFinite(+datum[\"nx\"])"
@@ -306,10 +301,6 @@
306301
"name": "marks",
307302
"type": "rect",
308303
"style": ["bar"],
309-
"sort": {
310-
"field": ["datum[\"_type_sort_index\"]"],
311-
"order": ["ascending"]
312-
},
313304
"from": {"data": "data_0"},
314305
"encode": {
315306
"update": {
184 Bytes
Loading

examples/compiled/geo_layer_line_london.svg

Lines changed: 1 addition & 1 deletion
Loading

examples/compiled/geo_layer_line_london.vg.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
"url": "data/londonBoroughs.json",
1313
"format": {"type": "topojson", "feature": "boroughs"}
1414
},
15+
{
16+
"name": "source_2",
17+
"url": "data/londonTubeLines.json",
18+
"format": {"type": "topojson", "feature": "line"}
19+
},
1520
{
1621
"name": "source_1",
1722
"url": "data/londonCentroids.json",
@@ -34,18 +39,6 @@
3439
"as": ["layer_1_x", "layer_1_y"]
3540
}
3641
]
37-
},
38-
{
39-
"name": "source_2",
40-
"url": "data/londonTubeLines.json",
41-
"format": {"type": "topojson", "feature": "line"},
42-
"transform": [
43-
{
44-
"type": "formula",
45-
"expr": "indexof([\"Bakerloo\",\"Central\",\"Circle\",\"District\",\"DLR\",\"Hammersmith & City\",\"Jubilee\",\"Metropolitan\",\"Northern\",\"Piccadilly\",\"Victoria\",\"Waterloo & City\"], datum['id'])",
46-
"as": "_id_sort_index"
47-
}
48-
]
4942
}
5043
],
5144
"projections": [
@@ -100,7 +93,6 @@
10093
"name": "layer_2_marks",
10194
"type": "shape",
10295
"style": ["geoshape"],
103-
"sort": {"field": ["datum[\"_id_sort_index\"]"], "order": ["descending"]},
10496
"from": {"data": "source_2"},
10597
"encode": {
10698
"update": {

examples/compiled/isotype_bar_chart.svg

Lines changed: 1 addition & 1 deletion
Loading

examples/compiled/isotype_bar_chart.vg.json

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,9 @@
4545
{"country": "United States", "animal": "sheep", "col": 1}
4646
]
4747
},
48-
{
49-
"name": "data_0",
50-
"source": "source_0",
51-
"transform": [
52-
{
53-
"type": "formula",
54-
"expr": "indexof([\"person\",\"cattle\",\"pigs\",\"sheep\"], datum['animal'])",
55-
"as": "_animal_sort_index"
56-
}
57-
]
58-
},
5948
{
6049
"name": "row_domain",
61-
"source": "data_0",
50+
"source": "source_0",
6251
"transform": [{"type": "aggregate", "groupby": ["country"]}]
6352
}
6453
],
@@ -90,7 +79,7 @@
9079
"type": "group",
9180
"style": "cell",
9281
"from": {
93-
"facet": {"name": "facet", "data": "data_0", "groupby": ["country"]}
82+
"facet": {"name": "facet", "data": "source_0", "groupby": ["country"]}
9483
},
9584
"sort": {"field": ["datum[\"country\"]"], "order": ["ascending"]},
9685
"encode": {
@@ -104,10 +93,6 @@
10493
"name": "child_marks",
10594
"type": "symbol",
10695
"style": ["point"],
107-
"sort": {
108-
"field": ["datum[\"_animal_sort_index\"]"],
109-
"order": ["descending"]
110-
},
11196
"from": {"data": "facet"},
11297
"encode": {
11398
"update": {
@@ -131,14 +116,14 @@
131116
{
132117
"name": "x",
133118
"type": "point",
134-
"domain": {"data": "data_0", "field": "col", "sort": true},
119+
"domain": {"data": "source_0", "field": "col", "sort": true},
135120
"range": [0, {"signal": "child_width"}],
136121
"padding": 0.5
137122
},
138123
{
139124
"name": "y",
140125
"type": "point",
141-
"domain": {"data": "data_0", "field": "animal", "sort": true},
126+
"domain": {"data": "source_0", "field": "animal", "sort": true},
142127
"range": [0, {"signal": "child_height"}],
143128
"padding": 0.5
144129
},

examples/compiled/layer_text_heatmap_joinaggregate.vg.json

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@
3838
"expr": "isValid(datum[\"num_cars\"]) && isFinite(+datum[\"num_cars\"])"
3939
}
4040
]
41-
},
42-
{
43-
"name": "data_1",
44-
"source": "source_0",
45-
"transform": [
46-
{
47-
"type": "formula",
48-
"expr": "indexof([false,true], datum['more_than_half'])",
49-
"as": "_more_than_half_sort_index"
50-
}
51-
]
5241
}
5342
],
5443
"signals": [
@@ -80,11 +69,7 @@
8069
"name": "layer_1_marks",
8170
"type": "text",
8271
"style": ["text"],
83-
"sort": {
84-
"field": ["datum[\"_more_than_half_sort_index\"]"],
85-
"order": ["descending"]
86-
},
87-
"from": {"data": "data_1"},
72+
"from": {"data": "source_0"},
8873
"encode": {
8974
"update": {
9075
"fill": {"scale": "layer_1_color", "field": "more_than_half"},
@@ -107,7 +92,7 @@
10792
"domain": {
10893
"fields": [
10994
{"data": "data_0", "field": "Cylinders"},
110-
{"data": "data_1", "field": "Cylinders"}
95+
{"data": "source_0", "field": "Cylinders"}
11196
],
11297
"sort": true
11398
},
@@ -121,7 +106,7 @@
121106
"domain": {
122107
"fields": [
123108
{"data": "data_0", "field": "Origin"},
124-
{"data": "data_1", "field": "Origin"}
109+
{"data": "source_0", "field": "Origin"}
125110
],
126111
"sort": true
127112
},
28.6 KB
Loading

0 commit comments

Comments
 (0)