Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [VIZ-4715] Added fix for Vega-Lite duplicated axis issue #9385

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/compositemark/boxplot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ export function normalizeBoxPlot(
[continuousAxis]: {
field: continuousAxisChannelDef.field,
type: continuousAxisChannelDef.type,
...(title !== undefined ? {title} : {}),
...(scale !== undefined ? {scale} : {}),
// add axis without title since we already added the title above
...(isEmpty(axisWithoutTitle) ? {} : {axis: axisWithoutTitle})
Expand All @@ -326,7 +325,12 @@ export function normalizeBoxPlot(
if (outlierLayersMixins) {
filteredLayersMixins = {
transform: filteredLayersMixinsTransforms,
layer: [outlierLayersMixins, filteredWhiskerSpec]
layer: [outlierLayersMixins, filteredWhiskerSpec],
encoding: {
[continuousAxis]: {
...(title !== undefined ? {title} : {})
}
}
};
} else {
filteredLayersMixins = filteredWhiskerSpec;
Expand Down
9 changes: 6 additions & 3 deletions src/spec/facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Header} from '../header';
import {EncodingSortField, SortArray, SortOrder} from '../sort';
import {StandardType} from '../type';
import {BaseSpec, GenericCompositionLayoutWithColumns, ResolveMixins} from './base';
import {GenericLayerSpec, NormalizedLayerSpec} from './layer';
import {GenericLayerSpec, LayerSpec, NormalizedLayerSpec} from './layer';
import {GenericUnitSpec, NormalizedUnitSpec} from './unit';

export interface FacetFieldDef<F extends Field, ES extends ExprRef | SignalRef = ExprRef | SignalRef>
Expand Down Expand Up @@ -113,8 +113,11 @@ export function isFacetFieldDef<F extends Field>(channelDef: ChannelDef<F>): cha
/**
* Base interface for a facet specification.
*/
export interface GenericFacetSpec<U extends GenericUnitSpec<any, any>, L extends GenericLayerSpec<any>, F extends Field>
extends BaseSpec,
export interface GenericFacetSpec<
U extends GenericUnitSpec<any, any>,
L extends GenericLayerSpec<any> | LayerSpec<F>,
F extends Field
> extends BaseSpec,
GenericCompositionLayoutWithColumns,
ResolveMixins {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export {isUnitSpec} from './unit';
*/
export type GenericSpec<
U extends GenericUnitSpec<Encoding<F>, any>,
L extends GenericLayerSpec<U>,
L extends GenericLayerSpec<U> | LayerSpec<F>,
R extends RepeatSpec,
F extends Field
> =
Expand Down
2 changes: 2 additions & 0 deletions src/spec/layer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Field} from '../channeldef';
import {SharedCompositeEncoding} from '../compositemark';
//import {Encoding} from '../encoding';
import {ExprRef} from '../expr';
import {Projection} from '../projection';
import {BaseSpec, FrameMixins, ResolveMixins} from './base';
Expand All @@ -15,6 +16,7 @@ export interface GenericLayerSpec<U extends GenericUnitSpec<any, any>> extends B
* __Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.
*/
layer: (GenericLayerSpec<U> | U)[];
encoding?: SharedCompositeEncoding<any>;
}

/**
Expand Down
Loading