Skip to content
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
3 changes: 1 addition & 2 deletions src/components/side_panel/chart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { ScorecardChartDesignPanel } from "./scorecard_chart_panel/scorecard_cha
import { SunburstChartDesignPanel } from "./sunburst_chart/sunburst_chart_design_panel";
import { TreeMapChartDesignPanel } from "./treemap_chart/treemap_chart_design_panel";
import { WaterfallChartDesignPanel } from "./waterfall_chart/waterfall_chart_design_panel";
import { GenericZoomableChartDesignPanel } from "./zoomable_chart/design_panel";

export { BarConfigPanel } from "./bar_chart/bar_chart_config_panel";
export { GenericChartConfigPanel } from "./building_blocks/generic_side_panel/config_panel";
Expand All @@ -47,7 +46,7 @@ chartSidePanelComponentRegistry
})
.add("scatter", {
configuration: ScatterConfigPanel,
design: GenericZoomableChartDesignPanel,
design: ChartWithAxisDesignPanel,
})
.add("bar", {
configuration: BarConfigPanel,
Expand Down
4 changes: 0 additions & 4 deletions src/helpers/figures/charts/scatter_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class ScatterChart extends AbstractChart {
readonly dataSetDesign?: DatasetDesign[];
readonly axesDesign?: AxesDesign;
readonly showValues?: boolean;
readonly zoomable?: boolean;

constructor(definition: ScatterChartDefinition, sheetId: UID, getters: CoreGetters) {
super(definition, sheetId, getters);
Expand All @@ -82,7 +81,6 @@ export class ScatterChart extends AbstractChart {
this.dataSetDesign = definition.dataSets;
this.axesDesign = definition.axesDesign;
this.showValues = definition.showValues;
this.zoomable = definition.zoomable;
}

static validateChartDefinition(
Expand Down Expand Up @@ -113,7 +111,6 @@ export class ScatterChart extends AbstractChart {
aggregated: context.aggregated ?? false,
axesDesign: context.axesDesign,
showValues: context.showValues,
zoomable: context.zoomable,
humanize: context.humanize,
};
}
Expand Down Expand Up @@ -148,7 +145,6 @@ export class ScatterChart extends AbstractChart {
aggregated: this.aggregated,
axesDesign: this.axesDesign,
showValues: this.showValues,
zoomable: this.zoomable,
humanize: this.humanize,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/chart/scatter_chart.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LineChartDefinition, LineChartRuntime } from "./line_chart";

export interface ScatterChartDefinition
extends Omit<LineChartDefinition, "type" | "stacked" | "cumulative"> {
extends Omit<LineChartDefinition, "type" | "stacked" | "cumulative" | "zoomable"> {
readonly type: "scatter";
}

Expand Down
27 changes: 27 additions & 0 deletions tests/figures/chart/scatter_chart_plugin.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ChartCreationContext } from "../../../src";
import { ScatterChart } from "../../../src/helpers/figures/charts/scatter_chart";
import { GENERAL_CHART_CREATION_CONTEXT } from "../../test_helpers/chart_helpers";

describe("scatter chart", () => {
test("create scatter chart from creation context", () => {
const context: Required<ChartCreationContext> = {
...GENERAL_CHART_CREATION_CONTEXT,
range: [{ dataRange: "Sheet1!B1:B4", yAxisId: "y1" }],
};
const definition = ScatterChart.getDefinitionFromContextCreation(context);
expect(definition).toEqual({
aggregated: true,
type: "scatter",
background: "#123456",
title: { text: "hello there" },
dataSets: [{ dataRange: "Sheet1!B1:B4", yAxisId: "y1" }],
labelRange: "Sheet1!A1:A4",
legendPosition: "bottom",
dataSetsHaveTitle: true,
labelsAsText: true,
axesDesign: {},
showValues: false,
humanize: false,
});
});
});