diff --git a/examples/compiled/arc_radial.png b/examples/compiled/arc_radial.png index dcb6398753..f111f131cb 100644 Binary files a/examples/compiled/arc_radial.png and b/examples/compiled/arc_radial.png differ diff --git a/examples/compiled/arc_radial.vg.json b/examples/compiled/arc_radial.vg.json index 8a23181fe6..83b164d48c 100644 --- a/examples/compiled/arc_radial.vg.json +++ b/examples/compiled/arc_radial.vg.json @@ -34,10 +34,7 @@ "type": "stack", "groupby": [], "field": "data", - "sort": { - "field": ["data", "data"], - "order": ["ascending", "ascending"] - }, + "sort": {"field": ["data"], "order": ["ascending"]}, "as": ["data_start", "data_end"], "offset": "zero" }, diff --git a/examples/compiled/layer_arc_label.png b/examples/compiled/layer_arc_label.png index 450c9d1817..0192b9d20b 100644 Binary files a/examples/compiled/layer_arc_label.png and b/examples/compiled/layer_arc_label.png differ diff --git a/examples/compiled/layer_arc_label.vg.json b/examples/compiled/layer_arc_label.vg.json index 558ba6bfe2..6cf4119997 100644 --- a/examples/compiled/layer_arc_label.vg.json +++ b/examples/compiled/layer_arc_label.vg.json @@ -44,10 +44,7 @@ "type": "stack", "groupby": [], "field": "value", - "sort": { - "field": ["category", "category"], - "order": ["ascending", "ascending"] - }, + "sort": {"field": ["category"], "order": ["ascending"]}, "as": ["value_start", "value_end"], "offset": "zero" }, diff --git a/src/compile/data/stack.ts b/src/compile/data/stack.ts index 184f85957e..553bba2279 100644 --- a/src/compile/data/stack.ts +++ b/src/compile/data/stack.ts @@ -146,8 +146,10 @@ export class StackNode extends DataFlowNode { // FIXME is the default here correct for binned fields? sort = stackby.reduce( (s, field) => { - s.field.push(field); - s.order.push(sortOrder); + if (!s.field.includes(field)) { + s.field.push(field); + s.order.push(sortOrder); + } return s; }, {field: [], order: []}